Intellij IDEA是我最喜欢的IDE,所以使用Intellij IDEA开发Android。安装Android插件,配置好Android的JDK就可以开发了。

直接贴图,懒得打字。反正Hello World程序到处都是。。。。












HelloWorld就搞定了。。。。

Android项目结构如下。乍看之下目录挺多的,其实各司其守,不过做惯了j2ee的人,刚开始还是有些不习惯。



R.java是Android用的。
libs下面肯定是需要的lib啦。
drawable下面是图片。
main.xml是布局。

       <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    ><TextView      android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="@string/hello"    /></LinearLayout>

其中LinearLayout是布局,TextView是个显示组件,显示android:text="@string/hello"所表示的字符串,@string/hello指向strings.xml里面的hello标签所对应的值。这里就是Hello World, Lop!

strings.xml是字符串,可国际化使用。

<?xml version="1.0" encoding="utf-8"?><resources>    <string name="hello">Hello World, Lop!</string>    <string name="app_name"></string></resources>


HelloAndroid.java就是代码了。
package org.ivan;import android.app.Activity;import android.os.Bundle;/** * Created by IntelliJ IDEA. * User: Ivan * Date: 2010-4-26 * Time: 22:18:30 */public class HelloAndroid extends Activity {    /**     * Called when the activity is first created.     */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}

实际就一句代码,setContentView(R.layout.main);,将main画上去。。

看一下运行结果吧。



更多相关文章

  1. Android(安卓)内核开发初步
  2. Android(安卓)Studio单元测试
  3. android JNI (二) 第一个 android工程
  4. Android(安卓)增加对鼠标的支持
  5. 基于蓝牙socket开发Android蓝牙通信
  6. Binder驱动的实现
  7. Android/java 多线程(五)-ThreadPoolExecutor线程池的使用
  8. Android实例收藏
  9. zz浅谈android的selector,背景选择器

随机推荐

  1. 【Android】Android(安卓)4.2源码下载(ubu
  2. Android(安卓)性能优化之Java(Android)代
  3. Hello World
  4. android:shape的使用
  5. Android(安卓)Activity四种启动方式
  6. Ubuntu 系统上编译Android(安卓)系统
  7. Eclipse 安装 Google Android(安卓)插件
  8. Android(安卓)Studio无法启动 打开, Andro
  9. Android(安卓)之 EditText属性用法介绍
  10. Android开发环境的搭建