venkat
venkat

Reputation: 537

Regarding Minimum Required SDK , Target SDK , Compile with options in Android

Can anyone explain regarding the Minimum Required SDK, Target SDK , Compile with options while creating an application.

  1. If i set the minimum required SDK as API 8, Target SDK as API 16 and Compile with API 17, will it work on Froyo devices in adroid?

  2. If i want to use the methods introduced in API 16 or Library uses API 16, and want my app
    to work on Froyo or ICS devices, how can i achieve this?

    Thanks in advance.

Upvotes: 2

Views: 2224

Answers (3)

koem
koem

Reputation: 574

You can use API-Level 16 methods only on devices that are Level 16 and higher. But you can check in your app and only call them when this is the case. Look into my small test-app which uses API-11-methods and runs from API-3 and up.

http://code.google.com/p/android-change-log/source/browse/trunk/src/sheetrock/panda/changelog/ChangeLog.java

Look at lines 40-41, 144-145 and 324-341. You don't need any third party libraries for this, but you need to put your higher API code in a separate class (lines 324-341).

Upvotes: 1

Shadow
Shadow

Reputation: 6899

Yes ofcourse for first question. If you use like this.

    android:minSdkVersion="8"
    android:targetSdkVersion="16" 

For second. you can go for third party library if you import it, surely will work.For eg:

special features introduced in android 4.0 with tabs and swipe.But to overcome that

actionbar sherlock library been introduced which support in all version and in github.

Hope it helps you.

Upvotes: 0

Lazy Ninja
Lazy Ninja

Reputation: 22527

  1. Yes. But be careful not to include API higher than Froyo in your application
  2. From my understanding, you can't, unless you use third party libraries.
    There are useful libraries out there which help you realise that:ViewPager and ActionBarSherlock.

Upvotes: 1

Related Questions