0

i have used a background image for a layout in a text sending app.The background image is showing properly in the layout view( in IDE ) but when i am running the app on emulator/phone the quality of the image gets degraded.here is the xml code for the layout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" 
android:background="@drawable/black_bg">

<TextView
android:id="@+id/phoneNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Recipient: "
android:textAppearance="?android:attr/textAppearanceLarge"
 android:background="#00000000"
  android:textColor="#B3FFFFFF" />

<EditText
android:id="@+id/editPhoneNum"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="phone" >
</EditText>

<TextView
android:id="@+id/SMSLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Your Text: "
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="#00000000"
  android:textColor="#B3FFFFFF"  />

<EditText
android:id="@+id/editSMS"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:lines="5"
android:gravity="top" />

<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Send" />

</LinearLayout>

any help would be greatly appreciated.

Shankha Jana
  • 79
  • 1
  • 1
  • 6
  • 1
    upload one screen shot how it looks? – M D Apr 15 '14 at 12:46
  • 6
    If the background is only color, then better to use color codes. If not, better to use 9 patch draw-able. – Kameswari Apr 15 '14 at 12:47
  • @Kameswari you are absolutely right. – M D Apr 15 '14 at 12:48
  • If you selected a different device for view in IDE and run on different device then there may be some differences in layout view. – Rohit Apr 15 '14 at 12:57
  • @SimplePlan i will be uploading screenshots very soon.actually i am a new user in stack overflow.I don't have enough reputation points to upload a screenshot – Shankha Jana Apr 16 '14 at 04:23
  • possible duplicate of [Utility of android nine patch](http://stackoverflow.com/questions/22684960/utility-of-android-nine-patch) – D.W. May 22 '14 at 23:26

1 Answers1

3

You should put the various size images into the followings folder

for more detail visit this link

  • ldpi
  • mdpi
  • hdpi
  • xhdpi
  • xxhdpi
Dhwanik Gandhi
  • 685
  • 6
  • 12