Lazarus

Programming => Operating Systems => Android => Topic started by: Robert Gilland on March 15, 2019, 07:02:51 am

Title: Android Version and Lazarus
Post by: Robert Gilland on March 15, 2019, 07:02:51 am
Simple Question.

  If I make an app in Lazarus for Android using the latest Android SDK and NDK ( Android Pie = 9.00 ), will this app work in lower version Android systems?
Title: Re: Android Version and Lazarus
Post by: jmpessoa on March 15, 2019, 07:13:10 am
Quote
If I make an app in Lazarus for Android ....

For LAMW: select NDK API <= 22, and Target API = 26 or 27 ....

EDITED: Min Device API = 14       [thanks to @john horst]


Title: Re: Android Version and Lazarus
Post by: lucamar on March 15, 2019, 07:15:53 am
That depends almost entirely on whether you use any new features of Android 9. If you stick to compatible ones it shoud work at least in versions 7+

There may be some other gotchas I don't know about (I'm not all that versed on Android programming): some manifest-style files, permissions, whatever. The NDK/SDK docs should tell you about them.

ETA: Yeha, and what jmpessoa said (http://forum.lazarus.freepascal.org/index.php/topic,44678.msg314340.html#msg314340)
Title: Re: Android Version and Lazarus
Post by: john horst on March 15, 2019, 07:21:46 pm
It will depend on the Minimum API Target, default I think is 15, 19 would be better and 21 is still within reason. If you set both Max and Min to 28, no, it will not run on lower devices than API 28.

I'm using Gradle 5.0, newest NDK, Max 28 - Min 19, Android Plugin 3.3.0... I compile the app in the terminal, never have been able to get it to build in Lazarus without parse "--info" error, build fails, pertaining to gradle clean build --info I assume. 

If you just want to know if you can use the newest NDK to build your app, yes, but Min target is important.
Title: Re: Android Version and Lazarus
Post by: Robert Gilland on March 21, 2019, 01:04:23 am
I have a device of version 17. LAMW Controls example did not work when I set Minimum to 14, changed Minimum to 17 and it worked.
Just seems to be very much a case of trial and error, a pattern of coding I do not like using.
Also I did not realise that ANT build mechanism is broken wasted a couple of days with that.
Switched to Gradle 4.1 and all good. ( Comes with Laz2APK )
It keeps warning of deprecation's coming in Gradle 5. No Idea what they are.
TinyPortal © 2005-2018