2011年6月30日 星期四

取得系統基本資訊

package com.demo.android.info;

import com.demo.android.info.R;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.widget.TextView;

public class Info extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

//android.os.Build.VERSION
setContentView(com.demo.android.info.R.layout.main);

TextView _tv = (TextView)findViewById(R.id.main_textview);
_tv.append("CPU type + ABI convention: "+android.os.Build.CPU_ABI+"\n");
_tv.append("Board: "+android.os.Build.BOARD+"\n");
_tv.append("Brand: "+android.os.Build.BRAND+"\n");
_tv.append("Device: "+android.os.Build.DEVICE+"\n");
_tv.append("Display: "+android.os.Build.DISPLAY+"\n");
_tv.append("Fingerprint: "+android.os.Build.FINGERPRINT+"\n");
_tv.append("Host: "+android.os.Build.HOST+"\n");
_tv.append("ID: "+android.os.Build.ID+"\n");
_tv.append("Manufacturer: "+android.os.Build.MANUFACTURER+"\n");
_tv.append("Model: "+android.os.Build.MODEL+"\n");
_tv.append("Product: "+android.os.Build.PRODUCT+"\n");
_tv.append("Tags: "+android.os.Build.TAGS+"\n");
_tv.append("Time: "+String.valueOf(android.os.Build.TIME)+"\n");
_tv.append("Type: "+android.os.Build.TYPE+"\n");
_tv.append("User: "+android.os.Build.USER+"\n");
_tv.append("The current development codename "+android.os.Build.VERSION.CODENAME+"\n") ;
_tv.append("Versoin incremental: "+android.os.Build.VERSION.INCREMENTAL+"\n");
_tv.append("The user visible version(release): "+android.os.Build.VERSION.RELEASE+"\n");
_tv.append("The user visible sdk version: "+android.os.Build.VERSION.SDK+"\n");
_tv.append("The user visible sdk version(int) : "+String.valueOf(android.os.Build.VERSION.SDK_INT)+"\n");

}
}

沒有留言: