Recent

Author Topic: Android Module Wizard  (Read 705522 times)

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #915 on: October 15, 2016, 09:01:37 pm »
Quote
does lamw can use java api directly which just like use windows api now?

LAMW is JNI based.

About JNI:
Quote
.A specification/protocol for calling 'native' code from Java and Java code from native applications ('Invocation API');

.An interface that allows Java to interact with code written in another language:  The Java  code can invoke native methods;

.An interface that allows code written in another language to interact with Java : The native code can instantiate Java objects and invoke methods;

.JNI is about "Programming for the Java Virtual Machine";

.JNI is used  to interact with "native" code produced by system-level language like C/C++ and Pascal/Object Pascal!
« Last Edit: October 15, 2016, 09:03:34 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #916 on: October 29, 2016, 05:59:56 pm »
Hello @jmpessoa!

I got this new, strange error running my app:

Code: [Select]
E/art: dlopen("/data/app/com.suevoz.borsa-1/lib/arm/libcontrols.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "U_$CONTROLS_$$_MOUSE" referenced by "libcontrols.so"...
E/JNI_Load_LibControls: exception
                        java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "U_$CONTROLS_$$_MOUSE" referenced by "libcontrols.so"...

have you any idea what does it mean?

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

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #917 on: November 24, 2016, 02:21:38 am »
Hi, All!

Inspired by @tk's works...

Added LAMW  support to build custom library!

NEW: LAMW IDE Tools "Import C Stuff"
NEW: LAMW Console App -->> checkbox "Library"
[Linux: need add "h2pas" to folder "ide_tools"]

ref.  https://github.com/jmpessoa/lazandroidmodulewizard

Thanks to All!

EDITED.  Thanks to @Renabor.
« Last Edit: November 25, 2016, 05:21:49 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #918 on: November 25, 2016, 04:39:18 pm »

Hi, All!

Inspired by @tk's works...

Added LAMW  support to build custom library!

NEW: LAMW IDE Tools "Import C Stuff"
NEW: LAMW Console App chebox "Library"
[Linux: need add "ht2pas" to folder "ide_tools"]

ref.  https://github.com/jmpessoa/lazandroidmodulewizard

Thanks to All!

What is "ht2pas" and where can I find it?
Thank you!

Found! h2pas (not ht2pas) in fpc/bin !
« Last Edit: November 25, 2016, 04:42:50 pm by renabor »
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #919 on: November 25, 2016, 05:16:05 pm »
Quote
Found! h2pas (not ht2pas) in fpc/bin !

Yes! Please, send me your linux "h2pas" [32 bits] or
put it in LAMW github [folder "ide_tools"].

NOTE 1: About "Import C Stuff".

Open a LAMW project,  go to LAMW "Import C Stuff". LAMW will
produce a library [*.so] and put it in the same folder of "controls.so".
Then "h2pas" will produce a header conversion (*.pp) for each ".h"  and put it in  folder   "..../jni".  Add the "*.pp" stuff to "uses" section and.... have fun! 

NOTE 2. There is some issue/bug with  Android < 4.1 (already explained here in the forum by @yury_sidorov). So stay with 4.1+.
« Last Edit: November 25, 2016, 05:22:59 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #920 on: November 25, 2016, 06:19:15 pm »
Quote
Found! h2pas (not ht2pas) in fpc/bin !

Yes! Please, send me your linux "h2pas" [32 bits] or
put it in LAMW github [folder "ide_tools"].

I have put a link in ide_tools pointing to fpc_src_dir/bin/h2pas and I think it is a better choice. What can succeed if version of h2pas provided is not compatible with fpc version installed?
Automating the link creation could be a good solution in my advice
« Last Edit: November 25, 2016, 06:33:20 pm by renabor »
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

spiritt

  • Newbie
  • Posts: 2
Re: Android Module Wizard
« Reply #921 on: November 30, 2016, 01:31:35 pm »
Hello everyone!

Can anyone tell me, why using block in LAMW:

try
   ...
   try
       ...
   except
   ...
finally
   ...
end;

doesn't work !? Any suggestions?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #922 on: November 30, 2016, 03:44:25 pm »

Hello   spiritt!

From demo "AppPascalLibExceptionHandlerDemo1"

procedure TAndroidModule1.jButton1Click(Sender: TObject);
var
  i: integer;
begin
  try
    i:= StrToInt('p');   // some erroneous code
  except
    on E: Exception do ShowMessage(Self.DumpExceptionCallStack(E));  //Thanks to Euller and Oswaldo!
  end;
end;
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

spiritt

  • Newbie
  • Posts: 2
Re: Android Module Wizard
« Reply #923 on: December 17, 2016, 10:38:31 pm »
Ok, thank You for Your quick response:) However it doesn't work good as well...

I put those lines below to mentioned project:

var
  tf: TextFile;
