安卓开发系统

时间:2014-12-12 06:33:01
【文件属性】:

文件名称:安卓开发系统

文件大小:42KB

文件格式:RAR

更新时间:2014-12-12 06:33:01

安卓开发系统

安卓开发系统package helloworld.test; import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class test extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button mbutton=(Button)findViewById(R.id.button1); mbutton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub EditText result1=(EditText)findViewById(R.id.editText1); EditText result2=(EditText)findViewById(R.id.editText2); double height=Double.parseDouble(result1.getText().toString()); double weight=Double.parseDouble(result2.getText().toString()); double bmi=weight/(height); String i=Double.toString(bmi); TextView result=(TextView)findViewById(R.id.textView3); if (bmi<1) result.setText(i+getText(R.string.hello)); else result.setText(i+getText(R.string.yingyu)); openOptionsDialog(); } } ); } void openOptionsDialog() { // TODO Auto-generated method stub new AlertDialog.Builder(test.this) .setTitle("about") .setMessage("Hello world!") .show(); } }


【文件预览】:
helloworld
----.project(846B)
----proguard.cfg(1KB)
----src()
--------helloworld()
----AndroidManifest.xml(673B)
----res()
--------drawable-ldpi()
--------drawable-hdpi()
--------drawable-mdpi()
--------layout()
--------values()
----.settings()
--------org.eclipse.jdt.core.prefs(208B)
----assets()
----gen()
--------helloworld()
----default.properties(362B)
----.classpath(280B)
----bin()
--------resources.ap_(11KB)
--------classes.dex(4KB)
--------helloworld()
--------helloworld.apk(15KB)

网友评论