设为首页
优惠IDC
收藏本站
六狼博客
六狼论坛
开启辅助访问
切换到窄版
用户名
Email
自动登录
找回密码
密码
登录
立即注册
只需一步,快速开始
只需一步,快速开始
快捷导航
门户
首页
BBS
云计算
大数据
手机
移动开发android,ios,windows phone,windows mobile
编程
编程技术java,php,python,delphi,ruby,c,c++
前端
WEB前端htmlcss,javascript,jquery,html5
数据库
数据库开发Access,mysql,oracle,sql server,MongoDB
系统
操作系统windows,linux,unix,os,RedHat,tomcat
架构
项目管理
软件设计,架构设计,面向对象,设计模式,项目管理
企业
服务
运维实战
神马
搜索
搜索
热搜:
php
java
python
ruby
hadoop
sphinx
solr
ios
android
windows
centos
本版
帖子
用户
六狼论坛
»
首页
›
操作系统
›
os
›
android开发初试(基于GUI的开发)
返回列表
查看:
33
|
回复:
0
android开发初试(基于GUI的开发)
[复制链接]
xtugtf
xtugtf
当前离线
积分
25
窥视卡
雷达卡
升级
50%
当前用户组为
童生
当前积分为
25
, 升到下一级还需要 25 点。
5
主题
5
主题
5
主题
童生
童生, 积分 25, 距离下一级还需 25 积分
童生, 积分 25, 距离下一级还需 25 积分
积分
25
发消息
楼主
|
发表于 2013-1-28 19:26:30
|
显示全部楼层
|
阅读模式
现在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/widget*56"
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); }@Overridepublic void onClick(View v) {// TODO Auto-generated method stubthis.TEditages.setText(this.TEditname.getText().toString()+this.TEditsex.getText().toString());}}
(4)运行效果图
gphone英文界面 和中文界面,很酷啊!。。。。
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
千斤顶
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
PHP
Ubuntu
Html/Css
C
C++
Copyright © 2008-2020
六狼论坛
(https://it.6wolf.com) 版权所有 All Rights Reserved.
Powered by
Discuz!
X3.4
京ICP备14020293号-2
本网站内容均收集于互联网,如有问题请联系
QQ:389897944
予以删除
快速回复
返回顶部
返回列表