Android apps on phones and tablets - android

I'm developing a project that needs to work on both tabs and smart phones with different screen sizes, but I'm not sure how to achieve that. Should I use different codes for different devices or I need to deal with the drawable folder with h/l/m/xhdpi or there is another way to do that ?

Related

Native App for iOS & Android, Displaying Images

We are developing a new app, on both Android & iOS.
We have different logos we wish to display in different layouts in our app.
I wonder, what's the correct solution for different platforms and different screen,
Resizing on all platforms? let's say i want to create A row with different information, which has image, saved on the server / device,
I wish to display it correctly depends on the screen & device, should i create different images, resize?
Thanks!
It will be better to create different images, because the sizes of devices are different. To make app look and feel awesome i suggest go with different sizes of images depending on devices

Background images in Android: A separate image for each separate device?

I need to develop an Android application and I am a starter to this environment. Actually, we need to port our existing application written for iPhone with Objective-C to Android. We are targeting four devices for now: Samsung S2, S3, Note and Note 2. The application completely consists of custom images in its buttons and backgrounds. As from my experiences in iOS development, we designed 320x480 and 640x960 backgrounds for non-retina and retina devices and the system selected the correct ones provided we give appropriate #2x suffixes. I am trying to understand the Android's way of handling this. I have read the [Supporting Multiple Screens] (http://developer.android.com/guide/practices/screens_support.html) document, but I am still confused on a few things.
As far as understand, there are size and density categories named as small,normal,large and xlarge and ldpi, mdpi, hdpi, xhdpi. We need to generate appropriate bitmap resources and place them under correct "drawable-X-Y" folders. This looks like an advanced version of the #2x notation in iOS. But I don't get exactly how we should prepare background images. For example Note1 and Note2 have resolutions of 449x718dp and 431x767dp respectively if I calculated correctly and therefore they both fall into normal size category. If we prepare a background image for Note1, its screen ratio won't be the same for Note2 and the background image will have to be resized. So, the system does not handle different sized devices which fall under the same size and pixel density category. So, what I do not get is how this system allows us to reuse the same background image for similar devices under the same size-density category. Should we prepare separate background images, say, for Note1 and Note2? If so, what is the meaning of this categorization, am I missing something?
We are targeting four devices for now: Samsung S2, S3, Note and Note 2.
Unless you are controlling the distribution of the app, and can somehow limit it to run on those devices, then at best those are sample devices. If, for example, you are planning on distributing your app via the Play Store, your app will wind up on many others, with a range of screen sizes, densities, and resolutions. While you can perhaps limit the size/density combinations via <compatible-screens> elements in your manifest, there are still going to be a range of resolutions.
So, what I do not get is how this system allows us to reuse the same background image for similar devices under the same size-density category. Should we prepare separate background images, say, for Note1 and Note2?
In the case where you can limit the distribution of your app to those four devices, if you want to use android.os.Build to sniff on the device and choose a different image based upon the device model, you are welcome to do so.
In the case where you are distributing the app to a wider audience, where your app could run on arbitrary devices, you have no practical means of determining, up front, what all possible resolutions might be used. Hence, you have no practical means of creating custom images for each possible resolution. In this case, you will need to rethink the approach of your app, learning from the techniques that millions of other developers of desktop and Web apps have used for dealing with arbitrary resolutions.
It is better to use dp for your control sizes and use 9-patch for Android apps. Android SDK can not handle this kind of detailed categorization. the hdpi/mdpi large/xlarge screen can help to an extent, but your case I think there is no easy way. If you absolutely need to do separate images for each device, then you may consider to do layouts like this:s2_layout_actvity.xml, s3_layout_activity.xml, and in each of them use corresponding images. And detect what device you have before you call the setContentView.

Android-How to develop applications for all phone devices or for majority of phones Concepts and techniques

Android-How to develop applications for all phone devices(Different screen sizes) or for majority of phones
Concepts and techniques
I have created application-according to my phone screen size(samsung galaxy ace) but I created all back ground images sizes appropriate for it..I do not know what will happen It insllaed in any other phone..sure it will distorted..So Please help me to modify my app for compatible with most of the devises.
Many thanks.
you can make a folder under "res" and make folders such as "layout-small", "layout-medium" etc to provide for multiple backgrounds.
http://developer.android.com/guide/practices/screens_support.html

Porting android apps for Samsung Tablet

I want to port my application for samsung tab and i want to know what layout and resource should be keep in my resource file.what will be image size for samsung tab 10",7.1".
Thanks
The best way to do that is to read this article Supporting multiple screen sizes
There you can find the screen sizes and densities for what you are looking for.
Good luck!
i just want to add, never develop an app for a specific brand / screen size / hardware configuration when possible. In the case mentioned it would be simple to define different res/layout-xxx files to offer compatibility with a wide range of devices while mantaining simplicity

screen resoultion when moving up to tablets

I have developed a business app that runs fine on android phone. What do i need to do the screen designs (xml files) so it will scale up for example 10" tablets? but still be okay on the phone?
thanks
You've asked a general questions so the best I can do is give you a general answer. You should read the android documentation on Supporting Multiple Screens.

Categories

Resources