LAMW Gradle and androidx.core.app lazarus / 43-Android ---------------------------------------------------------------------- iru · 2022-04-15 09:38 Gentlefolk, Environment: Win 10, Laz 2.0.12, FPC 3.2.0, laz4android2.0.12. I can build and load a LAMW APK into my phone, all works nicely. Using the Ant linker. My application requires a timer and I have tried to use the jcToyTimerSevice timer. Requires Gradle..... The basic Run/Build completes successfully. The [LAMW] Build Android APK and Run fails: Firstly complaining about Gradle setup - Fixed!!! Subsequent failures complain as follows: jcToyTimerService.java:17: error: package androidx.core.app does not exist. I have done some research but so far have failed to find a way to: 1. Download androidx.core.app 2. Install a SPECIFIC module into the Android SDK environment Any help/direction/ideas/etc appreciated, life is to short to try and understand the entire android world, Ian. ---------------------------------------------------------------------- jmpessoa · 2022-04-15 18:05 QuoteMy application requires a timer ... Please,  use jTimer component!  (need only Ant...) QuoteI have tried to use the jcToyTimerSevice... Please, can you   try  "AppJCenterToyTimerServiceDemo1"   demo? But, remember  jcToyTimerSevice is a "toy" about HOW TO make a service component.... ---------------------------------------------------------------------- iru · 2022-04-15 21:14 Thank you for your response. Using the demo for ToyTimer and Gradle works OK and the demo loads on the phone. Add the ToyTimer to my app (which currently is contains several buttons, a textview or two...) and the build/run process informs me that Gradle is required and Gradle is invoked. Gradle fails. Remove the ToyTimer and we are back to Ant... So let me look at the jTimer. Thanks, Ian. ---------------------------------------------------------------------- iru · 2022-04-17 09:14 Gentlefolk, I have had a look at the jTimer. What is the 'unit of time' for the Interval? Cant find a value anywhere... Also if I create an event code jTimer1Timer with an Interval = 1 and   Count 1000 times through this event code and     Perform a self.GetTimeInMilliseconds at the start and end of the 1000 times through the event     Calculate the difference between the start and end self.GetTimeInMilliseconds.   The difference on an old Nokia is around 1388 with only the Count+1 and a test If Count > 1000.   Insert some code to convert the count to a string and save it in a TextView and the the count balloons out to 16000+.   It would appear the jTimer Interval is a nominal value only with the amount of code within the event code determining the time between entries into the event code.   Unfortunately I need an accurate timer.   Any suggestions/ideas/etc, Ian. ---------------------------------------------------------------------- jmpessoa · 2022-04-17 17:49 QuoteUnfortunately I need an accurate timer. Maybe you can try a pure Free Pascal solution.... many FCL stuff works in Android! ---------------------------------------------------------------------- iru · 2022-04-18 02:44 The following link is an interesting read. https://www.gamedeveloper.com/programming/getting-high-precision- timing-on-android ---------------------------------------------------------------------- iru · 2022-04-20 10:40 Gentlfolk, I battled on chasing various timing mechanism and continualy ran int issues with Gradle The LAMW Build APK and run failed with Gradle problems apparently caused by deprecated gradle features. So I went back several versions of Gradle (to gradle 6.4) and the problem went away. Certainly not the best way to address a problem! The error messages suggested that I should do the following to get more data:    Run with --stacktrace option to get the stack trace.    Run with --info or --debug option to get more log output. Run with --scan to get full insights. Run what??? I have worked my way through 'gradle.bat' and tried a few changes to the 'execute'...... No change/success.   @rem Execute Gradle   "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS%........ Any help, suggestions??? Ian. ---------------------------------------------------------------------- jmpessoa · 2022-04-21 19:31 QuoteSo I went back several versions of Gradle (to gradle 6.4) and the problem went away .... from here: https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/readme. md Quoterecommended version: 6.6.1 Use the option "extract here" to produce the folder "gradle-6.6.1" in a convenient location... warning: Gradle >= 7 don't supported by LAMW, yet! warning: Gradle 6.x.y don't support Java > 13! ---------------------------------------------------------------------- iru · 2022-05-01 08:02 Sorry for the belated response. I will do some more work on itr as soon as I can. My application is working well, and i am learning.... So I have some more questions.... Ian.