Android application layout for android phones and tablets?

You'll need to use the Android Compatibility Package (developer.android.com/sdk/compatibility-...) in order to do this.

Up vote 0 down vote favorite share g+ share fb share tw.

I am writing an application that needs to be supported on both android phones and tablets. I want to create a tablet-friendly UI for this application. As such, I want the app to be user-friendly both on small and large screens.

As specified here: Supporting Multiple Screens, I can create different layout files for different screen resolutions, as well as different drawables for different densities, which is very good. On top of that, I'd like to use the features of android 3+, like fragments, which are ideal for large screens. A layout which fits a small screen nicely will, in many cases, look poorly on tablets, so fragments would come in handy.

However, if I use fragments and target my app for Android 2.2, it won't compile. So what are the options for this? Should I create a completely different Tablet version of the app?

Is there another better way? Android size screen phone tablet link|improve this question asked Feb 15 at 19:54Gabriel21710 71% accept rate.

You'll need to use the Android Compatibility Package (developer.android.com/sdk/compatibility-...) in order to do this. It will backport the fragment features back to 1.6 or something.

Thanks for your help and for the link provided. It is indeed the best way. Too bad I didn't know of it until now.

Now I can add support for tablets to my app and not worry about the platform – Gabriel Feb 15 at 20:10.

You can use the support library and compile for both 3.0+ and 2.3. If in the xml you use features that are not supported by the support library you need to store them in a folder with name like xml-13. You need to set the target platform as 13 and the min as 10 for example. If when yu debug on 2.3 you see a red cross don't worry run the application anyway it will work Have a look to: similar question.

You can get the Fragment API working across the whole Android platform using the Android Compatibility Library. If you're using Eclipse as your IDE, just Right Click your project and select : Android Tools -> Add Compatibility Library ... So to answer you question: The best way to make an application Tablet and Phone friendly is to use Fragment in order to design your UI. Hope this helps!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions