Skip to content

Instantly share code, notes, and snippets.

@rena2019
Last active August 29, 2015 14:18
Show Gist options
  • Save rena2019/24ee8825bbc8cbb68084 to your computer and use it in GitHub Desktop.
Save rena2019/24ee8825bbc8cbb68084 to your computer and use it in GitHub Desktop.
Display device version info
import android.view.View.OnClickListener;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Build;
void showDlg(String message) {
// MainActivity = myapp
AlertDialog alertDialog1 = new AlertDialog.Builder(myapp).create();
alertDialog1.setTitle("Info");
alertDialog1.setMessage( message );
alertDialog1.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// closed
}
});
alertDialog1.show();
}
StringBuffer buf = new StringBuffer();
buf.append("VERSION.RELEASE {"+Build.VERSION.RELEASE+"}");
buf.append("\nVERSION.INCREMENTAL {"+Build.VERSION.INCREMENTAL+"}");
buf.append("\nVERSION.SDK {"+Build.VERSION.SDK+"}");
buf.append("\nBOARD {"+Build.BOARD+"}");
buf.append("\nBRAND {"+Build.BRAND+"}");
buf.append("\nDEVICE {"+Build.DEVICE+"}");
buf.append("\nFINGERPRINT {"+Build.FINGERPRINT+"}");
buf.append("\nHOST {"+Build.HOST+"}");
buf.append("\nID {"+Build.ID+"}");
showDlg( buf.toString() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment