简体   繁体   中英

What Image size I should keep in Android for Splash Screen?

I have developed application in Android and designed one splash screen image of size 320x480. I wish to run this app in mobiles only. But when i run my app in emulator the image is stretched and its not looking good. I have gone through the document of developer but it didn't help me enough. So basically i wish to know that what size should i define that the splash screen looks as it is designed and the image should not stretched.

My XML file...

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:layout_gravity="center"
   android:background="@drawable/screenbackground"
   android:gravity="bottom"
   android:orientation="vertical" >

   <ProgressBar
       android:id="@+id/progressBar1"
       style="?android:attr/progressBarStyleLarge"
       android:layout_width="20dp"
       android:layout_height="20dp"
       android:layout_centerHorizontal="true"
       android:layout_marginTop="10dp" >
   </ProgressBar>

   <TextView
       android:id="@+id/textView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_below="@+id/progressBar1"
       android:layout_centerHorizontal="true"
       android:layout_marginTop="8dp"
       android:text="@string/loaddata"
       android:textAppearance="?android:attr/textAppearanceMedium"
       android:textColor="#ffffff" >
   </TextView>
</RelativeLayout>

Please kindly give me suggestion or any link or resources.

Thanks

Android

Format

9-Patch PNG (recommended)

Dimensions

LDPI:
Portrait: 200x320px
Landscape: 320x200px
MDPI:
Portrait: 320x480px
Landscape: 480x320px
HDPI:
Portrait: 480x800px
Landscape: 800x480px
XHDPI:
Portrait: 720px1280px
Landscape: 1280x720px

I know this is an old post, but felt it still needs a bit of touch up to the answers if others do stumble on to this post. The following post has the exact details one would require for deciding upon resolution of images in their Splash Screen for different screen sizes :

android splash screen sizes for ldpi,mdpi, hdpi, xhdpi displays ? - eg : 1024X768 pixels for ldpi

For lazier developers like myself :P, I will provide the values below for minimum screen sizes (all in pixels), which are provided by Google ( the statistics on the relative sizes of devices on Google's dashboard ).


Android Mobile Devices :

LDPI- 426x320

MDPI- 470x320

HDPI- 640x480

XHDPI- 960x720


Android Tablet Devices :

LDPI- 200x320

MDPI- 320x480

HDPI- 480x800

XHDPI- 720px1280px


And of course, 9 Patch images are always recommended for stretchable images.

it requires different image sizes for different screens

for default emulator requires 480*800 size of image

check this link android-splash-screens

Try setting the size of the view in your XML layout or do it programmatic in the Java file. You should be able to size it the way you want. You may also want to make sure the image itself does not have a lot of "blank space" surrounding it.

You should support splash screen images within difference sizes and save to corresponding resource folder. For example, the following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for medium, high, and extra high density screens.

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
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/my_icon.png        // bitmap for medium density
res/drawable-hdpi/my_icon.png        // bitmap for high density
res/drawable-xhdpi/my_icon.png       // bitmap for extra high density

Please read this tutorial for details

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM