`
xtugtf
  • 浏览: 24621 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

android开发初试(基于GUI的开发)

阅读更多

现在android新版SDK1.5发布了,很是热啊,所以得加紧时间学习哦! 1)开发环境不用多说,找几个文章看看就会了; 2)先试一下界面开发,这是我开发的习惯,开做界面再写代码; (1)界面开发可以用eclipse中的工具去做,但不好控制,或直接用xml自己写layout了,要么用较好的工具是droiddraw,直接画起来,还是较方便。

     

 

  产生xml文件,然后来替换android工程中的main.xml文件

 

2)替换layout下的main.xml文件

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget27"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TableLayout
android:id="@+id/widget50"
android:layout_width="fill_parent"
android:layout_height="150px"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:stretchColumns="1"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
>
<TableRow
android:id="@+id/widget51"
android:layout_width="fill_parent"
android:layout_height="25px"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
>
<TextView
android:id="@+id/widget52"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="姓名:"
>
</TextView>
<EditText
android:id="@+id/widgeteditname"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="18sp"
>
</EditText>
</TableRow>
<TableRow
android:id="@+id/widget52"
android:layout_width="fill_parent"
android:layout_height="25px"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
>
<TextView
android:id="@+id/widget55"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="性别:"
>
</TextView>
<EditText
android:id="@+id/widgeteditsex"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="18sp"
>
</EditText>
</TableRow>
<TableRow
android:id="@+id/widget53"
android:layout_width="fill_parent"
android:layout_height="25px"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
>
<TextView
android:id="@+id/widget56"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="年龄:"
>
</TextView>
<EditText
android:id="@+id/widgeteditages"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textSize="18sp"
>
</EditText>
</TableRow>

</TableLayout>
<Button
android:id="@+id/widgetOKbutton"
android:layout_width="50px"
android:layout_height="45px"
android:text="ok"
android:layout_below="@+id/widget50"
android:layout_alignRight="@+id/widget50">

>
</Button>
</RelativeLayout>

 

(3)写代码作简单的测试

 

package com.topsun;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class guiwindows extends Activity implements OnClickListener{
	
	EditText TEditname;
	EditText TEditsex;
	EditText TEditages;
	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.widgeteditname);
        this.TEditsex = (EditText) this.findViewById(R.id.widgeteditsex);
        this.TEditages = (EditText) this.findViewById(R.id.widgeteditages);
       this.TOKbutton = (Button) this.findViewById(R.id.widgetOKbutton);
       this.TOKbutton.setOnClickListener(this);
        
    }

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		this.TEditages.setText(this.TEditname.getText().toString()+this.TEditsex.getText().toString());
		
	}
}

 

  (4)运行效果图

      

 

gphone英文界面  和中文界面,很酷啊!。。。。

       

分享到:
评论

相关推荐

    初试PhoneGap开发框架

    ### 初试PhoneGap开发框架知识点详解 #### 一、概览 本篇文章将通过一个实战案例介绍如何使用PhoneGap开发框架来构建跨平台移动应用。PhoneGap是一款开放源码的移动开发工具,允许开发者利用HTML、CSS以及...

    初试基于Jersey框架的RESTful服务开发

    NULL 博文链接:https://smartzxy.iteye.com/blog/592843

    React组件化开发初试共20页.pdf.zip

    本资料"React组件化开发初试共20页.pdf.zip"将带你初步探索React组件化的魅力,理解其原理并学会实际运用。 React是由Facebook开发的一个用于构建用户界面的JavaScript库,其主要特色就是组件化。组件是React中的...

    Android 抽屉功能初试

    在Android应用开发中,"抽屉"通常指的是滑动导航 Drawer Layout,它是Android系统提供的一种设计模式,用于实现侧滑菜单。这个菜单通常隐藏在屏幕边缘,用户可以通过手势(通常是向内滑动)来显示或隐藏它,为用户...

    基于c++的研究生初试录取管理系统全文件

    【标题】基于C++的研究生初试录取管理系统全文件 本系统是针对研究生初试录取流程而设计的一个管理软件,采用C++编程语言在Visual Studio环境下实现。C++是一种广泛应用的面向对象编程语言,以其高效、灵活性和强大...

    android XMPP推送初试

    android 基于xmpp服务的推送程序,客户端源码,服务器可自行搭建...

    插件框架开发初试(DLL+接口的应用)

    插件框架开发初步验证,通过DLL返回对象,然后通过接口操作对象; 但释放时还有点问题,有兴趣的朋友下载帮忙修正,我的QQ:37784971 欢迎指导批评。 REMARK:BUG已修改,下载的朋友请链接...

    Android 中级应用 handler 之二 初试handler

    在Android开发中,`Handler`是一个至关重要的组件,它用于处理与UI线程交互的异步消息通信。本文将深入探讨`Handler`的工作原理及其在实际应用中的使用,旨在帮助开发者提升对Android中级应用的理解。 首先,理解`...

    研究生初试录取 程序代码

    ### 研究生初试录取程序代码分析 #### Java GUI编程基础 代码中使用了Swing库来创建图形用户界面(GUI),Swing是Java中的一个用于构建图形用户界面的工具包。它提供了一系列丰富的组件,如`JFrame`(窗口)、`...

    软件工程初试.zip

    预测题是基于对历年真题的分析和教师出题规律的把握而编制的模拟试题,它们可以帮助考生检验复习效果,提前适应考试环境。预测题通常会涵盖课程的重点和难点,有的甚至会预测可能的热门考点,对考生进行全面的考前...

    WIN32界面开发之一:初试加载背景界面 源码

    在本文中,我们将深入探讨如何在WIN32环境下进行界面开发,特别关注如何初试加载背景界面。在Windows编程中,创建美观、吸引人的用户界面是至关重要的,因为这直接影响到用户的体验。GDI+(Graphics Device ...

    csp - j初试模拟卷.docx

    csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟卷.docx csp - j初试模拟...

    研究生初试录取管理系统

    研究生初试录取管理系统是一款基于C++语言开发的应用程序,旨在帮助教育机构高效地管理和处理研究生入学考试的相关数据。该系统通过定义结构化的学生类(`student`)和数组类(`array`),实现了学生信息的输入、...

    初试JqueryEasyUI(附Demo)

    **jQuery EasyUI 知识点详解** jQuery EasyUI 是一个基于 ...总的来说,jQuery EasyUI 降低了前端开发的门槛,通过简单易用的 API 实现复杂界面的构建。通过实践和探索这个 Demo,你将能更好地理解和运用这一框架。

Global site tag (gtag.js) - Google Analytics