[Closed] LazToApk 0.9.39 is available now. lazarus / 43-Android ---------------------------------------------------------------------- DelphiFreak · 2017-12-13 05:28 Hello, a new version is available. For users with already installed version 0.9.38, please select "update" in the setup. ( I only changed laztoapk.exe so no need to download all the 3rd-Party stuff again). What's new ? 17.Dez. 2017 (v0.9.0.39) - updated laztoapk.exe. Improved user-interface. - updated laztoapk.exe. Avoid overwrite of existing projects. - updated installer. Pre-defined install types "full","update","custom". 13.Dez. 2017 (v0.9.0.38) - updated to download laz4android1.8.0-FPC3.0.4.7z - updated to download android-ndk-r14b-windows-x86.zip - changed laztoapk to use new laz4android-path "laz4android1.8". - preparations to use this setup also with LAMW. - updated installation documentation. The documentation: https://sourceforge.net/projects/laztoapk/files/Lazarus%20and%20Androi d.pdf/download The installer: https://sourceforge.net/projects/laztoapk/files/?source=navbar Have fun... Sam ---------------------------------------------------------------------- Handoko · 2017-12-13 06:52 Great, and thank you. I'm a bit busy currently, will test it later and report back my test result. ---------------------------------------------------------------------- turrican · 2017-12-13 14:32 Quote from: DelphiFreak on December 13, 2017, 06:28:33 amHello, a new version is available. What's new ? 13.Dez. 2017 (v0.9.0.38) - updated to download laz4android1.8.0-FPC3.0.4.7z - updated to download android-ndk-r14b-windows-x86.zip - changed laztoapk to use new laz4android-path "laz4android1.8". - preparations to use this setup also with LAMW. - updated installation documentation. The documentation: https://sourceforge.net/projects/laztoapk/files/Lazarus%20and%20Androi d.pdf/download The installer: https://sourceforge.net/projects/laztoapk/files/?source=navbar Have fun... Sam Thanks this is a great tool! ---------------------------------------------------------------------- CC · 2017-12-14 17:38 Hi, When running a simple project created by LazToAPK the main form appears  for a split second with the form header,  but without its content and  after that the app is terminated. Cfg: Huawei  P8 Android 5.01 API version 4.0/5.11 Custom opitons: -CfVFPV3 -CpARMV7A  The result was the same with the original options -CpARMV6 ... This is the relevant part of the ADB log: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  W/PGMiddleWare( 3968): in handleAction, invoke client = com.huawei.pgmng.middleware.AudioEffectLowPowerImpl@32a43195, action = com.huawei.pgmng.PGAction@968a4ef actionId =10000 pkg =com.pascal.A02 extend1 =10251 extend2 = flag =3 type =1 I/lclapp  (29879): [LCLOnConfigurationChanged] i=0 lOldDPI=72 lNewDPI=422 lOldFormWidth=100 lNewFormWidth=1080 E/art     (29879): 0xab8e6b60 SpaceTypeMallocSpace begin=0x12c00000,end=0x12e01000,limit=0x22c00000, size=2MB,capacity=256MB,non_growth_limit_capacity=256MB,name="main rosalloc space"] E/art     (29879): 0xabc66a58 allocspace main rosalloc space live-bitmap 3[begin=0x12c00000,end=0x22c00000] E/art   (29879): 0xabc321d0 allocspace main rosalloc space mark-bitmap 3[begin=0x12c00000,end=0x22c00000] E/art     (29879): 0xab8e50d8 SpaceTypeImageSpace begin=0x7049a000,end=0x710e7570,size=12MB,name="/data/dalvik- cache/arm/system@framework@boot.art"] E/art     (29879): 0xab8e4e58 imagespace /data/dalvik-cache/arm/system@framework@boot.art live- bitmap 0[begin=0x7049a000,end=0x710e7600] E/art     (29879): 0xab8e4e58 imagespace /data/dalvik-cache/arm/system@framework@boot.art live-bitmap 0[begin=0x7049a000,end=0x710e7600] E/art     (29879): 0xaba9ad20 SpaceTypeZygoteSpace begin=0x748fd000,end=0x76345000,size=26MB,name="Zygote space"] E/art   (29879): 0xab8e6820 allocspace zygote / non moving space live-bitmap 0[begin=0x748fd000,end=0x76345000] E/art     (29879): 0xab8e4d70 allocspace zygote / non moving space mark-bitmap 0[begin=0x748fd000,end=0x76345000] E/art     (29879): 0xab8e6d50 SpaceTypeMallocSpace begin=0x76345000,end=0x76351000,limit=0x788fd000, size=48KB,capacity=37MB,non_growth_limit_capacity=37MB,name="alloc space"] E/art     (29879): 0xabbaae68 allocspace alloc space live- bitmap 4[begin=0x76345000,end=0x788fd000] E/art     (29879): 0xabb1eb30 allocspace alloc space mark-bitmap 4[begin=0x76345000,end=0x788fd000] E/art     (29879): 0xab8e9bb0 large object space:GcRetentionPolicyAlwaysCollect F/art     (29879): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: native code passing in reference to invalid stack indirect reference table or invalid reference: 0xffbffa60 F/art     (29879): art/runtime/check_jni.cc:65]     in call to SetObjectField F/art     (29879): art/runtime/check_jni.cc:65]     from int com.pascal.A02.LCLActivity.LCLOnConfigurationChanged(int, int) F/art   (29879): art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable F/art     (29879): art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x75a45960 self=0xab8ebf58 F/art   (29879): art/runtime/check_jni.cc:65]   | sysTid=29879 nice=-1 cgrp=apps/top_visible sched=0/0 handle=0xf713fec8 F/art     (29879): art/runtime/check_jni.cc:65]   | state=R schedstat=( 93688192 1835184 88 ) utm=6 stm=3 core=6 HZ=100 F/art     (29879): art/runtime/check_jni.cc:65]   | stack=0xff402000-0xff404000 stackSize=8MB F/art     (29879): art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held) F/art     (29879): art/runtime/check_jni.cc:65]   native: #00 pc 00004bec  /system/lib/libbacktrace_libc++.so (_ZN13UnwindCurrent6UnwindEjP8ucontext+23) F/art     (29879): art/runtime/check_jni.cc:65]   native: #01 pc 00003489  /system/lib/libbacktrace_libc++.so (_ZN9Backtrace6UnwindEjP8ucontext+8) F/art     (29879): art/runtime/check_jni.cc:65]   native: #02 pc 0025428d  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostre amIcNS0_11char_traitsIcEEEEiPKcPNS_6mirror9ArtMethodE+84) F/art     (29879): art/runtime/check_jni.cc:65]   native: #03 pc 00238329  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIc NS1_11char_traitsIcEEEE+160) F/art     (29879): art/runtime/check_jni.cc:65]   native: #04 pc 000b140d  /system/lib/libart.so (_ZN3artL8JniAbortEPKcS1_+620) F/art     (29879): art/runtime/check_jni.cc:65]   native: #05 pc 000b1b3d  /system/lib/libart.so (_ZN3art9JniAbortFEPKcS1_z+68) F/art     (29879): art/runtime/check_jni.cc:65]   native: #06 pc 000b4007  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckEbPKcz.constprop.128+710) F/art     (29879): art/runtime/check_jni.cc:65]   native: #07 pc 000b77cd  /system/lib/libart.so (_ZN3art8CheckJNI14SetObjectFieldEP7_JNIEnvP8_j objectP9_jfieldIDS4_+64) F/art     (29879): art/runtime/check_jni.cc:65]   native: #08 pc 0007f430  /data/app/com.pascal.A02-1/lib/arm/liblclapp.so (???) F/art     (29879): art/runtime/check_jni.cc:65]   at com.pascal.A02.LCLActivity.LCLOnConfigurationChanged(Native method) F/art     (29879): art/runtime/check_jni.cc:65]   at com.pasca l.A02.LCLActivity$LCLSurface.onDraw(LCLActivity.java:130) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.View.draw(View.java:15047) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.View.draw(View.java:14955) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewGroup.drawChild(ViewGroup.java:3304) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3096) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.View.draw(View.java:14950) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewGroup.drawChild(ViewGroup.java:3304) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3096) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.View.draw(View.java:14950) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewGroup.drawChild(ViewGroup.java:3304) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3096) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.View.draw(View.java:15050) F/art     (29879): art/runtime/check_jni.cc:65]   at android.widget.FrameLayout.draw(FrameLayout.java:594) F/art     (29879): art/runtime/check_jni.cc:65]   at com.android.internal.policy .impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2611) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2721) F/art   (29879): art/runtime/check_jni.cc:65]   at android.view.ViewRootImpl.draw(ViewRootImpl.java:2608) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2406) F/art   (29879): art/runtime/check_jni.cc:65]   at android.view.ViewRootImpl. performTraversals(ViewRootImpl.java:2030) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1094) F/art   (29879): art/runtime/check_jni.cc:65]   at android.view.ViewRootImpl$ TraversalRunnable.run(ViewRootImpl.java:6054) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.Choreographer$CallbackR ecord.run(Choreographer.java:793) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.Choreographer.doCallbacks(Choreographer.java:606) F/art   (29879): art/runtime/check_jni.cc:65]   at android.view.Choreographer.doFrame(Choreographer.java:575) F/art     (29879): art/runtime/check_jni.cc:65]   at android.view.Choreographer$ FrameDisplayEventReceiver.run(Choreographer.java:779) F/art     (29879): art/runtime/check_jni.cc:65]   at android.os.Handler.handleCallback(Handler.java:739) F/art     (29879): art/runtime/check_jni.cc:65]   at android.os.Handler.dispatchMessage(Handler.java:95) F/art     (29879): art/runtime/check_jni.cc:65]   at android.os.Looper.loop(Looper.java:135) F/art     (29879): art/runtime/check_jni.cc:65]   at android.app.ActivityThread.main(ActivityThread.java:5538) F/art     (29879): art/runtime/check_jni.cc:65]   at java.lang.reflect.Method.invoke!(Native method) F/art     (29879): art/runtime/check_jni.cc:65]   at java.lang.reflect.Method.invoke(Method.java:372) F/art     (29879): art/runtime/check_jni.cc:65]   at com.android.internal.os.ZygoteInit$M ethodAndArgsCaller.run(ZygoteInit.java:958) F/art     (29879): art/runtime/check_jni.cc:65]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:753) F/art   (29879): art/runtime/check_jni.cc:65]  F/art     (29879): art/runtime/runtime.cc:286] Runtime aborting... ---------------------------------------------------------------------- ahiggins · 2017-12-14 17:42 great work, will test shortly ---------------------------------------------------------------------- CC · 2017-12-14 23:08 There is already a topic about the same problem: http://forum.lazarus.freepascal.org/index.php/topic,31977.0.html ---------------------------------------------------------------------- kupferstecher · 2017-12-15 11:47 I learned from Handoko that in the last versions of LazToApk with CustomDrawn the android versions 5 and higher are not support (app crashes). At least a test with a app compiled with LazToApk 0.9.0.37 failed on android 5. Perhaps it's (still) the same thing? ---------------------------------------------------------------------- DelphiFreak · 2017-12-15 11:57 Hi, nothing has changed in CustomDrawn components. It looks like the development of this has "stalled". Therefore I would like to move to LAMW. That's why I updated the installation PDF. It describes how to install LAMW. I also added the automatic download of ANT to laztoapk because LAMW needs that stuff somehow. I played around a little with LAMW, but had also the expirence that some demo apps worked and some crashed. Sorry I have no time/interest to dive deeper into this android stuff. Next step would be to change laztoapk-GUI to compile LAMW projects. Have fun. ---------------------------------------------------------------------- kupferstecher · 2017-12-15 22:32 Hello DelphiFreak, thanks for the reply. I understand, its a CustomsDrawn issue, not a LazToApk issue. It seems LAMW is becoming the standard. But I think the LCL- CustomDrawn approach is very presious and shouldn't be abandoned. Perhaps you could introduce LAMW without dropping CustomDrawn out of LazToApk. Regards ---------------------------------------------------------------------- Handoko · 2017-12-16 06:25 @DelphiFreak Is there any requirement for installing LazToApk 0.9.38? I can't install it on my WinXP sp2 system. The error already happened since version 0.9.36: http://forum.lazarus.freepascal.org/index.php/topic,34897.msg229764.ht ml#msg229764 ---------------------------------------------------------------------- DelphiFreak · 2017-12-16 08:12 Hello Handoko, no there is no special requirement. The previous versions (up to 0.9.37) I also tested on winxp SP3 and I saw never a message like this. The version 0.9.38 I only tested on windows7. Sorry. ---------------------------------------------------------------------- CC · 2017-12-17 13:45 DelphiFreak Customdrawn widgets can /supposed to be work for other platfroms, like IOs as well. I think it is worth considering to keep it alive. I am trying to fix the current issuses with Android 5+. There is one basic  thing I do not understand: LaztoAPK creates normal TLabel ... controls for the demo app. I thought the  Customdrawn controls are meant to be used. After replacing the main form for the app generated by LazToAPK  with a new empty one the app is working. After adding CD controls: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  I/lclapp  (14712): [FORMS.PP] ExceptionOccurred  I/lclapp  (14712):   Sender=EClassNotFound I/lclapp  (14712):   Exception=Class "TCDButton" not found What would be the basic concept for a CD  app? ---------------------------------------------------------------------- CC · 2017-12-17 17:32 The cause of  the exception is an IDE issue, the  declaration of the control  is not added to  the  unit when the control is placed on the form.  Te LFM file is updated properly. ---------------------------------------------------------------------- CC · 2017-12-17 19:46 Good news! I think I have found the problem and fixed it. Still needs testing, but  my simple test app is able to start and working properly on a device with Android 5.01. ---------------------------------------------------------------------- CC · 2017-12-17 22:17 Well, after some testing the original problem which made it  impossible to start the apps is solved. But the general state of  CustomDrawn controls for Android  does not look good at all. Slow screen refresh ... very unstable ... simple things like touch event on an image is not working...  This requires quite some time to work on which I do not have right now. ---------------------------------------------------------------------- turrican · 2017-12-18 08:44 Quote from: CC on December 17, 2017, 11:17:33 pmWell, after some testing the original problem which made it  impossible to start the apps is solved. But the general state of  CustomDrawn controls for Android  does not look good at all. Slow screen refresh ... very unstable ... simple things like touch event on an image is not working...  This requires quite some time to work on which I do not have right now. Which framework customdrawn components are based on? Native JNI Android components? ---------------------------------------------------------------------- kupferstecher · 2017-12-18 09:42 According the Lazarus wiki: http://wiki.freepascal.org/Custom_Drawn_Interface/Android#Architecture QuoteLCL-CustomDrawn-Android utilizes a minimal Java application which communicates with our Pascal library and sends all events to it and also obeys commands from it. The communication is done via JNI as supported by Google. The controls are not native, instead they are all drawing using TRawImage+TLazIntfImage+TLazCanvas and events and the painting are clipped using LazRegions. The drawing itself is done in Pascal using jnigraphics to draw on a Bitmap Java object which is then drawn by the minimal Java activity on a SurfaceView. ---------------------------------------------------------------------- turrican · 2017-12-18 09:45 Thank you very much! So the performance it's near to native Android components? ---------------------------------------------------------------------- CC · 2017-12-18 12:21 turrican The screen generation is visibly slower - for my taste it is too slow. Maybe it can be optimized. At its current state it seems to be far from production ready. I would say it is somewhere between alpha and beta stage. Lots of work has been done, all the foundations are there but it is not finished. ---------------------------------------------------------------------- kupferstecher · 2017-12-20 21:44 Quote from: CC on December 17, 2017, 11:17:33 pmWell, after some testing the original problem which made it  impossible to start the apps is solved. Hello CC, did you fix the problem in the official sources, or only locally? You said it was an Lazarus-IDE issue? ---------------------------------------------------------------------- CC · 2017-12-20 23:19 There was a long standing issue which caused  that apps with custom drawn controls could not be started  on devices with Android 5+.  (More precisely they are  aborted while rendering the screen.)  For this I have a fix locally.  Right now I have an important deadline, but I will send in the bug fix to the Lazarus team when time allows. ---------------------------------------------------------------------- kupferstecher · 2017-12-21 12:32 OK, thats good. Perhaps you can notify us when you sent the fix. Regards~ ---------------------------------------------------------------------- OldMan · 2018-04-19 06:09 Hello I get an error during the download process. What am I doing wrong? Thank you for reading OldMan ---------------------------------------------------------------------- ramdhani · 2018-12-21 03:55 How to connect LazToApk 0.9.39 with Nox App Player for Android development and debug? ---------------------------------------------------------------------- dbannon · 2018-12-21 22:57 Quote from: DelphiFreak on December 13, 2017, 06:28:33 am... The documentation: https://sourceforge.net/projects/laztoapk/files/Lazarus%20and%20Androi d.pdf/download 'The "/Lazarus and Android..arus and Android.pdf" file could not be found or is not available. Please select another file.' Davo ---------------------------------------------------------------------- lucamar · 2018-12-21 23:15 dbannon, you'll have to look inside the repository (folder ./doc/). There doesn't seem to be released docs (unless they are inside the install exe). ---------------------------------------------------------------------- DelphiFreak · 2018-12-31 05:11 Hello, you "re-opened" an old post. Please look at: http://forum.lazarus- ide.org/index.php/topic,42567.0.html Thank you.