1) A better reason why all your strings are stored in a resource called Strings.xml. It's easier to support multiple languages!
All you have to do is create a separate folder for the language you want to use, and define a strings.xml in it.
Eg. values-fr folder, would mean for France.
So inside it define your strings such as "hello world" as "Bonjour". Android willl automatically pick the right language depending on the language you use on your phone.
2)To create different layouts create different folders such as
layouts
layouts-land (For landscape)
layouts-large (For large devices)
layouts-large-land(For large devices and landscape)
3) For pixel densities you have xhdpi, hdpi,mdpi,ldpi
The ratio is
2.0
1.5
1.0
.75
So if you're creating an image for xhdpi as 200x200 pixels , you'll need to resize the image to 150x150 and place it in the hdpi drawable folder for phones of hdpi.
4) If you need to check the version of android you're running, and add features depending on that use
build.version.sdk_int > build.version_codes.(Your android version)
Eg. You can set action bars if the version.code is greater than honeycomb. Otherwise omit it.
All you have to do is create a separate folder for the language you want to use, and define a strings.xml in it.
Eg. values-fr folder, would mean for France.
So inside it define your strings such as "hello world" as "Bonjour". Android willl automatically pick the right language depending on the language you use on your phone.
2)To create different layouts create different folders such as
layouts
layouts-land (For landscape)
layouts-large (For large devices)
layouts-large-land(For large devices and landscape)
3) For pixel densities you have xhdpi, hdpi,mdpi,ldpi
The ratio is
2.0
1.5
1.0
.75
So if you're creating an image for xhdpi as 200x200 pixels , you'll need to resize the image to 150x150 and place it in the hdpi drawable folder for phones of hdpi.
4) If you need to check the version of android you're running, and add features depending on that use
build.version.sdk_int > build.version_codes.(Your android version)
Eg. You can set action bars if the version.code is greater than honeycomb. Otherwise omit it.
No comments:
Post a Comment