Android: how to create an application for a smartphone and tablet?

I know that quite a lot of blog posts , like , Questions , which support backward compatibility Android 3.0 applications.

However, having read them all, I'm just more confused than before. :(

I have a smartphone app that supports min. SDK version 8 (2.2).

Now I want this to stay the same on smartphones, but also provide a fancy version on cell tablets with an action bar and fragments, etc.

I know there is a compatibility package, but everything I read about it was about fragments. What about the action bar and holographic theme? I made it pretty nice and easy, just by changing targetSdkVersion to "11" on my tablet. How can I achieve this with a compatibility pack?

Or would you say that it is better to develop two different versions of the program? (And maybe combine them later?)

Regards, Jellyfish

+2
source share
2 answers

Keep one apk and use alternative resources for your tablet.

Take a look at:

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

Shows the directory structure in which you can target smartphones and tablets (with cells) in the same APK.

EDIT

Honeycomb

, . , , ""

2

Android, -

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

3

getActionBar(); , : http://developer.android.com/reference/android/app/ActionBar.html

+5

All Articles