Hello word was entered yesterday, so today I want to write an interface program to see what is different from general windows development. Now, let's start:
First find a droiddraw tool on the android development interface, so download it first. The directory structure is as follows:
Open the Project Creation Interface as follows:
Generate the interface code according to the settings shown in the figure. Using this tool is indeed much easier than generating the interface in eclipse.
Write down a bit of code to check the running effect:
Public class helloandroid extends activity {
Edittext teditname;
Edittext teditpwd;
Button tokbutton;
/** Called when the activity is first created .*/
@ Override
Public void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Setcontentview (R. layout. Main );
This. teditname = (edittext) This. findviewbyid (R. Id. widget36 );
This. teditpwd = (edittext) This. findviewbyid (R. Id. widget37 );
This. tokbutton = (button) This. findviewbyid (R. Id. widget35 );
// This. tokbutton. setonclicklistener (this );
This. tokbutton. setclickable (true );
This. tokbutton. setonclicklistener (New View. onclicklistener (){
Public void onclick (view v ){
// Todo auto-generated method stub
Tokbutton. settext (
Teditname. gettext (). tostring (). Trim () +
Teditpwd. gettext (). tostring (). Trim ());
}
});
}
After the code is finished, run: