Android Application: Stop using Deprecated API's on new API level enabled device -


well started application support api level 8 i.e froyo verison. being on api level 18 jelly bean version, how stop using deprecated api's on application.
one example
dialog(api 1) vs dialogfragment(api 13)
following in mind
1)use android support library way go?
2)have runtime api level check below, healthy habit?

if (build.version.sdk_int==build.version_codes) {//some api level run code }else if(){ run code } 


3) use reflection?
4)have separate code base each api level,makes no sense.
5)does palystore allows uplaod multiple apk's based on api level.or complete control on uses-sdk manifest value.

<uses-sdk android:minsdkversion="integer"       android:targetsdkversion="integer"       android:maxsdkversion="integer" /> 

what best way use latest api's 1 code base , make 1 apk , inturn have backward comparability support.

inputs appreciated.

one example dialog(api 1) vs dialogfragment(api 13)

dialog not deprecated. ways of using dialog may deprecated, such old-style managed dialogs.

use android support library way go?

generally, yes.

have runtime api level check below, healthy habit?

yes, though use >= or <=, not ==, drive behaviors range of api levels.

use reflection?

i wouldn't.

have separate code base each api level,makes no sense. palystore allows uplaod multiple apk's based on api level

in extreme cases may required. apps should not need this.

what best way use latest api's 1 code base , make 1 apk , inturn have backward comparability support.

that impossible answer in abstract.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -