Recent

Author Topic: Android Version and Lazarus  (Read 383 times)

Robert Gilland

  • Jr. Member
  • **
  • Posts: 89
Android Version and Lazarus
« 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?

jmpessoa

  • Hero Member
  • *****
  • Posts: 1251
Re: Android Version and Lazarus
« Reply #1 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]


« Last Edit: March 15, 2019, 07:42:58 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

lucamar

  • Hero Member
  • *****
  • Posts: 1064
Re: Android Version and Lazarus
« Reply #2 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
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3 (Home/Prof.), various DOSes.

john horst

  • New member
  • *
  • Posts: 17
Re: Android Version and Lazarus
« Reply #3 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.
« Last Edit: March 15, 2019, 07:44:29 pm by john horst »

Robert Gilland

  • Jr. Member
  • **
  • Posts: 89
Re: Android Version and Lazarus
« Reply #4 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.