-4

I am making an app, and it is the same size on every screen. How do I make it stretch to different screen sizes?

Thank You.

Mati P
  • 41
  • 1
  • 3
  • Please post enough code that represents a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) of the problem. Also consider taking some screenshots showing the effect that you are seeing, and linking to those screenshots from your question. – CommonsWare Jul 16 '15 at 16:33
  • 1
    please read the documentation http://developer.android.com/training/basics/supporting-devices/screens.html and http://developer.android.com/training/basics/fragments/fragment-ui.html and http://developer.android.com/training/multiscreen/index.html – tyczj Jul 16 '15 at 16:35

1 Answers1

3

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. At the same time, the system provides APIs that allow you to control your application's UI for specific screen sizes and densities, in order to optimize your UI design for different screen configurations. For example, you might want a UI for tablets that's different from the UI for handsets.

http://developer.android.com/guide/practices/screens_support.html

res/layout/my_layout.xml              // layout for normal screen size ("default")
res/layout-large/my_layout.xml        // layout for large screen size
res/layout-xlarge/my_layout.xml       // layout for extra-large screen size
res/layout-xlarge-land/my_layout.xml  // layout for extra-large in landscape orientation

res/drawable-mdpi/graphic.png         // bitmap for medium-density
res/drawable-hdpi/graphic.png         // bitmap for high-density
res/drawable-xhdpi/graphic.png        // bitmap for extra-high-density
res/drawable-xxhdpi/graphic.png       // bitmap for extra-extra-high-density

res/mipmap-mdpi/my_icon.png         // launcher icon for medium-density
res/mipmap-hdpi/my_icon.png         // launcher icon for high-density
res/mipmap-xhdpi/my_icon.png        // launcher icon for extra-high-density
res/mipmap-xxhdpi/my_icon.png       // launcher icon for extra-extra-high-density
res/mipmap-xxxhdpi/my_icon.png      // launcher icon for extra-extra-extra-high-density

http://www.survivingwithandroid.com/2012/07/how-to-support-multiple-screen-in.html

Please go through the following links. These might help you:

Supporting Different Screen Sizes

Supporting Multiple Screens

Supporting Different Densities

Supporting Tablets and Handsets

Sources: How to set android layout to support all screen sizes?

Community
  • 1
  • 1
Horrorgoogle
  • 7,858
  • 11
  • 48
  • 81