简体   繁体   中英

Android 6 Marshmallow with Delphi XE8

Is it possible to create an app for Android 6 using Delphi XE8 instead of Delphi 10?

Now apps seem to crash on Android 6, but Delphi 10 apps seem to crash on older android versions.

I have multiple Android SDK installed from 19(Android 4.4) till 23(6.0) I also have the newest android NDK(r10e) and the newest Java JDK.

The crashes seem to be very random. Can't yet say why it crashes exactly. I'll try to find out more!

Update:

It seems to be a device specific problem. If I run Delphi 10 app on emulators with android 4.2/6.0 the app doesn't crash. Also on my samsung galaxy tab with android 4.2 it doesn't crash. Only my sony xperia with android 5.1 crashes.

Update: My app seems to crash becore I call TCloseAction.caFree in the FormClose event of my 2th form

I found out what the problem was for older android versions with my Delphi 10 version of the project.

Through commenting out code I found out that the TCloseAction.caFree crashes the app in the formclose event. I can't remove this otherwise the form memory doesn't get freed. I tried multiple methods but only this totaly frees all the memory of a form in a Firemonkey multi device project.

After finding this out I found that it crashes when I add a TVertScrollBox to a TTabItem. On my Form I have multiple tabs. And on one of them I have a Listbox that I fill runtime with items and below that a memo. In order to use this memo correctly I added a TVertScrollBox so when the keyboard is shown the keyboard doesn't hide the memo. When I added the VertScrollBox in the designer my listbox doesn't draw the items correctly, so that's why I add it runtime. But this causes the crash on older android versions. Apparently it doesn't like to get freed in the onClose event for some reason.

So for the final solution i'm left with putting the memo in the top of the TTabItem so it never gets hidden behind the keyboard and removing the TVertscrollbox from designer/runtime. Now my ListBoxItems get drawn correctly and my app doesn't crash on older android versions anymore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM