Test a Gingerbread layout on Ice Cream Sandwich - android

I'm creating an application which works on Froyo until Jelly Beans. I have two layouts on for ICS and above and one for Gingerbread and Froyo.
I test my application on a device which it is on ICS so I see the ICS layout but I would like to test my other layout.
How I can do that ? I think I have to add an option in style.xml or androidManifest but I' not sure.
Thanks.

If you want to test your gingerbread layout but only have an ICS device, you can simply rename your layout folders so it will pick the gingerbread layouts on ICS. Switch the names of the layout-v10 and layout-v15 folders and it will load your v10 layout on your v15 device.
Also, you could use an emulator (running 2.3.3) to test your gingerbread layout. This would allow you to make several emulators with different screen sizes and see how your app would look on different devices. You can also test other things with this like SD-card status, hardware keyboards vs soft keyboards, etc. to ensure your app works with different hardware configurations.

Related

Galaxy S9 not using proper drawable resources

I am working on development of a dark mode for an application in android studio. This application uses a custom background element for the EditText which I have called custom_edit_text. To be assured of backwards compatibility I have created a "layout" and a "layout-v29" folder for the dark mode changes, and similarly I have created a "drawable" and "drawable-v29" for the custom_edit_text.
This has worked for devices around the office and on the emulator, however a fellow employees galaxy s9 will not display the new drawable and instead defaults to using the "drawable" version of the custom_edit_text instead of the -v29.
What needs to be done so that the appropriate drawable ends up in the layout based upon the api version of the phone in question?
project resources
activity main v29
It is quite likely that the S9 does not support api level 29 as that equals to Android 10 which is quite new.
You would need to have a drawable-v26 to ensure the Galaxy S9 woulds work as they shipped with Android 8 I believe.

different appearance on different phones for Android

We are getting ready to release an app, there is a slight difference in appearance on my development phones a Moto X and Galaxy Nexus, and my clients phones. He has a HTC One S with Android 4.4.4. Are there any websites or tools that I can test the appearance on for different phones? He lives in Brazil and me in Florida, so using his is out.
You should use the Android Virtual Device for this. You can use whatever version of android you would like, there are tons of predefined device sizes/resolutions or if none of those suit your needs you could always define your own.
Are you using Eclipse/ADT as your IDE? If so, the layout editor provides different views for a handful of different devices.
I am having trouble attaching a screen shot, so I will just explain. In the layout editor, you will see drop-down selectors for (a) Device/Screen Type, (b) Orientation, (c) Application Theme, (d) Android API level. This provide reasonable previews of you layouts.

Android: different layout in differnet devices

I created an Android application. I tried this on differnet device and I have different layout in any Activity of my app. My Project Build Target is 2.3.3.
The two devices I used are:
Samsung Galaxy S2 - Android 2.3.6
HTC Desire - Android 2.3.5
For example the main Activity produces this layout in my Samsung:
and this in my HTC:
Why the two layout are so different?
This is because before Google introduced holo in Ice Cream Sandwich, manufacturers had a free hand in deciding how their devices' version of Android would look. Because of this, they could theme it to whatever they want.
I'm pretty sure that your app hasn't defined its own theme, and this is why you're getting such radically different looks on different devices.
To fix it, simply create your own theme and apply it to your activities.
This document can help you with styling your app.
You can use ActionBarSherlock with the Holo theme and Action Bar on older android versions (under 3.0).

Will coding done in android 2.2 work in 4.1 Jellybean Phones?

I have wrote an application using android 2.2 in eclipse.
My app is working fine on the samsung galaxy mini android 2.2. However, it is not working on samsung galaxy s3 android 4.1.
My app is only taking up half of the screen on the samsung galaxy s3.
Why is my app not working on higher resolution devices?
How can i make the app compatible with other devices running
different versions of android?
Sounds like it's most likely you just have a LinearLayout at the top of your layout XML and it just takes up less space on the S3.
I would advise taking a look at the two links below; if you want a specific starting point, you could adjust your layout to match_parent and use the l/m/h/xhdpi folders to place different size graphics in. Also worth checking whether you are using dp or dip (density independent pixels)
http://developer.android.com/training/multiscreen/index.html
http://android-developers.blogspot.co.uk/2012/11/designing-for-tablets-were-here-to-help.html
The best way to ensure that your app will work on other devices is to get access to other devices and test your application on those devices before you release.
Another way is to make sure that you are targeting the correct SDK you need to target and use the AndroidSupportLibrary when needing to have backwards compatibility.
For us to help with your specific problem we would need more details as to what exactly is going on, but make sure the packages and libraries you are using are compatible with the android versions you are trying to target.
And make good use of the AndroidSupportLibrary.
Did you check the resolution compatibility? This seems more like an Android Manifest issue then an Android version issue.

Orientation change: reloading layouts from resources

I want to adapt my app for tablets with large and xlarge screens (Android 3.0+ or API level 11+). Therefore, I created two folders: res/layout-large-port-v11 and res/layout-large-land-v11. When I first rotate my tablet and then launch the app, everything works well, but when I rotate the tablet while my app is working, Android stretches and rotates old layout, but doesn't load the proper one (proper for new orientation). What's wrong?
My tablet is Acer Iconia A500 (Honeycomb 3.2, API level 13)
You can see AndroidManifest.xml and all code in the app's repo on github. DashboardActivity contains all logic for tablets.
P.S.: Everithing still works pretty well on my Android 2.2 phone with normal screen. Maybe something wrong with qualifiers? Maybe I should also create -v12, -v13 -v14 and -xlarge duplicates of the two folders?
Have you tried removing orientation from configChanges? With this declaration, you are overriding the default behaviour of Android when changing orientation - this may (or may not) lead to problems like the one you described.

Categories

Resources