How to make an android application compatible with phone and tablet? What components should be used when writing an application targeting for both mobile phones and tablets?
iii. 9 patch tool
iv. for layouts don't use absolute layout. preferred to use Relative layout. Also while mentioning width/ height/ or margins don't mention in hard coded dp's or pixels, mention with respect to its parent.
i & ii
i, ii, & iii
i, ii, iii, & iv
Compatibility : Is to create an application targeting for both mobiles and tablets efficiently (keeping space and size in mind).
For that we have to use
2. Fragments. (To use space efficiently in tablets)
3. Since device screen sizes may vary, we have to make sure that our images used in that application should re-sized properly for all screen sizes. This can be achieved using draw9patch tool. (9 patch images)
4. We have to minimize the usage of absolute layouts and hard coded pixels in the xml layout files. Because if we use absolute pixels then it won't look proper when screen sizes changes. We should always mention the pixels in terms of screen width and height in which our application is downloaded. This can be done by using dp (density independent pixels).
Back To Top