Thursday, 23 February 2012

Get system properties of os name and version

os name and version
package com.exercise.AndroidOSversion;

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

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

TextView msg = (TextView)findViewById(R.id.msg);
msg.setText(System.getProperty("os.name")
+ " : "
+ System.getProperty("os.version"));
}
}


No comments:

Post a Comment