The document discusses various techniques for developing Android applications that work across different device configurations and Android platform versions. It covers topics like screens sizes and densities, different layouts, using fragments and activities, leveraging new APIs while maintaining backwards compatibility, and using fallbacks and workarounds to support older platforms.
16. Layout Manager
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to
terms described in the Creative Commons 2.5 Attribution License.
21. Spezialisierte Layouts
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to
terms described in the Creative Commons 2.5 Attribution License.
22.
23. Ab wann ist man Tablet?
layout-Ââv11/
Â
layout-Ââland/
Â
layout-Ââxlarge/
Â
layout-Ââsw600dp/
Â
layout-Ââsw720dp/
Â
Â
24. Activity vs. Fragment Control
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to
terms described in the Creative Commons 2.5 Attribution License.
27. Android Ă la carte
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to
terms described in the Creative Commons 2.5 Attribution License.
28. Android Ă la carte - APIs
Intent
 i
 =
 null;
Â
if(android.os.Build.VERSION.SDK_INT
 >=
Â
Â
Â
 android.os.Build.VERSION_CODES.JELLY_BEAN)
Â
{
Â
 i
 =
 new
 Intent(this,
 JellyBeanActivity.class);
Â
}
Â
else
Â
 i
 =
 new
 Intent(this,
 DefaultActivity.class);
Â
29. Android Ă la carte - APIs
LocationUpdateRequester
Â
LegacyUpdateRequester
 FroyoUpdateRequester
Â
GingerBread
Â
UpdateRequester
Â
http://code.google.com/p/android-protips-location/
30. Android Ă la carte - APIs
CompatLib
Â
CustomImpl
Â
Wrapper
Â
31. Android Ă la carte - Ressourcen
values/bools.xml
Â
<resources>
<bool name="ICS">false</bool>
<bool name="preICS">true</bool>
</resources>
Â
Â
values-Ââv14/bools.xml
Â
<resources>
<bool name="ICS">true</bool>
<bool name="preICS">false</bool>
</resources>
Â
Â
32. Android Ă la carte - Ressourcen
<service android:name=".ICSService"
android:enabled="@bool/ICS">
</service>
Â
Â
33. Android Ă la carte - Ressourcen
Layout
 Layout-Ââv14
Â
Header
 Header
Â
Content
 Content
Â
34. Android Ă la carte - Ressourcen
Layout
 Layout-Ââv14
Â
Â
Â
<include/>
 Header
 <include/>
Â
Â
Content
 Content
Â
46. Fallbacks / Workarounds
<manifest ... >
<supports-screens
android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600" />
...
<application ... >
...
</application>
</manifest>
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to
terms described in the Creative Commons 2.5 Attribution License.
47. Fallbacks / Workarounds
<manifest ... >
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
...
<application ... >
...
<application>
</manifest>
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to
terms described in the Creative Commons 2.5 Attribution License.