Rabu, 09 Januari 2013

Get various version strings of Android devices

Get various version strings of Android devices


package com.example.androidsysinfo;

import android.os.Build;
import android.os.Bundle;
import android.app.Activity;
import android.widget.TextView;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
TextView infoView = new TextView(this);
setContentView(infoView);

String version = "Version:\n";

version += "CODENAME: " + Build.VERSION.CODENAME + "\n"
+ "INCREMENTAL: " + Build.VERSION.INCREMENTAL + "\n"
+ "RELEASE: " + Build.VERSION.RELEASE + "\n"
+ "SDK_INT: " + Build.VERSION.SDK_INT + "\n"
+ "\n";

infoView.setText(version);
}

}


Related: Get Android system info

0 komentar:

Posting Komentar

Copyright © 2012 Codding News All Right Reserved