Android学习-HelloWorldAndroid
2010-05-08 14:36
423 查看
这段时间比较的闲,突然想学学一些新的东西,就搭建了一个windows平台下的android开发环境,学学Google android手机应用程序开发。在此,小结一下,android菜鸟学习笔记。
编程环境
操作系统:windows xp sp3
IDE:Eclipse 3.3.2
Android SDK:android-sdk_r04-windows
ADT:Android developer tools version 5
apache ant:apache-ant-1.8.1-bin
Android SDK的安装过程花了我不少的时间,开始我下载是的是android-2.1_r01-windows的版本,但是不知道为什么里面的tools目录下面很多程序不完整,在eclipse的windows->perferences->android下面设置sdk目录的时候提示找不到abd.exe等错误。不知道是什么原因。最后换了一个使用SDK setup.exe安装的sdk安装,期间也会遇到一个问题就是在他自己下载完tools_r05-windows.zip文件的时候解压后覆盖tools目录的时候出错
,需要手动覆盖,然后再重新运行SDK setup.exe才能顺利完成android SDK安装。
具体的配置和安装过程,网上很多:
android sdk 2.0 安装教程:http://topic.csdn.net/u/20091103/16/68c75d25-006c-432b-920e-59b79368aeec.html?4062
apache ant 下载地址:http://www.apache.org/dist/ant/binaries/
android模拟器运行界面:
HelloWorldAndroid
下面写一个简单的android程序:
新建一个android project,
这里的package name的命名规则还得是xxx.xxx.xx的形式,不然还不让你继续下一步。
android自动生成的目录结构:
在res/layout/main.xml中可以应用程序设计界面:
用网上看的别人的代码试了一下。
编程环境
操作系统:windows xp sp3
IDE:Eclipse 3.3.2
Android SDK:android-sdk_r04-windows
ADT:Android developer tools version 5
apache ant:apache-ant-1.8.1-bin
Android SDK的安装过程花了我不少的时间,开始我下载是的是android-2.1_r01-windows的版本,但是不知道为什么里面的tools目录下面很多程序不完整,在eclipse的windows->perferences->android下面设置sdk目录的时候提示找不到abd.exe等错误。不知道是什么原因。最后换了一个使用SDK setup.exe安装的sdk安装,期间也会遇到一个问题就是在他自己下载完tools_r05-windows.zip文件的时候解压后覆盖tools目录的时候出错
,需要手动覆盖,然后再重新运行SDK setup.exe才能顺利完成android SDK安装。
具体的配置和安装过程,网上很多:
android sdk 2.0 安装教程:http://topic.csdn.net/u/20091103/16/68c75d25-006c-432b-920e-59b79368aeec.html?4062
apache ant 下载地址:http://www.apache.org/dist/ant/binaries/
android模拟器运行界面:
HelloWorldAndroid
下面写一个简单的android程序:
新建一个android project,
这里的package name的命名规则还得是xxx.xxx.xx的形式,不然还不让你继续下一步。
android自动生成的目录结构:
在res/layout/main.xml中可以应用程序设计界面:
package cn.ac.gucas.liuxin; import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MyHelloWorld extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.Button01); button.setOnClickListener(new OnClickListener(){ public void onClick(View w){ openDialog(); } }); } private void openDialog(){ AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Hello World Android"); builder.setMessage("Hello World Android"); builder.setNegativeButton("OK", null); builder.show(); } }
用网上看的别人的代码试了一下。
相关文章推荐
- Android目录结构介绍&Android学习之hello world
- android学习13——android egl hello world
- android学习13——android egl hello world
- Linux设备驱动基础程序学习(0)-Hello, world!模块
- Android helloWorld
- Android之HelloWorld
- 第5章、解析Hello,world!知其然,更要知其所以然(从零开始学Android)
- 2.SGi学习之Hello World
- libevent代码阅读(3)——入门例子“hello-world.c”的学习
- Android入门—— Hello, world
- jQuery学习笔记之Helloworld
- WTL学习笔记——(2)WTL Hello World !
- Java系列--第二篇 基于Maven的Android开发HelloAndroidWorld
- helloWorld does not specify a android.test.InstrumentationTestRunner instrumentation or does not dec
- Android应用---基于NDK的samples例程hello-jni学习NDK开发
- JNI学习--通过Java应用调用C语言的函数打印hello,world
- Android Hello World
- 树莓派linux驱动学习之hello world
- maven学习 ----hello-world
- Cocos2d-x 学习随记之一 hello,world工程注释!!