Android: how to the design app for Smartphone AND Tablet?

只愿长相守 提交于 2019-12-06 12:29:57

Keep one apk and just use alternative resources for your Tablet.

Take a look at:

http://code.google.com/p/iosched/source/browse/#hg%2Fandroid%2Fres

This show's you the directory structure of how to target SmartPhones and Tablets (with honeycomb) in the same APK.

EDIT

fancy version on Honeycomb

using Fragments won't change your UI in honeycomb it's just a way to re-use code. So you don't need Fragments to make your UI 'fancy'

EDIT 2

To find the current running Android version you can do something like

int b = Integer.parseInt(Build.VERSION.SDK);              
if(b >= Build.VERSION_CODES.HONEYCOMB){
      Log.i(TAG, "Found A Tablet Running Honeycomb or newer");                  
 }

EDIT 3

in your Activity call getActionBar(); you then have access to all action bar methods stated here: http://developer.android.com/reference/android/app/ActionBar.html

There was a talk on this very subject at Google IO this year. Now available on YouTube http://www.youtube.com/watch?v=WGIU2JX1U5Y&feature=youtube_gdata_player

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!