-1

i'm creating a app in Android using eclipse, but i don't have idea with create layouts for more of one resolution of screen. My app is in Absolute Layout in a screen landscape of 1024x600, but if i execute this app in other resolution, the layout is crashed, all buttons and others components is out of the position. The device who i use is a tablet with 7". I need to adapt the app for tablets of 10" and others... i tried relative layout but i don't know how to use this layout to organize the components. somebody can help me to try find a answer.

FelipeRsN
  • 887
  • 1
  • 9
  • 19
  • You will want to read through the Android documentation on supporting multiple screens, http://developer.android.com/guide/practices/screens_support.html. Also, AbsoluteLayout has been deprecated since API 3 and is not suggested for use. – TronicZomB Jun 13 '14 at 13:36
  • you recommend relativelayout? – FelipeRsN Jun 13 '14 at 13:40
  • Personally, yes. I prefer RelativeLayout and use LinearLayout only when necessary. It is just a matter of what works best and makes the most sense in your situation. Are items all over the screen or are they sequentially horizontal/vertical? – TronicZomB Jun 13 '14 at 13:43
  • all over the screen, is a restaurant menu, is the reason for i use absolutelayout, more easily to align the components where i need – FelipeRsN Jun 13 '14 at 13:50
  • I would use RelativeLayout so that it will dynamically position and size the items based on the screen size. – TronicZomB Jun 13 '14 at 14:40
  • In the absolutelayout i can set the componente exactly where i need, using android:layout in pixel, how to use relative layout to set location? – FelipeRsN Jun 13 '14 at 14:44
  • The first item of a RelativeLayout is positioned to the upper left corner of the screen. From there you state new items' positions based on position to that first item, or other items as they are added to the layout. Check the documentation, http://developer.android.com/guide/topics/ui/layout/relative.html & http://developer.android.com/reference/android/widget/RelativeLayout.html – TronicZomB Jun 13 '14 at 14:50

2 Answers2

0

http://developer.android.com/guide/practices/tablets-and-handsets.html Its helps you. you have make a separate design for mobile and tablet, also the drawable images.

Ramki Anba
  • 754
  • 1
  • 10
  • 21
0

Read android devices support multiple screen doc http://developer.android.com/guide/practices/screens_support.html and also read supporting different screen sizes doc http://developer.android.com/training/multiscreen/screensizes.html.

See below link for more info about phone supporting device:-

how to know which phone support which layout(hdpi , mdpi and xhpi)?

Community
  • 1
  • 1
duggu
  • 37,851
  • 12
  • 116
  • 113