First Android interface program

Source: Internet
Author: User

 

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:

 

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.