Recent

Author Topic: CustomDrawn on Android 5.0  (Read 9100 times)

DelphiFreak

  • Full Member
  • ***
  • Posts: 246
    • Fresh sound.
CustomDrawn on Android 5.0
« on: February 26, 2016, 08:44:03 pm »
Hello,

I just want to ask if you have tried CustomDrawn components on Android 5?

My sample project works on 4.x but not on 5.0.
If I remove all customdrawn components and units, then the app works also on 5.0. ( at least I can see an empty form and it does not close/crash itself :-)

Thanks,

Sam
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

tintinux

  • Sr. Member
  • ****
  • Posts: 299
    • Gestinux
Re: CustomDrawn on Android 5.0
« Reply #1 on: March 14, 2016, 02:20:37 pm »
Hi

Yes I succesfully ran in Android 5.0 a project containing CustomDrawn components : your own TestAndroid program shipped with LazToApk, which contains only CDButtons from this package.

However, this was several months ago. At this time there was a bug in LazToApk and I was unable to make any other project (and I sent you a mail and gave up).

Now the bug is fixed (THANKS !), but like you I can't run anything on Android 5.0  (I have no other version).

So, It is probably not the Android version responsible for the trouble, but it could be the Android API used (I use currently API21) or possibly CustomDrawn components which have been improved ?

I can't say more but hope this helps a little...

Best regards
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

tintinux

  • Sr. Member
  • ****
  • Posts: 299
    • Gestinux
Re: CustomDrawn on Android 5.0
« Reply #2 on: March 14, 2016, 05:53:58 pm »
Question : how did you managed to remove all CD components and uses ?

Starting from you TestAndroid program, I can remove everything but in the .lpr remains :

Code: Pascal  [Select]
  1. uses
  2.  [b] customdrawnint,[/b]
  3.   Interfaces,
  4.   Forms,
  5.   Essaimain;
  6.  
  7. exports
  8.   Java_com_pascal_lclproject_LCLActivity_LCLOnTouch name 'Java_com_pascal_essai_LCLActivity_LCLOnTouch',
  9.   Java_com_pascal_lclproject_LCLActivity_LCLDrawToBitmap name 'Java_com_pascal_essai_LCLActivity_LCLDrawToBitmap',
  10.   Java_com_pascal_lclproject_LCLActivity_LCLOnCreate name 'Java_com_pascal_essai_LCLActivity_LCLOnCreate',
  11.   Java_com_pascal_lclproject_LCLActivity_LCLOnMessageBoxFinished name 'Java_com_pascal_essai_LCLActivity_LCLOnMessageBoxFinished',
  12.   Java_com_pascal_lclproject_LCLActivity_LCLOnKey name 'Java_com_pascal_essai_LCLActivity_LCLOnKey',
  13.   Java_com_pascal_lclproject_LCLActivity_LCLOnTimer name 'Java_com_pascal_essai_LCLActivity_LCLOnTimer',
  14.   Java_com_pascal_lclproject_LCLActivity_LCLOnConfigurationChanged name 'Java_com_pascal_essai_LCLActivity_LCLOnConfigurationChanged',
  15.   Java_com_pascal_lclproject_LCLActivity_LCLOnSensorChanged name 'Java_com_pascal_essai_LCLActivity_LCLOnSensorChanged',
  16.   Java_com_pascal_lclproject_LCLActivity_LCLOnMenuAction name 'Java_com_pascal_essai_LCLActivity_LCLOnMenuAction',
  17.   JNI_OnLoad name 'JNI_OnLoad',
  18.   JNI_OnUnload name 'JNI_OnUnload';
 

I can't remove "use customdrawnint" without removing all exports.
Removing them all or none, I still get the same message on Android 5 : the application stopped.

Could you upload here a minimal project without CD, working on Android 5 ?

Thanks
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

DelphiFreak

  • Full Member
  • ***
  • Posts: 246
    • Fresh sound.
Re: CustomDrawn on Android 5.0
« Reply #3 on: March 16, 2016, 06:35:35 am »
Hi,

