Android – Retrieve Device’s SDK version and API level

By -

Ques:How do i fetch device’s SDK version and API level number?
Ans:
Build.VERSION.SDK_INT => To know API Level number i.e. 7,8,9
Build.VERSION.RELEASE => To know version code i.e. 2.1, 2.2, 2.3, 3.0

For your info,
// SDK_INT is only available in 1.6 and in newer
// REALEASE works on every version released so far.

For exaple:

   TextView txtView = (TextView) findViewById(R.id.textView1);
   txtView.setText("SDK API Level =>" +Build.VERSION.SDK_INT);
   txtView.append("n Build.VERSION.RELEASE =>"+Build.VERSION.RELEASE);

CEO & Co-Founder at SolGuruz® | Organiser @ GDG Ahmedabad | Top 0.1% over StackOverflow | 15+ years experienced Tech Consultant | Helping startups with Custom Software Development

Loading Facebook Comments ...
Loading Disqus Comments ...