• Save
One APK to rule them all
Upcoming SlideShare
Loading in...5
×
 

One APK to rule them all

on

  • 777 views

How to use the Android Framework to target many different devices

How to use the Android Framework to target many different devices

Statistics

Views

Total Views
777
Views on SlideShare
776
Embed Views
1

Actions

Likes
1
Downloads
0
Comments
0

1 Embed 1

http://www.slashdocs.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

One APK to rule them all One APK to rule them all Presentation Transcript

  • Dominik Helleberg | inovex GmbH One APK to rule them all
  • Dominik Helleberg Mobile Development Android HTML5 http://dominik-helleberg.de/+ http://twitter.com/_cirrus_
  • Der Android Zoo
  • Besser?
  • TheFWord
  • Der Android Zoo Challenging, butAndroid is designed to handle that!
  • Getting started... Screens ResolutionScreensize Density
  • Screensize2‘‘ 4‘‘ 7‘‘ 10‘‘small normal large xlarge
  • Resolution 1280x800 1280x720320 x 240
  • Density120 160 200 300ldpi mdpi hdpi xhdpi
  • ??? ResolutionScreensize Density
  • DP & SP120 160 200 300ldpi mdpi hdpi xhdpi
  • PX vs. DP & SP
  • PX vs. DP & SP
  • Layout ManagerPortions of this page are reproduced from work created and shared by the Android Open Source Project and used according toterms described in the Creative Commons 2.5 Attribution License.
  • PX vs. DP & SP
  • PX vs. DP & SP
  • Spezialisierte Layoutslayout/  layout-­‐land/  layout-­‐hdpi/  layout-­‐large-­‐land/  layout-­‐sw600dp/  
  • PX vs. DP & SP
  • Spezialisierte LayoutsPortions of this page are reproduced from work created and shared by the Android Open Source Project and used according toterms described in the Creative Commons 2.5 Attribution License.
  • Ab wann ist man Tablet?layout-­‐v11/  layout-­‐land/  layout-­‐xlarge/  layout-­‐sw600dp/  layout-­‐sw720dp/    
  • Activity vs. Fragment ControlPortions of this page are reproduced from work created and shared by the Android Open Source Project and used according toterms described in the Creative Commons 2.5 Attribution License.
  • Activity vs. Fragment Control Tab ActionBar click Fragment Fragment Activity
  • Activity vs. Fragment Control Tab ActionBar click Fragment Fragment Activity
  • Android À la cartePortions of this page are reproduced from work created and shared by the Android Open Source Project and used according toterms described in the Creative Commons 2.5 Attribution License.
  • Android À la carte - APIsIntent  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);  
  • Android À la carte - APIs LocationUpdateRequester   LegacyUpdateRequester   FroyoUpdateRequester   GingerBread   UpdateRequester  http://code.google.com/p/android-protips-location/
  • Android À la carte - APIs CompatLib   CustomImpl   Wrapper  
  • Android À la carte - Ressourcenvalues/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>    
  • Android À la carte - Ressourcen <service android:name=".ICSService" android:enabled="@bool/ICS"> </service>    
  • Android À la carte - Ressourcen Layout   Layout-­‐v14   Header   Header   Content   Content  
  • Android À la carte - Ressourcen Layout   Layout-­‐v14       <include/>   Header   <include/>     Content   Content  
  • Android À la carte - Ressourcen
  • Android À la carte - Ressourcen
  • Get it right - lint
  • Get it right - lint
  • Get it right - CI
  • Get it right – Real Devices
  • Fallbacks / Workarounds<uses-sdk android:minSdkVersion="8" android:targetSdkVersion=“16" /> <supports-screens .../> <compatible-screens ></compatible-screens> <uses-feature android:name="android.hardware.nfc" android:required="true"/>
  • Fallbacks / WorkaroundsTarget   Max   Sdk   Sdk   10 11-13 16
  • Fallbacks / Workarounds Target   Max   Sdk   Sdk  10 11-13 16
  • Fallbacks / Workarounds <supports-screens android:xlargeScreens="false" />
  • Fallbacks / Workarounds
  • 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 toterms described in the Creative Commons 2.5 Attribution License.
  • 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 toterms described in the Creative Commons 2.5 Attribution License.
  • DANKE!