Recent

Author Topic: Android Module Wizard  (Read 707729 times)

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #930 on: March 03, 2017, 05:11:03 pm »


Yes, OnDraw signature changed   [lost the parameter jCanvas]! [sorry....]

Please, update your "Controls.native" and your
event handler code.... [now we need just set the property "canvas"
in design time]



Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #931 on: March 03, 2017, 05:31:35 pm »
Yes, OnDraw signature changed   [lost the parameter jCanvas]! [sorry....]

Please, update your "Controls.native" and your
event handler code.... [now we need just set the property "canvas"
in design time]

... there was it, in Controls.native!
thank you!
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Android Module Wizard
« Reply #932 on: March 03, 2017, 05:37:07 pm »
What Lazarus created android programs can I try on my phone?
Lazarus 3.0/FPC 3.2.2

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #933 on: March 03, 2017, 08:57:13 pm »


Yes!
After install LAMW packages you will get a new Lazarus menu  option:
"Run" ---> "[Lamw]Build Android Apk and Run"

You can read from here: "readme_get_start.txt"


Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ketch

  • New member
  • *
  • Posts: 8
Re: Android Module Wizard
« Reply #934 on: March 05, 2017, 02:28:25 pm »
Hello jmpessoa,

Lamw works great with fpc 3.0.0 and lazarus 1.6.2.
I use the last lamw 0.7.13 and it is a great work!

Some times ago a make a test with fpc 3.0.2 and lazarus 1.6.2 and sample apps crash at startup on the android device.
I wait for the lazarus update, but with fpc 3.0.2 and the new lazarus 1.6.4 apps crash to at startup on the android device.

Is it normal, or maybe i make something wrong ?
Thank you!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #935 on: March 05, 2017, 03:24:59 pm »

Hello ketch!

1.Sometimes any modification or update can affect some [outdated] demo application.... what app you have tested?

2. If you change your FPC revision then you need to do a "Run"-->"Clean up and Build" before "[Lamw] "Build Android Apk and Run"
« Last Edit: March 05, 2017, 04:34:07 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ketch

  • New member
  • *
  • Posts: 8
Re: Android Module Wizard
« Reply #936 on: March 05, 2017, 08:55:09 pm »
I have give a try to a lot of random sample and i dont remenber all. :(
I have fpc 3.0.0 and lazarus 1.6.2 reinstalled and can't retry now.
What i can say is that the AppActionBarTabDemo1 for example doesn't work for me and i have make a clean new install after deleting old directory (new fpc, new lazarus and new lamw)...
After executing exactly the same process for go back to fpc 3.0.0 and lazarus 1.6.2 all works great.

ketch

  • New member
  • *
  • Posts: 8
Re: Android Module Wizard
« Reply #937 on: March 06, 2017, 08:34:16 pm »
Hello jmpessoa,

today i make a new try with fpc 3.0.2 and lazarus 1.6.4 (total reinstallation) and i dont find any working sample application.
I reinstall fpc 3.0.0 and keep lazarus 1.6.4 and the majority of sample are working.
It seem that fpc 3.0.2 is the problem.
Is someone using the fpc version 3.0.2 and can confirm there is no problem with this version.

Thank you.

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #938 on: March 07, 2017, 09:34:53 am »
Hello @jmpessoa!

I get a new error, realtoed to pAppOnScreenStyle, starting the app:

Code: [Select]
java.lang.UnsatisfiedLinkError: No implementation found for int com.suevoz.borsa.Controls.pAppOnScreenStyle() (tried Java_com_suevoz_borsa_Controls_pAppOnScreenStyle and Java_com_suevoz_borsa_Controls_pAppOnScreenStyle__)
                      at com.suevoz.borsa.Controls.pAppOnScreenStyle(Native Method)
                      at com.suevoz.borsa.Controls.jAppOnScreenStyle(Controls.java:1258)
                      at com.suevoz.borsa.App.onCreate(App.java:63)

any idea on what happened?
Thank you!
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #939 on: March 07, 2017, 04:07:50 pm »

Maybe the error can be in another [start] place....
Have you some jImageList component? If yes, put a new [dummy] jImageList in form... save all.... now delete the dummy....
So your project has been updated! [jImageList now need a "jImageList.java"  template....]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #940 on: March 07, 2017, 04:32:25 pm »

Maybe the error can be in another [start] place....
Have you some jImageList component? If yes, put a new [dummy] jImageList in form... save all.... now delete the dummy....
So your project has been updated! [jImageList now need a "jImageList.java"  template....]

No, I don't use jImageList. Anyway, if you mean the .create files, where must I put them?
I copy the .native needed files in /lamwdesigner/, but what have I to do with .create ?

Thank you!
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #941 on: March 07, 2017, 04:57:28 pm »

You do not need handle the ".create" or ".native"  for the components.... the form wizard  will take care of this...
What about create a new [test] project .... So you will understand the
new "smartdesigner" ..... and where is handled this stuff...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #942 on: March 07, 2017, 05:28:48 pm »

You do not need handle the ".create" or ".native"  for the components.... the form wizard  will take care of this...
What about create a new [test] project .... So you will understand the
new "smartdesigner" ..... and where is handled this stuff...

What I have understood is that the .native code is copied at the end of Controls.java, when a new component is added to the form. No idea of the purpose of .create file.
At the very first time of the new "smartdesign" era, Controls.java was copied every time from lamw directory to project directory.
Now something is changed, because I guess that Controls.java is recreated on-site, even if I have:

Code: [Select]
CanUpdateJavaTemplate = "True".

Am I right?
thank you!

FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #943 on: March 07, 2017, 08:09:24 pm »

1. "Controls.java" + "Controls.native" + "jCommons.java"are default for all initial project  [like an "empty" form]

2. Every [almost] component has a ".java" and a ".create" and [optional]  a ".native" and [optional] etc ...

3. When you drag&drop a jComponent, over the form,  the "jComponent.java" is inserted in your project ".../scr/...." and the component ".create" and ".native"  are added at the end of "Controls.java"

4.The "smartdesigner" use these information to generate a custom ".lpr" whenever a "save all" occur...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #944 on: March 08, 2017, 09:11:32 am »

1. "Controls.java" + "Controls.native" + "jCommons.java"are default for all initial project  [like an "empty" form]

2. Every [almost] component has a ".java" and a ".create" and [optional]  a ".native" and [optional] etc ...

3. When you drag&drop a jComponent, over the form,  the "jComponent.java" is inserted in your project ".../scr/...." and the component ".create" and ".native"  are added at the end of "Controls.java"

4.The "smartdesigner" use these information to generate a custom ".lpr" whenever a "save all" occur...

Good to know!
I have purged and reassembled Controls.java adhering to the new design, but I get the same error:

Code: [Select]
java.lang.UnsatisfiedLinkError: No implementation found for int com.suevoz.borsa.Controls.pAppOnScreenStyle() (tried Java_com_suevoz_borsa_Controls_pAppOnScreenStyle and Java_com_suevoz_borsa_Controls_pAppOnScreenStyle__)

I think that something in an extra file is not updated, some file like ControlsEvents.txt

in controls.lpr the method is defined as:
Code: [Select]
{ Class:     com_suevoz_borsa_Controls
  Method:    pAppOnScreenStyle
  Signature: ()I }
function pAppOnScreenStyle(PEnv: PJNIEnv; this: JObject): JInt; cdecl;
begin
  Result := Java_Event_pAppOnScreenStyle(PEnv, this);
end;

is this correct?

Thank you!

FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

 

TinyPortal © 2005-2018