Last active
August 29, 2015 14:18
-
-
Save rena2019/24ee8825bbc8cbb68084 to your computer and use it in GitHub Desktop.
Display device version info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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