I want to develop an universal app . I am novice to this approach .That means a single apk for both tablet and phone application . I had go through
Support Library
Fragments
My aim is to build different UI for Tablet and Phone inside a single APk .
I had read Getting Your App Ready for Jelly Bean and Nexus 7 . This article mention that
res/layout/activity_home.xml
To take advantage of the extra space on the 7” screen you might provide an alternative layout:
res/layout-sw600dp/activity_home.xml
The sw600dp qualifier declares that these resources are for devices that have a screen with at least 600dp available on its smallest side.
Furthermore you might even provide a different layout for 10” tablets:
res/layout-sw720dp/activity_home.xml
That means we can use different layout for different device . This confuses me
EDIT 1 :: Scenario
Suppose
if my phone UI layout contains one-view pager and
tablet UI layout contain two-view pager .
How can we achieve this ?? In this article it says that you an designe different layout with same name for different screen and keep it corresponding folder . But my doubt will this arise exceptions if it try to initialize widget component of Tablet layout when app is running in a phone .
EDIT 2 : The idea came into my mind is determine which type of device is i am using ie Tab or phone .
Determine if the device is a smartphone or tablet?
Then avoid the initialization of widgets if app is phone . Is there any better way than this ??
EDIT 3 : My application support from 2.3 to higher versions
If my layouts for tablet holds additional widgets compared to phone layout .How an i initialize and use . Hope all understood my need . So please clarify my doubt