here is the sample project without CustomDrawn components which runs on Android 5 Simulator.

https://www.dropbox.com/s/xpurlpihlw7cwj0/running_on_Android_5_simulator_No_Components.7z?dl=0

Sam
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

tintinux

  • Sr. Member
  • ****
  • Posts: 299
    • Gestinux
Re: CustomDrawn on Android 5.0
« Reply #4 on: March 16, 2016, 02:23:10 pm »
Hi

Thanks for the sample.
It is not very different of mine, you have only kept more uses referencing CustomDrawn units...

I can't run the emulator (probably not enough memory) but after I copy and install the project4.apk sucessfully built by LazToApk, on a tablet running Android 5.01, the same thing happens : "program was stopped".

Anyone knows if there is a log or some way to know the reason for this message ?

The only thing I found is that the AndroidManifest.xml contains binary characters, and this is surprising for an xml...

Best regards
Tintinux
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8108
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: CustomDrawn on Android 5.0
« Reply #5 on: March 16, 2016, 03:21:46 pm »
Anyone knows if there is a log or some way to know the reason for this message ?
Use logcat, that's the essential app for android debugging.

DelphiFreak

  • Full Member
  • ***
  • Posts: 246
    • Fresh sound.
Re: CustomDrawn on Android 5.0
« Reply #6 on: March 16, 2016, 10:43:30 pm »
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

tintinux

  • Sr. Member
  • ****
  • Posts: 299
    • Gestinux
Re: CustomDrawn on Android 5.0
« Reply #7 on: March 17, 2016, 08:18:39 am »
Thanks Sam !

Since it is now off CustomDrawn topic, I continue in another thread

Regards

Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

DelphiFreak

  • Full Member
  • ***
  • Posts: 246
    • Fresh sound.
Re: CustomDrawn on Android 5.0
« Reply #8 on: March 23, 2016, 07:59:44 pm »
Maybe I was wrong?

I today created this apk with LazToAPK V0.9.0.35 with API21 (Android 5.0.1) and it works on my Jolla Phone (with Android Layer).
But in the Andorid Simulator on my computer it does not work.

If you have time to install the following apk on your real device (and let me know if it works), I would be very thankful.
https://www.dropbox.com/s/cgmcg2vitnskh22/laztoapk35_API21_SDK_23_0_3.apk?dl=0
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

Handoko

  • Hero Member
  • *****
  • Posts: 3156
  • My goal: build my own game engine using Lazarus
Re: CustomDrawn on Android 5.0
« Reply #9 on: March 24, 2016, 03:57:19 am »
Hello DelphiFreak,

Can you please generate the apk for Intel-based device. I'm using Asus Zenfone 2 Intel 64-bit Android 5.0. If I tried to run the program, it only says:

"Unfortunately, Laztoapk35_API21_SDK_23_0_3 has stopped."

DelphiFreak

  • Full Member
  • ***
  • Posts: 246
    • Fresh sound.
Re: CustomDrawn on Android 5.0
« Reply #10 on: March 24, 2016, 07:10:21 am »
Hello Handoko,

sorry but I have no Intel device. So I have no interest to spend hour's to support this platform.
Maybe if someone donates me a Intel device, my interest would raise about this topic :-)

Sam
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

Handoko

  • Hero Member
  • *****
  • Posts: 3156
  • My goal: build my own game engine using Lazarus
Re: CustomDrawn on Android 5.0
« Reply #11 on: March 24, 2016, 08:43:29 am »
Are you serious?

I'm a hobbyist Lazarus user, wanting to create games that run on mobile devices. A year ago I bought the Intel-based Android phone (my first Android phone), which I was wrong to buy because Lazarus can't generate code that run smoothly on Intel Android devices.  :'( I have made several attempts but still fail because my cross compile skill is very limited.

For boost up Lazarus development on Android Intel area, I wish to donate U$60. It's not much but at least it's enough to buy this device on Newegg:
http://www.newegg.com/Product/Product.aspx?Item=N82E16834872015

DelphiFreak, please accept this offer so everyone who use Intel-based Android can enjoy Lazarus generated apk on their device.