How to support multiple android version in your code?

前端 未结 8 657
名媛妹妹
名媛妹妹 2020-12-01 11:01

Take accessing contacts in android android.jar for versions 1.6 has People.CONTENT_URI for invoking contacts related info whereas in later versions we need to have api suppo

8条回答
  •  广开言路
    2020-12-01 11:27

    Quite Honestly, it's a pain.

    I usually, just isolate parts of code that are different and access them using abstract classes. So technically creating different version for different OS.

    But there are other ways. The best one i've seen involves using reflection.

提交回复
热议问题