Recent

Author Topic: Android Module Wizard  (Read 708069 times)

Mladen

  • New Member
  • *
  • Posts: 30
Re: Android Module Wizard
« Reply #765 on: April 12, 2016, 10:20:49 am »
Hello I have noticed that when I set for an example
Code: Pascal  [Select][+][-]
  1. jEditText1.HintTextColor:=colbrSilver;
hint color always remain the default one.

Also when I set
Code: Pascal  [Select][+][-]
  1. jEditText1.InputTypeEx:=itxTextPassword;
first typed letter is not hidden :)  Only when entering the 2nd one the first one gets hidden.

Also I was wondering is there a way to to set FontFace for jListView. For an example on jEditText i can do
Code: Pascal  [Select][+][-]
  1. jEditText1.FontFace:=FFMonospace;

Thank you!!
« Last Edit: April 12, 2016, 01:46:50 pm by Mladen »
Using Lazarus 2.0.12 with FPC 3.2.2 on Linux Mint 20.2 Xfce

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Android Module Wizard
« Reply #766 on: April 12, 2016, 05:42:32 pm »
I've re-read again a few the way this wizard works, and I still wondering why it is so complicate to create Android applications.  It has no sense for me.  %)

And don't tell me about cross-compiling:  it isn't.

Anyway, keep up the work.  I'll need to use this soon.  ;D
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #767 on: April 13, 2016, 03:44:39 am »
Hello All!

The LAMW was updated!

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

Version 0.6 - rev. 38.6 - 12 April 2016 -

   UPDATED! jHttpClient has been updated to use HttpURLConnection [We can Target API >= 21 !!] // <<-----Thanks to @Renabor!

   NEW! Added demo AppHttpClientDemo2

   NEW! jListView property "FontFace" // <<---@Mladen suggestion



@Mladen.....

1. [FIXED!] colbrSilver = colbrDefault !!!

2. About password mask: I will try some solution!

3 [SOLVED!]  jListView.FontFace:= ffMonospace ;


@Ñuño_Martínez....

Please try: "readme_get_start.txt" ...


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

Mladen

  • New Member
  • *
  • Posts: 30
Re: Android Module Wizard
« Reply #768 on: April 13, 2016, 11:46:33 am »
Hello and thank you for your time!

I have tested it and confirm that setting
Code: Pascal  [Select][+][-]
  1.  jEditText1.HintTextColor
now works but only when
Code: Pascal  [Select][+][-]
  1. jEditText1.FontColor=colbrDefault

I have also tried
Code: Pascal  [Select][+][-]
  1.  jListView1.FontFace:=FFMonospace
but it doesn't appear to work for me.


Thank you!!
Using Lazarus 2.0.12 with FPC 3.2.2 on Linux Mint 20.2 Xfce

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #769 on: April 13, 2016, 10:37:49 pm »
Hello Mladen!

Sorry....

I make a minor change to try fix  jListView1.FontFace

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

[changed]
"Controls.java"
"Laz_And_Controls.pas"

NOTE: If you have put [initial] items in design time,
then you need set jListView1.FontFace in design time, too.
« Last Edit: April 14, 2016, 03:30:16 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Mladen

  • New Member
  • *
  • Posts: 30
Re: Android Module Wizard
« Reply #770 on: April 14, 2016, 12:12:48 pm »
Hello Mladen!

Sorry....

I make a minor change to try fix  jListView1.FontFace

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

[changed]
"Controls.java"
"Laz_And_Controls.pas"

NOTE: If you have put [initial] items in design time,
then you need set jListView1.FontFace in design time, too.

I tried jListView1.FontFace:=FFMonospace;

And it works now!

Thank you!!
Using Lazarus 2.0.12 with FPC 3.2.2 on Linux Mint 20.2 Xfce

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #771 on: April 16, 2016, 04:52:17 am »
I can't make OpenGL (jCanvasES2) work on LAMW. Has anybody had any success to use OpenGL on LAMW?

My sample code:
Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jCanvasES2_1GLCreate(Sender: TObject);
  2. begin
  3.   jCanvasES2_1.Screen_Setup(1, 1);
  4. end;
  5. ...
  6. ...
  7. procedure TAndroidModule1.jCanvasES2_1GLDraw(Sender: TObject);
  8. var
  9.   XY: TXY;
  10.   RGBA: TRGBA;
  11. begin
  12.  
  13.   jCanvasES2_1.Screen_Clear(0.9, 0.3, 0.3, 1);
  14.  
  15.   XY.X := Random(100)/100;
  16.   XY.Y := Random(100)/100;
  17.   RGBA.R := Random(100)/100;
  18.   RGBA.G := Random(100)/100;
  19.   RGBA.B := Random(100)/100;
  20.   RGBA.A := Random(100)/100;
  21.  
  22.   jCanvasES2_1.DrawCircle(XY, 0, Random(100)/100+0.05, RGBA);
  23.  
  24. end;

Is there anything wrong with the code above? I noticed that eglSwapBuffers isn't available on LAWM.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #772 on: April 16, 2016, 06:05:25 am »

Hello Handoko!

Please, try  "AppDemo1"....

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

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #773 on: April 16, 2016, 08:05:18 am »
Did you mean this one?
.../Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1

I can't see any OpenGL ES usage in the demo. Also it can't be compiled on my computer. Please see the attached picture for the error messages.

