Native App for iOS & Android, Displaying Images - android

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

Related

Responsive design in Android app

I'm developing an Android app. This app have to be available on all Android devices. But how can I do responsive design? For example I want to set a background image, but the image will resize to the different resolutions and it's a mess.
Searching on Google I found this solution:
Configuration config = getResources().getConfiguration();
if(config.smallestScreenWidthDp >= 600){
setContentView(R.layout.activity_main_tablet);
}else{
setContentView(R.layout.activity_main);
}
It's this really the only way to develop an Android app for all devices? I have to create an activity and different images for every device? There are more than ten different resolutions.
Thanks
If you want to obtain responsive layout result on each device, the good way is to use RelativeLayout and according to child views like button you should use "match_patent" or in older SDK versions "film_patent" attribute.
Link here:
http://developer.android.com/guide/topics/ui/layout/relative.html
What about images?
Android developer instructions say that there are four drawable resources folders (mdpi, hdpi, xhdpi and xxhdpi) and there you should put earlier prepared images with suitable size and density.
Link here:
http://developer.android.com/guide/practices/screens_support.html
I applied one another way. In my app there are relative layouts with match_parent attribute for each child view like button.
Referring to images we prepared images in HD resolutions with 240dpi and app looks nice on each device (Samsung trend lite, Nexus 5).
So to be honest if you're planning to develop your APP for handhelds the best way is to prepare two images (HD and full HD), but that is only my advice;)

Android apps on phones and tablets

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 ?

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.

Universal Android application for tablet and mobile

I want to develop an application which is universal for tablet as well as for mobile. By creating xmls of different screen sizes i.e. small, normal, large, and extra large, does my purpose will be solved?
I am not sure about this, please guide me to develop that application in every aspect.
Thanks in Advance.
You should take a look at the designing for multiple screen sizes documentation.
Beyond that, you may not need layouts for each and every size. Sometimes, scaling a smaller/bigger layout up or down will suffice.
You will also be need to make sure you don't end up using features like cell phone calling, as most tablets don't support that.

Android images confusion?

I have say 30 images in my android app. And as per android's documents I should have images for all screen resolution i.e. I should have drawable, drawable-mdpi, drawble-hdpi etc.
Does this mean that I will end up having and asking the user to download 30*4=120 images, or does the android platform check before uploading and only uploads the images supported for that particular phone?
Is there any nice and easy way to handle these images?
Currently you need to include all those images, if you want your app to have nice UI on all screen sizes and resolutions. You can also choose to target your app only on specific screens, and declare that in the manifest. Users with screens that don't match your requirements will not see your app on the market then. However, this is probably not what you want.
As for the future, google knows about this problem and announced that it will support creating separate .apk for different kinds of devices, so in the future, this will be the way to go for apps with big sizes. Search google for "multiple apk support" for more info.
Those are for the on device images (app icons, menu item icons, splash screen image).
It sounds like you are having your users download some additional images themselves, so why don't you download only the images needed for their specific screen resolution. That way, you can even have better control over the quality of the images, as you can go by actual screen resolution rather than by hdpi, mdpi, or ldpi.
You could dynamically get android to create images for their device from a master image.
I don't think there's an alternative, there's no way to supply a different app to a user based on their device specs, other than API version.

Categories

Resources