begin
    try
      AssignFile(tf, '\\');
      Append(tf);
      Writeln(tf, 'Test');
      // some erroneous code
      //    i:= StrToInt('p');
  except
    on E: Exception do ShowMessage(Self.DumpExceptionCallStack(E));  //Thanks to Euller and Oswaldo!
  end;
  CloseFile(tf);
end;

...and as the result the app closed. Any other tip? Thank You in advance  :D

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #924 on: January 28, 2017, 10:36:57 pm »


Hi All!

There are some news in LAMW repository!

ref.
https://github.com/jmpessoa/lazandroidmodulewizard

   NEW! jOpenDialog component   [thanks to @majid.ebru's suggestion!]
   NEW! demo AppOpenFileDialogDemo1

   IMPROVED! jForm: added news methods:  [thanks to @Fatih !]
      GetAssetContentList
      GetDriverList
      GetFolderList
      GetFileList

   NEW! jFileProvider component
   NEW! demo AppFileProviderDemo1   <-- Run First!!
   NEW! demo AppFileProviderClientDemo1

And many, many infrastructure improvements [thanks to @A.S !]

Thanks to All!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #925 on: February 18, 2017, 05:20:49 pm »

Hi All!

There is an updated LAMW revision!

ref https://github.com/jmpessoa/lazandroidmodulewizard

Version 0.7.11 - 17 - Feb - 2017

   NEW! jWindowManager component

   NEW! demo AppWindowManagerDemo1
      [floating and draggable View!]

   IMPROVED!
      jForm: news methods:
         Minimize
         Restart

      jButton: news methods
         SetCompoundDrawables
         SetRoundCorner
         SetRadiusRoundCorner

      jTextView: news methods
         SetCompoundDrawables
         SetRoundCorner
         SetRadiusRoundCorner

      jRadioGroup: news methods
         SetRoundCorner
         SetRadiusRoundCorner
         
      jPanel:: news methods
         SetRoundCorner
         SetRadiusRoundCorner

      jImageView: news methods      
         SetRoundCorner
         SetRadiusRoundCorner

      jEditText: news method
         SetCompoundDrawables

      jCheckBox: news method
         SetCompoundDrawables

      jRadioButton: news method
         SetCompoundDrawables            


Thanks to All!

PS.
Hi @majid.ebru the "AppLocationDemo1" was updated!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 494
Re: Android Module Wizard
« Reply #926 on: February 19, 2017, 12:52:56 pm »
thank you very Mr.jmpessoa


Hi All!

There is an updated LAMW revision!

ref https://github.com/jmpessoa/lazandroidmodulewizard

Version 0.7.11 - 17 - Feb - 2017

   NEW! jWindowManager component

   NEW! demo AppWindowManagerDemo1
      [floating and draggable View!]

   IMPROVED!
      jForm: news methods:
         Minimize
         Restart

      jButton: news methods
         SetCompoundDrawables
         SetRoundCorner
         SetRadiusRoundCorner

      jTextView: news methods
         SetCompoundDrawables
         SetRoundCorner
         SetRadiusRoundCorner

      jRadioGroup: news methods
         SetRoundCorner
         SetRadiusRoundCorner
         
      jPanel:: news methods
         SetRoundCorner
         SetRadiusRoundCorner

      jImageView: news methods      
         SetRoundCorner
         SetRadiusRoundCorner

      jEditText: news method
         SetCompoundDrawables

      jCheckBox: news method
         SetCompoundDrawables

      jRadioButton: news method
         SetCompoundDrawables            


Thanks to All!

PS.
Hi @majid.ebru the "AppLocationDemo1" was updated!
« Last Edit: February 19, 2017, 05:09:37 pm by majid.ebru »

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #927 on: February 24, 2017, 05:55:11 pm »
Hello @jmpessoa!
great work on new version!
For next releases, can you (not only you, off course), please, avoid to add and remove randomly spaces in front of lines?
Indeed comparing versions of such files is very frustrating
thank you!
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: Android Module Wizard
« Reply #928 on: February 27, 2017, 05:48:28 pm »

Hi, All!

There is a new LAMW revision!

ref.

https://github.com/jmpessoa/lazandroidmodulewizard

Version 0.7.13 - 27 - Feb - 2017

   NEW! jMaps component  [A wrapper to run google app "Maps"]

   NEW! demo AppMapsDemo1

   REFACTORING!
      All java tamplates are now in compliance with @DonAlfredo's "jCommons.java"
      and [try] SDK API >= 13 compatible [thanks to @tk]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #929 on: March 03, 2017, 11:10:55 am »
Hello @jmpessoa!

after last commit to github, changes made to Java_Event_pOnDraw make it impossible to build without errors.
Error message is:

Code: [Select]
controls.lpr(564,1) Error: Wrong number of parameters specified for call to "Java_Event_pOnDraw"

can you please correct it?
Thank you!
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

 

TinyPortal © 2005-2018