Recent

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

Robert Gilland

  • Full Member
  • ***
  • Posts: 160
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: 2297
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: 4219
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/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

john horst

  • Jr. Member
  • **
  • Posts: 68
    • JHorst
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

  • Full Member
  • ***
  • Posts: 160
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.

 

TinyPortal © 2005-2018