2

Please help me with a couple general questions about drawables.

1) If I have a general wallpaper app (not live wallpaper), do I need to include the images in all three drawable folders? Even if I do not change the image?

2) What command can I use to not allow tablets to use the app? I do not have a layout yet for tablets. But I do want 4.0 users with handsets to use the app.

Thanks!

Waynn Lue
  • 11,344
  • 8
  • 51
  • 76
Stephen McClendon
  • 347
  • 1
  • 8
  • 23

2 Answers2

1

As far as question 1, mdpi is the default. You don't need to put images in the other folders. they are used when you want to use different resolutions images.

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

And for the second question, you can use the command

http://developer.android.com/guide/topics/manifest/supports-screens-element.html

Bill Gary
  • 2,987
  • 2
  • 15
  • 19
0

I think you might want to use something like this to find out whether your application is running on a phone or not. The code is meant to detect whether it's running on an emulator but I think it should work for tablets as well.

TelephonyManager telmgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
boolean isEmulator = "000000000000000".equals(telmgr.getDeviceId()); 

As far as the first question is concerned I usually just put my images in the res/drawable folder and access them via

Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pic1);

Or you might want to have a look at what has been written here if you would like to add multi screen support.

Community
  • 1
  • 1
beta
  • 2,583
  • 15
  • 34
  • 46