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
Related
I have a project I am working on where the UI I have developed looks great on a 7" tablet, but the moment I try to use the app on a 10" tablet there is a lot of extra space to the right and bottom of my UI elements. Is there a way to scale UI elements to be bigger based on the size of the screen?
I need the UI to look exactly the same on every resolution possible. It should be noted that I am restricted to Eclipse and am programming on an older version of Android because the utilities I have been supplied with are older utilities.
Wish I could supply a screenshot, but I 100% cannot.
You can use different layouts for different screen sizes.
layout-sw600dp ( for 7 inch tablets)
layout-sw720dp ( for 10 inch tablets)
The system will automatically pick the layout per current device size. Just make sure to have the same layout name and id of the components in the layouts or it might cause exceptions if mismatch is found.
If you want completely different layouts for different sizes ( file names still have to be the same ), you can determine which kind of device it is, you can follow the description in the following's accepted answer.
Determine if the device is a smartphone or tablet?
Now using the above method, you can find appropriate views using IDs or whatever way you prefer without causing exception. I personally just change the dimensions of things and keep the ids same.
I have two sizes of 5.1 inches, a 4-inch for 480x800.
When I design in 5.1 screen and run with 4 inch screen, I have some trouble that some button missed position on screen.
I designed by layout.
Android runs on a variety of devices that offer different screen sizes
and densities. For applications, the Android system provides a
consistent development environment across devices and handles most of
the work to adjust each application's user interface to the screen on
which it is displayed.
Please read below Links
Supporting Multiple Screens
How to support multiple screen in Android
How to support different screen size in android
Supporting multiple screen size - Android
Place your view inside a <ScrollView>. Doing so will mean users with smaller devices will be able to scroll the view if it is too large.
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.
I want to develop an application which is universal for tablet as well as for mobile. By creating xmls of different screen sizes i.e. small, normal, large, and extra large, does my purpose will be solved?
I am not sure about this, please guide me to develop that application in every aspect.
Thanks in Advance.
You should take a look at the designing for multiple screen sizes documentation.
Beyond that, you may not need layouts for each and every size. Sometimes, scaling a smaller/bigger layout up or down will suffice.
You will also be need to make sure you don't end up using features like cell phone calling, as most tablets don't support that.
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