Retrieving Android API version programmatically

前端 未结 11 2305
长情又很酷
长情又很酷 2020-11-22 04:54

Is there any way to get the API version that the phone is currently running?

11条回答
  •  庸人自扰
    2020-11-22 05:36

    android.os.Build.VERSION.SDK should give you the value of the API Level. You can easily find the mapping from api level to android version in the android documentation. I believe, 8 is for 2.2, 7 for 2.1, and so on.

提交回复
热议问题