This blog is accidentally find out, it tells the story of one of our friends about the exploration of the Android world, also inspired my Android's interest for learning, exclamation unexpectedly have so many people are learning android, hope this article can let you have greater passion to Android.The blog comes from:http://blog.trifork.com/2009/09/08/exploring-the-world-of-android-part-1/,thanks Tom van Zummeren very much.

September 8th, 2009 by Tom van Zummeren

|

For a short while now, I am developing for the Android
platform, which is a mobile phone operating system developed by Google.
The language to use is Java, so at least I didn’t have to learn an
entirely different new language and I can use the tools I already know
and love. I would like to tell you about my ‘adventures’ as I explore
the world of Android

When I first started studying the Dev Guide I soon discovered that the recommended IDE for developing Android applications is Eclipse. Which was a bit disappointing because I don’t like Eclipse that much. But fortunately the kind folks of Google left room for other IDE’s
to develop with. They explain that when you use another IDE you will
have to use all kind of command line tools instead, which they provide.
Those command line tools allow you to compile your code for Android, run
your application in a phone emulator, connect a debugger to your
emulator, view application logs and stuff like that. But what they
didn’t mention, is that if you use Intellij IDEA (which happens to be my favorite IDE) it also provides good support for Android! This makes the use of most provided command line tools superfluous.

Setting up an Android project using IntelliJ

First of all make sure you’re using the right version of IntelliJ. If
you want to develop using Android SDK version 1.5, you have to use
IntelliJ version 8 or greater. For IntelliJ 7 only a very old version of
the plugin available which just won’t work with the latest Android SDK.
And I expect that for future versions of the Android SDK, you will have
to use IntelliJ 9 since the latest version of the Android plugin for
IntelliJ already requires IntelliJ 9.

  1. Create all necessary files for your new project by executing the android command line tool which is explained on this page: http://developer.android.com/guide/developing/other-ide.html#CreatingAProject
  2. Create a new project using File > New project > Create Java project from existing sources. Base your new IntelliJ project on the source files you created earlier. Note: you might want to deselect the “…/yourProject/tests/src
    folder when IntelliJ offers you to make include it as a source folder.
    Also make sure to select the Android facet which will be auto-detected
    by IntelliJ
  3. Open the Run/Debug configurations window (Alt + Shift + F10 > Edit configurations)
  4. Click the button and select “Android” from the top of the list.
  5. Give the configuration a name and select your main “Activity”
  6. That’s it! You can now run the application using an emulator by clicking the or button

If all went well, the emulator started up, launched your application and looks like this:

Note that the first time you start the emulator, it takes a long
time. But luckily, you can leave the emulator open and redeploy your
application while it’s still running. So the second time you deploy your
application on the emulator will happen much quicker.

One final note, to see the emulator logs (for example to view exception stack traces) run the following command: adb logcat.

Using Maven 2 to build your project

It is possible you want to have a build script for your Android project. This is mainly useful for:

  • compiling and deploying the application without using an IDE
  • running unit tests
  • continuous integration

If you now browse through your Android source files, you will notice that a few files are generated for an Ant
build: build.xml, build.properties, default.properties and
local.properties. If you like using Ant you can leave the files there
and use them for your build. If you, like me, rather use Maven 2 do the
following:

  • Delete the above mentioned Ant related files from your project’s source directory
  • Create a Maven 2 build script (pom.xml) following the instructions on this page: http://code.google.com/p/masa/wiki/GettingStarted
  • If you set up the Maven 2 build script correctly, you can build the project using mvn clean install or also deploy it in the emulator: mvn clean install -Dmasa.debug

Version control

One final note if you want to use a version control system like CVS,
Subversion or Git (which is always a good idea). You should check in all
your project’s source files EXCEPT:

  • the gen directory (this is automatically generated by the Android compiler)
  • IntelliJ project files (iml, ipr and iws)

By now you hopefully also have a Maven 2 build set up for the project
so you can now for example set up a build server (TeamCity, Cruise
control, …) using the Maven 2 build and your VCS repository.

To sum up

I explained how to start developing an Android application using
IntelliJ, Maven 2 and version control. I currently am developing an
application using the exact same setup and it’s all working like a
charm. While further developing my Android application I will probably
encounter various challenges which I will soon tell you more about.

TO BE CONTINUED …

Tags: Android, Getting started, Java Posted in: Custom Development

