第一个 android 的界面程序

 

 昨天第了hello word, 所以今天想写一个界面程序看看和一般的windows开发有什么区别,好了现在开始:

 

先找到在android下开发界面有一个droiddraw的工具,所以就先下载下来,目录结构如下:

 

 

然后打开此工程制作界面如下:

 

 

根据图上的设置生成界面代码,用这个工具确实比在eclipse里生成界面好方便很多^_^

 

下来写一点代码看看运行的效果:

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());   
  
   }
  });   
    }

 

 

好了代码写完了,运行一下:

 

 

 

 

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值