If I start a new Android [GUI] Module [lamw] and put some buttons, it works. I can build apk and run on my Intel-based Android phone (although the configuration is Android-arm).

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android Module Wizard
« Reply #774 on: April 16, 2016, 09:32:28 am »
Did you mean this one?
.../Android/lazandroidmodulewizard.git/trunk/demos/Ant/AppAntDemo1
No, the one under Eclipse folder. You can make it an Ant project simply by providing build.xml that you can copy from the Ant demos project and modify the values inside accordingly.
I can build apk and run on my Intel-based Android phone (although the configuration is Android-arm).
Intel based Android devices usually have libhoudini installed. It's an ARM compatibility layer so Intel based devices can still install and run many applications from play store which might be compiled only for ARM.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #775 on: April 16, 2016, 03:56:55 pm »
Some info:

about "build.xml"  it is already there...   [folder "... /jni" ]

But to use/test any demo App you will need:

1. configure "build.xml"  to match your system...

2. configure the ".lpi" to match your system...

NOTE 1: if you need configure for "x86" please, go to folder "...\AppDemo1\jni\build-modes"  and see "readme.txt" to replace some lines in ".lpi"

NOTE 2. The LAMW produce many ".bat" or ".sh" to logcat ... there are more in  "...\utils", too

3. Lazarus IDE --> Run --> "build"   [to produce the pascal jni ".so"]

4. Connect your Device-PC  via usb ...

5. Lazarus IDE --> Run --> "[Lamw] Build Android Apk and Run"

NOTE:  All projects in "Eclipse" folder are Ant compatible .... and can be used as explained....

Thanks All!

PS. HttpClient [updated!] now work fine when target API >=21
« Last Edit: April 16, 2016, 04:11:20 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #776 on: April 16, 2016, 04:19:26 pm »
Thanks Leledumbo and jmpessoa for the helps.

So far I now can compile simple tests (new project with some texts and buttons) and able to build apks that can run on my Intel phone without changing any of the default project options generated by the LAMW.

But I have problem compiling the the AppAntDemo1. When I tried to compile it, I get this message:
Quote
/usr/bin/arm-linux-androideabi-ld: cannot find -ljnigraphics
/usr/bin/arm-linux-androideabi-ld: cannot find -lGLESv1_CM
/usr/bin/arm-linux-androideabi-ld: cannot find -lGLESv2
/usr/bin/arm-linux-androideabi-ld: cannot find -lc
/usr/bin/arm-linux-androideabi-ld: cannot find -lc
/home/handoko/Android/lazandroidmodulewizard.git/trunk/demos/Eclipse/AppDemo1/jni/controls.lpr(1223,15) Error: (9013) Error while linking
/home/handoko/Android/lazandroidmodulewizard.git/trunk/demos/Eclipse/AppDemo1/jni/controls.lpr(1223,15) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /usr/bin/ppcrossarm returned an error exitcode

Note:
My computer is Intel Core2 Quad + Ubuntu Mate 64-bit .
My target device is Intel 64-bit + Android 5.0
I ever tried LazToApk but no luck to make it work on Intel + Android 5.0

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android Module Wizard
« Reply #777 on: April 16, 2016, 04:31:25 pm »
But I have problem compiling the the AppAntDemo1. When I tried to compile it, I get this message:
Modify path related project settings according to your installation, those libraries should be in $(your android ndk folder)/platforms/android-$(your target api)/arch-arm/usr/lib/.

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Android Module Wizard
« Reply #778 on: April 17, 2016, 03:49:45 pm »
Hello, I'm back. I'm new in using LAMW and my only Android device is Intel 64-bit. After a full day of testing, here I want to share what I found. Hope it can be useful.

The demos under the Eclipse folder aren't compatible with Intel 64-bit using libhoudini. I opened many of the demos (under Eclipse) and followed jmpessoa instructions properly modifying build.xml and .lpi files based on my successfully new generated app settings (which run properly on my device). All of them can be compiled without error but when running on my device, it said "Unfortunately, [name] has stopped."

Even if I removed all the components on the main form and deleted all the other forms in the demos, I still get same the result. The remain is very basic TAndroidModule jForm class only without any components nor events. Simply to say, it's only a blank app. So it makes me think, there could be something generated by LAMW that causes incompatible with Intel+libhoudini. Because if I started a new app using LAMW, the apk works on my device. I mean, the demos were generated using prior version of LAMW than mine (version 0.6). Can anybody tell me, is there a way we can refresh the files generated by LAMW but keep the 'pure' Lazarus code unchanged?

libhoudini compatibility layer is not 100% compatible with ARM. So far I have tested jTextView, jButton, jImageView, jImageList and jTimer. All of them work correctly on Intel device although my compiler was set to Android-arm. But if the command jCanvasES2.Texture_Load_All is being executed, an error will occur immediately.

All the tests above were compiled using Android-arm setting, because I still have no luck building my Lazaurs to cross compile to Android-i386. When try to compile to Android-i386, I got this error message: "Fatal: Cannot find system used by fcllaz of package FCL." Any idea what should I do?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #779 on: April 17, 2016, 05:36:07 pm »
Quote
Can anybody tell me, is there a way we can refresh the files generated by LAMW but keep the 'pure' Lazarus code unchanged?

Yes [in fact all demos should be upgraded before use] !!
Please, go to Lazarus IDE menu "Tools" ---> "[Lamw] Android Module Wizard" --->> "Upgrade code templates"

Quote
...because I still have no luck building my Lazaurs to cross compile to Android-i386.

Please, [try]  Lazarus IDE menu "Tools" ---> "[Lamw] Android Module Wizard" --->> "Build FPC Cross Android"

Thank you!

PS. It is always good to keep updated your LAMW version/revision
« Last Edit: April 17, 2016, 05:48:03 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018