I am quite new to Android Development. I am developing an application that should run on Android-based phones as well as on Android-based Tablets. My Question is that how to support multiple screens. I have developed a simple list-view application that I am testing on my Galaxy Tab but it is appearing quite smaller on the screen and not coming as a full-screen. I have tried making changes in the manifest file and declared minSdkVersion as 7.. Any advices or examples would be appreciated????
The Supporting Multiple Screens section of the SDK docs should help you out. Have you looked at it?
Pay special attention to the Best Practices section and remember to use wrap_content, fill_parent, or the dp unit for layout dimensions in your views.
Related
i need that my app Android will be supported by 2 devices phone and tablet .
i can find library to integer in my app and supported all screen size.
Thanks
I am assuming you want to support multiple screen sizes for your app. You can refer to this guide from Android Developers. Tl;dr you should make your layouts as flexible as possible. That includes but not limited to
Use ConstraintLayout to define the percentage of screen covered by a component, ratio of sizes etc etc
Avoid using hardcoded values(like layout_width="100dp" etc)
Also for a tablet, you must design an alternative layout which can take advantage of the larger screen in landscape mode
I need to redesign an app from IOS to Android (only the GUI, no coding), but it has to be compatible (from the design point of view) with ICS, JB and KitKat versions.
I only designed apps for IOS not for android so, the problem is - I don't know what resolutions should I use (screen sizes in px and density - dpi). I understood that I have to do different sizes and I found this on google and this, but I still don't know where to begin from. Can anyone please tell me what sizes should I take in mind when designing the UI for the app? (like 480x800px at 320dpi, and so on).
you can try having a look at below page by android:
Supporting Multiple Screens
For total understanding of UI design in android you can have a look over here
Supporting Different Screen Sizes
Android have no standard screen size predefined but things getting better in Andoid 3.2+ by new qulalifiers like sw (screens wider than ...). Before that you could only use size-buckets like large, normal, small which was not suitable for all ranges of android devices (in order to have a big picture, there are around 4000+ differnet android devices out there!).
you can have a look over official android blog for comprehensive details about this.
Right now I have an application I built that is built for android 10.1 inch screens (tablet) and I would like to to be able to be scaled so that it work on the kindle fire (7 inch screen). What would the easiest way to do this be?
Edit:
So I've taken the advise that the majority of the people in this tread have given and replaced all of the absolute layouts with relative layouts and I am using margins left,right,top,bottom, to place them, but still the button images are too large and they are misplaced, how can i do this so it works correctly?
There are some design criterias for developing android applications to make them work in different configurations like screen size:
use different layouts for different configurations
use fill_parent and wrap content properties in layouts
do not give hard coded pixel values
do not use absolute layout
provide different drawables for different configurations
for more look here: http://developer.android.com/guide/practices/screens_support.html
Following the best practices guidelines is always good but sometimes you simple need a whole new layout for different screen sizes. Android allows you to create different layouts files for different screen sizes. To do this you can create a new folder under 'res' called 'layout-large' or 'layout-large-land' for landscape. The same is also true for 'layout-xlarge' and 'layout-xlarge-land'. You can just add another xml layout file in these directories with the same names and same ids and android will automatically pick the right one based on the users screen.
http://developer.android.com/guide/practices/screens_support.html
Honestly, it depends on your application. If you built it so that it would work with tablets and you didn't specify non-percentages for your widths and heights, it will probably automatically scale to the proper size on the Kindle Fire.
Honestly, get a test device (or emulate the size using the Android Emulator) and see what happens. Very likely, if you followed proper design patterns, the app will Just Work (TM) on the Kindle Fire.
If it doesn't, you might want to take a look at how you're specifying the sizes of your elements. Using Pixels or any other type of pixel-based numeric measurement will do some strange things to your UI. Instead of widths and heights, use paddings and margins defined with density independent pixels. This will help your app scale properly.
I recently wrote an app testing it only on mobile phones, and was pleasantly surprised when I purchased a tablet, and the app scaled up perfectly - with no warning from Android about different ways to scale it.
Realy easy, but not recommend because it can pixialize images, is Enabling Screen Compatibility Mode.
Try adding this:
<supports-screens android:compatibleWidthLimitDp="320" />
OR this:
<supports-screens android:largestWidthLimitDp="320" />
to your AndroidManifest.xml.
To understand whats happening check here:
http://developer.android.com/guide/practices/screen-compat-mode.html#Enable
I have developed a business app that runs fine on android phone. What do i need to do the screen designs (xml files) so it will scale up for example 10" tablets? but still be okay on the phone?
thanks
You've asked a general questions so the best I can do is give you a general answer. You should read the android documentation on Supporting Multiple Screens.
I'm developing an Android app that absolutely needs to support Android 2.1+ devices, including tablets and phones.
The tricky part is I want to be able to provide roughly the same user experience on Android 2.x tablets as on bone fide Honeycomb tablets. I'm planning on using the Compatibility package so that Fragment support is always available, but...
The problem I've got at the moment is I've bought a Hannstab for testing, and discovered that it reports to apps that it has a "large" screen, despite actually being 10.1 inches. This would technically make it "xlarge", but of course that category was not included in Android 2.2 (which it runs), hence it's "large". I originally intended to just use resource qualifiers and treat all xlarge devices as tablets, and everything else as phones but now I realise I can't do that.
Would it be so bad to treat all xlarge and large screened devices as tablets? This would include Dell Streaks and other 5 to 7 inch screen devices as I understand it.
Is there a better alternative? I haven't really got my head around fragments properly yet so a fragments-based solution might be obvious to someone who has.
I've noticed that typically, apps I install on my Hannspad use their normal phone UI, with the exception of Evernote which uses a specific tablet interface - I wish I knew how they'd done that.
The new "Smallest Width" resource qualifier introduced in Android 3.2 would solve this problem by doing away with the generalised screen size buckets altogether. Presumably I could copy this approach by writing code to work out the screen width in dp and then adding fragments to the activity as appropriate. Is that wise? I'd rather avoid that kind of work if it's going to be a pain.
Cheers
Would it be so bad to treat all xlarge and large screened devices as tablets?
If your question really is "is it OK to use the same layouts, etc. for -large and -xlarge devices", that certainly can work. It's certainly where I would start.
Bear in mind that device manufacturers really are the ones who determine what is -large or not. It would not surprise me to find some manufacturers creating 5" devices to categorize them as -normal, because they feel that -normal apps tend to work better on their devices than do -large apps.
I've noticed that typically, apps I install on my Hannspad use their normal phone UI, with the exception of Evernote which uses a specific tablet interface - I wish I knew how they'd done that.
Probably using -large/-xlarge resources. I don't know if they are using fragments or not.
In terms of screen sizes, fragments really are for cases where the -large/-xlarge UIs are basically a bunch of -small/-normal sized UIs snapped together like LEGO(R) blocks. In Evernote's case, their -large/-xlarge UI does not fit that pattern, so they may or may not have used fragments.
Fragments offer some other advantages for memory management and configuration changes (e.g., screen rotation), so you might consider using fragments even if you are not sharing fragments between major groups of screen sizes.
Is that wise?
If possible, I would hold off on making that decision until Ice Cream Sandwich ships and we start seeing how some of this stuff will play out on smaller-screen devices.