Exploring the world of Android :: Part 1的更多相关文章

  1. Exploring the world of Android :: Part 2

    September 17th, 2009 by Tom van Zummeren | And I’m back! Reporting live on the glorious adventures i ...

  2. Android 异步网络图片加载

    ListView异步加载图片 http://www.eoeandroid.com/forum.php?mod=viewthread&tid=161586 [Android分享] ListVie ...

  3. Android Weekly Notes Issue #316

    July 1st, 2018 Android Weekly Issue #316 本期内容包含教你使用Kotlin通过Annotation Processor生成代码文件, JetPack中的Andr ...

  4. Android Weekly Notes Issue #233

    Android Weekly Issue #233 November 27th, 2016 Android Weekly Issue #233 本期内容包括: 用Mockito做RxJava的单元测试 ...

  5. Android Weekly Notes Issue #228

    Android Weekly Issue #228 October 23rd, 2016 Android Weekly Issue #228 本期内容包括: Android 7.1的App Short ...

  6. Android 7.1 App Shortcuts使用

    Android 7.1 App Shortcuts使用 Android 7.1已经发了预览版, 这里是API Overview: API overview. 其中App Shortcuts是新提供的一 ...

  7. Android Weekly Notes Issue #227

    Android Weekly Issue #227 October 16th, 2016 Android Weekly Issue #227. 本期内容包括: Google的Mobile Vision ...

  8. android调试工具DDMS的使用详解

    具体可见http://developer.android.com/tools/debugging/ddms.html. DDMS为IDE和emultor.真正的android设备架起来了一座桥梁.开发 ...

  9. 使用calabash测试开源中国Android客户端

    Calabash-android是支持android的UI自动化测试框架,前面已经介绍过<中文Win7下成功安装calabash-android步骤>,这篇博文尝试测试一个真实应用:开源中 ...

随机推荐

  1. Haskell语言学习笔记(74)GADTs

    GADTs GADTs(Generalised Algebraic Data Types,广义代数数据类型)是对代数数据类型的一种扩展. 它允许在定义数据类型时明确指定类型参数的类型并使用模式匹配. ...

  2. Redis进阶实践之九 独立封装的RedisClient客户端工具类(转载9)

    Redis进阶实践之九 独立封装的RedisClient客户端工具类 一.引言 今天开始有关Redis学习的第九篇文章了,以后肯定会大量系统使用Redis作为缓存介质,为了更好的更好的Redis,自己 ...

  3. Delphi的子类化控件消息, 消息子类化

    所谓的子类化,网上有很多说明,我就说我个人的随意理解,可能有误,请列位看官斟酌理解. 所谓子类化,个人理解就是拦截某个控件的消息以及样式,来进行自己的特定处理以达到特殊的功能需求.这个子类化,可以有子 ...

  4. Spring格式化注解

    Spring Framework 3.0发布了.这里我们介绍其中的一个:用于格式化的注解.简介 Spring 3 提供了两个可以用于格式化数字.日期和时间的注解@NumberFormat和@DateT ...

  5. AngularJS理论知识

    两个核心概念 三个架构 MVC 一切应用程序都是数据的增删改查 那么总要有东西装数据吧 Model就是干这个事(数据表现和操作) View(展现数据) Controller(逻辑) 那么M- V- C ...

  6. Java调用C/C++实现的DLL动态库——JNI

    由于项目的需要,最近研究了java 调用DLL的方法,将如何调用的写于此,便于日后查阅: 采用的方法是JNI:Java Native Interface,简称JNI,是Java平台的一部分,可用于让J ...

  7. C++ vc中怎么使用SendMessage自定义消息函数

    vc中怎么使用SendMessage自定义消息函数: SendMessage的基本结构如下:SendMessage(    HWND hWnd,  //消息传递的目标窗口或线程的句柄.    UINT ...

  8. C# 基础 new 、override实现多台区别

    一.new只是隐藏父类中的同名方法.基类和父类中都存在这个方法. namespace ConsoleApplication1 { class Program { static void Main(st ...

  9. 利用原生态的(System.Web.Extensions)JavaScriptSerializer将mvc 前台提交到controller序列化复杂对象

    主要代码如下: public JsonResult Test() { string s = Request.Form.ToString(); JavaScriptSerializer jss = ne ...

  10. hdu3826-Squarefree number-(欧拉筛+唯一分解定理)

    Squarefree number Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...