Delphi Android preventing/dealing with multiview mode - android

today I tested some app I'm developing with Berlin Upd. 2 on a Sony Z4 tablet with Android 7.
If I press the right Android navigation button a bit longer the device splits the screen 2 two areas and thus shows two apps simultaneously. Seems to be a feature of Android 7+.
Unfortunately my app doesn't like this and is being terminated or terminates itself.
I didn't find any setting on this Sony device to disable the split screen button function.
I found some Android Manifest setting here:
How can I disable multiwindow mode for an Activity in Android N+
But every time I try to add this to the manifest template either for the entire app or for the activity (FMX apps only have one activity) and press F9 to test it on a device (in this case a Nexus 4 to ensure the setting doesn't
have negative effects on older versions) I get a "pa client exited with code 1" failure. When I remove the line from
the manifest template and press F9 everything works as it did before.
Any hints/advice?
I already searched for an app to disable the feature on the Z4, but we only found one for Galaxy S7 which had no effect on the Z4.

The solution is (and the Android documentation doesn't clearly state this requirement for somebody not using Google's preferred language/toolset) to download SDK 24 and Build Tools 24.x in SDK manager. In Delphi Tools/SDK one needs to point to the android-24 folder instead of the android-22 one and then adding this attribute to the node no longer leads to build problems in Delphi and the app cannot be crashed by somebody trying to enter split screen mode.

Related

Trying to reset NativeScript Preview

I'm trying to reset NativeScript Preview but after press and holding lunch icon, android system just let me move icon instead open menu. So, doing with original instruction: "Resetting the Preview app" from: https://preview.nativescript.org/#faq . Any hint?
I figured out that the problem is related to version of my Android - v.6.
This feature working in Android v.11.(I meant the press and hold app icon to open it's menu)
My old Galaxy S5 is unable to upgrade to higher version. So, I consider change to LineageOS which is quite time consuming and a bit risky process or buying new mobile with newer version o android system.
Still question is on which version started with this option.

How to solve massive rendering problems in Android development

I'm currently working with Xamarin for developing an android app. The structure of the app is really simple yet but a big problem appeared concerning the rendering of my main page. First, it's important to know that I'm supposed to develop for target API 23 so Android 6.0.
And every time I test my application on my Android 6.0 device via USB-debugging the design is totally messed up with my only (!) button duplicated many times and the textViews mixed up over the screen (As shown in the picture link below).
Even though I am new to Xamarin and Android (and C#) I have my settings (as I think) in perfect order. The minimum API level is 21, the target SDK version 23 (Android 6.0), my device runs version 6.0.1, the target compiling framework in properties is set to 6.0, the manifest is set up as I mentioned before and even my "Designer" window with the layouts .axml is set to v23.
I really don't know what to try next, because I want to start coding further. Would be nice if sb could help me out with that.
I have already tested the code of the app on a different API level (26 I think) and it worked perfectly fine with my Galaxy S9 in Debugger mode. Everything looked like it was designed in first place.
I also tried different AppThemes in Visual Studio but not one of the 7-8 I tried worked in any way different except for the colors.
The android app does only switch when clicking the button, texthttps://imgur.com/i0xChVniew 2 into the current date and time. I'm really sure, that my code is not the problem.
Picture: How it should look (In Xamarin)
Picture: How it looks on the phone

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.

How to test screen rotation in Android Emulator? [duplicate]

This question already has answers here:
Android emulator - Screen rotation
(5 answers)
Closed 8 years ago.
If I open a browser in emulator and press Ctrl+F11 or F9 or Ctrl+F11, the screen rotates but browser doesn't.
To test I downloaded a native app and installed it on my emulator and phone both. The app catches the rotation of phone but on emulator similar thing happened.
I googled it and read few posts on Stackoverflow, I found that its a bug in Emulator of particular version.
But which version of emulator runs it fine?
I simply downloaded the adt-bundle-windows-x86_64-20140702 and I have eclipse(juno) with it. Eclipse has Andoird SDK Manager inside it, which helped me to chose the latest APIs, SDK tools etc. I downloaded those, what did I miss that doesn't support rotation.
I also read that if I if uncheck Hardware keyboard Present then it would work but it didn't.
I also tried by uncheck Host GPU, no luck.
Finally I was told that need to specify in AndroidManifest.xml that I want to support both landscapeand portrait both. But I have not created any android project in eclipse I simply created a device and now checking its rotation with its own browser and by installing a apk file from internet.
Are there any concrete steps/tested way that work out screen rotation on android emulator?
But which version of emulator runs it fine?
4.3 (API Level 18) and below.
Are there any concrete steps/tested way that work out screen rotation on android emulator?
Download an emulator image for Android 4.3 (API Level 18) or below, create an emulator from it, and use that. You will find emulator images in your SDK Manager:
In the above screenshot, you will see API Level 17 and 18 emulator images towards the bottom of the picture.
Your problem can be solved by changing one setting as given below:
Open Menu
Goto Settings
Goto Accessibility
Check the check box for "Auto-rotate screen".
This may solve your issue.

Delphi XE5 Android app running slow on Google Nexus 10

We are evaluating Delphi XE5 specifically to see how easy it is to develop mobile apps. We have developed a simple Android app that scrolls through a TClientDataset using a DBNavigator. The application comprises a few input fields, labels and slider controls (TSwitch).
Everything works ok and sliders (animations) are responsive, except on a Google Nexus 10 (Android 4.3) where everything happens in slow motion. It is like the app is still running in emulator mode. (A sliding button takes over 2 seconds to move from left to right!)
We have successfully tested the app on a Samsung Galaxy S3 (Android 4.1.2) and a HTC One (4.2.2) and the UI is as responsive as one would expect.
Update.
We asked the question at Code Rage 8 and they are referring it to the R&D Department. Will update when or if we get an answer.
I see mention of the screen resolution in comments. Has it actually been determined that it is the screen resolution that is the issue here?
Can you go into the developer options on the Nexus and try anything there that forces GPU usage or whatever might potentially help things along graphics-wise?
And is there anything clue-like in logcat? Run monitor.bat in the Android SDK tools directory or, if the path to it has spaces in, then that won't work so run ddms.bat instead from the same location (DDMS doesn't abort due to spaces in the path).
It would be good to get more evidence on the problem, rather than (educated) guesswork.
If it turns out to be screen size, well that will be interesting for Embo.

Categories

Resources