Retrieving Android API version programmatically

前端 未结 11 1903
长情又很酷
长情又很酷 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:27

    SDK.INT is supported for Android 1.6 and up

    SDK is supported for all versions

    So I do:

    String sdk_version_number = android.os.Build.VERSION.SDK;
    

    Credits to: CommonsWare over this answer

提交回复
热议问题