Recent

Author Topic: [SOLVED] LCL Example ICS 4.0.3  (Read 6987 times)

José Mejuto

  • Full Member
  • ***
  • Posts: 136
[SOLVED] LCL Example ICS 4.0.3
« on: June 16, 2012, 08:25:05 pm »
Hello,

I was playing with the Virtual Machine to generate android applications, everything went more or less smooth, apk generated, apk uploaded to a Nexus One (2.3) emulator ADV and the app runs, more or less, but it runs. Now upload to my Galaxy Nexus with ICS 4.0.4 and the application crashes with a nice SIGSEGV at "deadd00d".

I had updated my emulator to a recent version that can emulate ICS and it crashes in the same way as in the phone, the app just enter fullscreen mode and after a half of a second it simply "quits". Logcat shows the "deadd00d" address and the call stack shows 00000000 in the first frame and libc.so in the second one.

The problem is that the small app that I need to write should run in a 2.3 devices and in one or two 4.0.4, so the 2.3 seems to not have a serious problem, but the ICS... :(

Can anybody help me to find the reason of the crash ? Any test that I should perform ? Any help ?

Thank you.
« Last Edit: June 20, 2012, 01:43:12 pm by JoshyFun »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: LCL Example ICS 4.0.3
« Reply #1 on: June 18, 2012, 07:59:51 am »
Until something like 1 or 2 months ago indeed it did not work in Android 4.0 due to some JNI issues. But I already fixed those. The VM image is quite old already, so "svn update" the Lazarus source tree that comes with it and try again.

José Mejuto

  • Full Member
  • ***
  • Posts: 136
Re: [SOLVED] LCL Example ICS 4.0.3
« Reply #2 on: June 20, 2012, 01:42:57 pm »
Until something like 1 or 2 months ago indeed it did not work in Android 4.0 due to some JNI issues. But I already fixed those. The VM image is quite old already, so "svn update" the Lazarus source tree that comes with it and try again.

Hello,

After updating the Lazarus to SVN current (on monday), the problem is still the same :(

After a full rebuild of Lazarus and compiling the application, I get the step to that write "ant debug" which will not change the .apk at all :-? if I delete the "LCLExample-debug.apk" the "ant debug" regenerates it but the file inside the apk still have the file date of 29/11/2011 which is not the one that I have in my generated .so :-?

As in the VM there is only one "liblclapp.so" file, from where is the ant taking the .so inside the apk ?

OK, after cleaning the bin/ folder and performing an "ant debug" everything works and it installs and works fine in the device.

The only "problem" is that the demo is quite slow compared with other android apps, but the great advantage is that we can reuse a lot of code taken from desktop versions.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: [SOLVED] LCL Example ICS 4.0.3
« Reply #3 on: June 20, 2012, 02:28:55 pm »
Sometimes ant indeed reuses old pieces so deleting /bin helps sometimes. Lately I develop in Windows where I use a .bat script which calls directly javac, dex, etc, and I haven't had this issue. Most of the time I had issues lately I actually had forgotten to build something, or the Java building failed, or the Pacal build failed, or I was building the Pascal side for the desktop instead of for Android...

liblclapp.so comes from the directory android/lib/arm-eabi/ (or similar), but I think that maybe ant might reuse it from the previously built APK, so idea in which ocasion. Probably they made something to speed up building when you build multiple times without changing much and caused this issues.

About slowness, indeed it could be faster, but it is good enough for my usage. Improving the speed is essentially optimizing the routines in lcl/lazcanvas.pas for the pixel format of Android, but this is a rather boring job. It's in my ToDo, but not with a high priority. Of course that patches are welcome.

Right now I am working on networking support and sqlite support. Also just wrote this new thing: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Using_the_Native_ListView_Dialog
« Last Edit: June 20, 2012, 02:30:27 pm by felipemdc »

José Mejuto

  • Full Member
  • ***
  • Posts: 136
Re: [SOLVED] LCL Example ICS 4.0.3
« Reply #4 on: June 20, 2012, 05:29:59 pm »
Sometimes ant indeed reuses old pieces so deleting /bin helps sometimes. Lately I develop in Windows where I use a .bat script which calls directly javac, dex, etc, and I haven't had this issue. Most of the time I had issues lately I actually had forgotten to build something, or the Java building failed, or the Pacal build failed, or I was building the Pascal side for the desktop instead of for Android...

Your .bat file shows me the route, as you first delete some things in the bin folder.

Quote
liblclapp.so comes from the directory android/lib/arm-eabi/ (or similar), but I think that maybe ant might reuse it from the previously built APK, so idea in which ocasion. Probably they made something to speed up building when you build multiple times without changing much and caused this issues.

A note in the wiki about this fact could be interesting, or maybe writting an .sh like the .bat one.

Quote
About slowness, indeed it could be faster, but it is good enough for my usage. Improving the speed is essentially optimizing the routines in lcl/lazcanvas.pas for the pixel format of Android, but this is a rather boring job. It's in my ToDo, but not with a high priority. Of course that patches are welcome.

I'll take a look over that functions but I'm not fluent with LCL graphics. The current graphics speed would be  a serious pain with any kind of listview (non native).

Quote
Right now I am working on networking support and sqlite support. Also just wrote this new thing: http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Using_the_Native_ListView_Dialog

Networking is really important for sure.

 

TinyPortal © 2005-2018