How to solve massive rendering problems in Android development - android

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

Related

Why my app crash on some devices and change layout while in other devices even with diffrent sizes it work perfectly

Hi im new to android dev i started from 1 months ago
Well i created simple calculating application
I configured layout so it looks stable and in preview in some screen sizes it was as i expected
When i run the app it workks perfectly ln some devices i tried android 11 5 and 7
But in some other devices android 10,9,8,5 some buttons get bigger... and when i click a button to show an alerte dialog it crasheess
Well in other devices the alerte dialog show and the app works perfectly without any problem please help
well the problem is that you wrote your program for android 11 and that is why it is shown and performs differently in older versions of android if you wish to make it work the same on all devices then you should choose an older SDK version preferably one that is compatible with version 5; But if you do so you might not be able to use some of the new libraries or packages that you used for android 11.
Make sure the version you are applying on other devices is supported. If you are still experiencing crashing, please share the error code with us.

Delphi Android preventing/dealing with multiview mode

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.

Xamarin Android emulator screen gets split into 4 identical rectangles when deploying

I've just gotten into developing apps for smartphones (I'm fairly adept with objective programming already and have some experience with Visual Studio) and decided to try out Xamarin. I've installed Xamarin Studio and Visual Studio 2015 Community with Xamarin without any problems. However, when I actually try to deploy the app (using the Xamarin Android API 15 emulator), a weird bug happens: the screen of the emulator gets split into 4 identical rectangles as you can see in this screenshot. The screen controls still work like they should and are in the default positions (the buttons are not on each of the 4 rectangles and in the normal position for a phone). I can unlock the emulator and launch apps like I would be able to on a correctly working emulator. I have all the prerequisites for Android API 15 installed. The app behaves similarly when I deploy it on the Xamarin Android API 21 emulator (all the prerequisites are installed). I am trying to deploy the blank Visual Studio 2015 Xamarin.Android app without any code changes.
Have you guys ever seen such a bug (or maybe a feature :) ) and do you know how to solve it?
Found the solution if anyone has the same problem: editing the emulator in the AVD to Use Host GPU fixes the issue.

Android Layout resize and multiple emulations

I am going to create an app for devices with Android OS 2.1 and higher. As many developer I met layout problems and after reading about that in the official android documentation I decided to follow a way; I created 6 directory one for every screen density (ldpi,mdpi,hdpi,xhdpi,xxhdpi,xxxhdpi). What I want to know is if I did it right, I know that layout could be not exact at 100% but could I'll meet serious problems doing that?What I should do?
The second problem is checking app in many devices in the same time, I use Android Studio and I am able to create devices and use emulators but there is a plugin or a website or something else I can use to test quickly the app in tens of Android devices without set all manually?
Thanks in advance!

App crashes on Kindle Fire but not on Nexus 5. Both run 4.2.2 and SDK 17. What is the difference?

I working on my first Android app (published on iOS and Windows Phone before). When testing the app on a Nexu 5 eveything works fine but on a Kindle Fire the app crashes:
java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.
This is NOT about the exception itself. I could easily solve the problem by simple using listView.addHeaderView(...) before using listView.setAdapter(...). Not a big deal, but why does the same code runs without any problem on one device but crashes on the other?
I would understand the problem if the devices would use different Android/SDK versions but this is not the case. Both devices run Android 4.2.2 with SDK Level 17...
I would understand the problem if it would be related to something close to the hardware or some vendor specific system calls, but this not the case. It is just about setting up a ListView...
So, what is the difference?
Of course I have only a limited set of test devices. How can I be sure that the app will work on all devices that are running a supported SDK Level?
EDIT:
Of course one device is a phone and the other a tablet. To app uses different layouts for large screens at some places but problem also shows up in Activities/Fragments that have the same layout on both devices. Additionally no separated code for large devices is used. Using the same code and the same layout on both devices leads to a crash on the Kindle but runs on the Nexus...

Categories

Resources