1

The screens in my app needs to be displayed in the same way on both type of devices, phones and tablets. Currently my app works fine on phones, but they behave weird when run on tablets. The problem occurs with the positioning and size of components in the screen.I have 9 patch images generated for all the images being used but still for some components that I use absolute size/margin values such as 30dp,50dp etc do not seem to be good measures that work well on a tablet. Some of my thoughts/questions are:

  1. PercentRelativeLayout - is it the best solution to overcome this problem?
  2. Is there a way that layouts can be defined so as to draw differently on phones and tablets. Please note that that I do not have any complex menus or behaviour that needs to work differently on different devices, they are same.
  3. Do I have to develop 2 different apps?
Ganga
  • 597
  • 2
  • 9
  • 23
  • [Here](https://developer.android.com/guide/practices/screens_support.html) is an article that's about supporting different screen sizes, if you scroll a bit down there is a part where they explain how you could support multiple screens. One of the possibilities is to create different layout folders for different sizes like layout-large and layout-xlarge. You could use a PercentiveRelativeLayout and that could work (but I'm also not sure if it's the best solution. You probably don't need to create 2 different apps, that seems rather unlikely. – Dennis van Opstal May 19 '16 at 14:48

2 Answers2

1

you have to make different layouts for both android phone and tablet.

Look at this link

Community
  • 1
  • 1
BOUTERBIAT Oualid
  • 1,494
  • 13
  • 15
0

Read more on the Android developer documentation after reading answers above. Found this resource to be more explicit for someone who is totally unaware of supporting multiple screens. http://www.survivingwithandroid.com/2012/07/how-to-support-multiple-screen-in.html

Ganga
  • 597
  • 2
  • 9
  • 23