Saturday, January 3, 2015

Android Interview Questions - part 2

What is min and max sdk version?
Manifest file has an option to tell what is the minium sdk version , and maximum sdk version your app can be downloded.
It simply says what all the various phone ranges your app supports or can be downloadable.

There is one more option target sdk, which says I have compiled and cross checked with this version and I am targeting for this version.
So that android system won't add any compatible library when your app is downloaded into a phone which is same as your target sdk version.




Q1. What are the screen sizes supported by android?
A: For simplicity, Android groups all actual screen sizes into four generalized sizes: small, normal, large, and extra large.

What is dx tool in android?
DVM (Dalvik Virtual Machine) understands only .dex format, and not .class format.
All android applications runs in DVM. So we have to convert all .class files into dalvik understandable format (android byte code).
This is done by dx tool.

Which component is not started by an intent?
Content Provider

What is the meaning of dex file?
1. Android programs are compiled into .dex (Dalvik Executable) files to execute with DVM. dex files are light weight when compared to .class files, and takes less memory and runs faster.
2. DEX files are used to initialize and execute applications developed for the Android mobile OS. 3. DVM (Dalvik Virtual Machine) where an android application runs, can understand only .dex files. It can't understand .class files.

How do you give version numbers for application which is targeted for both mobiles and tablets? Will you give same version or different version?
It is not based the version number that we differentiate between mobile version and tablet version, but it is by using fragments in the application.

what is size of apk in Kb ?
We cannot predict the size of .apk file because it depends upon the source code, images, layouts and other resources of the application.

How do you solve compatability issues?
1. Use dp (density independent pixels) in place of px for view width and height.
2. Create verious density image with same name for drawable- mdpi, hdpi, xhdpi, xxhdpi.
3. Use nine-patch images for better scaling with out blur effect.
4. Avoid hard coded width and height values, and always give width and height with respect to parent.

5. Use fragments if you are targeting your application for both mobiles and tablets.

No comments:

Post a Comment