丁霄's profile霄霄PhotosBlogListsMore Tools Help

Blog


    October 20

    在G1上开发一个属于自己的专有程序

      前几天将小G收入囊中,无意中发现小G的操作系统(Andriod)是开源的,后查资料发现很强大,且已有牛人在小G上开发自己的应用程序,遂做出决定自己也写个玩玩。

    先上小G的标准图一张。

    参考资料网址:http://code.google.com/p/androidbmi/wiki/DiveIntoAndroid(台湾牛人编写)

                             20081023152805548

    开始动手

    一、在PC上配置小G的开发环境

    1)首先安装大名鼎鼎的eclipse。安装包可从官方获得,我用的eclipse-jee-galileo-win32平台,jre为1.6版本。

    eclipse无需安装,下载完毕后解压皆可使用,前提是要先安装好jre。jre1.6可在sun网站上下载获得。

    设置jre的PATH环境变量。

    1 2 3

    2)下载ADT,基于 Eclipse 的 Android 开发工具扩充套件 (Android Development Tools plugin)。

    该套件可在Eclipse平台上在线下载安装,但是由于网络的原因我是通过离线下载安装包得到的。

    Eclipsep平台会根据自己的版本自动获得ADT的版本号,我的版本号是0.9.3。

    离线下载地址为:http://dl-ssl.google.com/android/ADT-0.9.3.zip

    得到该包后,在Eclipse中安装。安装过程比较漫长,耐心等待。。。

    安装结束后在Eclipse开发环境中就会显示ADT相关标识。6  

    4

    5

    3)安装Andriod SDK

    下载Andriod SDK,下载地址为:http://dl.google.com/android/android-sdk-windows-1.6_r1.zip,大小为240M左右。

    得到该包后将其解压,点击Eclipse中的window下的Preference,安装SDK。

    7

    4)进过1-3的步骤后我们就拥有了一个Android的开发环境了。

    二、创建Android模拟器

    1)根据台湾牛人提供的创建模拟器的方法,我创建了两个Android模拟器。

    首先将android-sdk/tools目录添加到PATH系统环境变量中,方法和添加jre路径一致。

    在windows命令行下创建模拟器。

    在命令行状态下输入:android list target命令后出现下图所示页面,该页面列举了目前可以多少种创建器的类型,我可以创建4种类型的模拟器。

    8

    下面创建模拟器

    在命令行状态下输入:android create avd --target 2 –name xiaoxiao

    9

    接下来查看是否创建成功,在命令行状态下输入:android list avd

    10

    11

    创建模拟器成功。

    三、测试Android模拟器

    在Eclipse下Run,Run/configurations进行模拟器配置。

    12

    13

    装入一个Demo实例后,即可运行模拟器了。

    模拟器运行画面

    14 和小G实际的运行画面一致,太cool了。

    四、开发一个属于自己的小G应用程序

    本人利用台湾牛人提供的实例,稍作修改后就生成了自己的程序。

    从模拟器上运行程序和在小G上运行效果一样,接下来show一下。

    15   20091020091

    17   20091020093

    总结:进过测试小G终于可以在PC上进行开发了,Android果然强大,google公开了Android api后,对于手机应用程序个人开发将非常便利,不过国内目前android方面的资料还很少,只能通过国外的论坛才能获得相关资料,相信在不久的将来android会在国内迅速发展,期待中。。。 。后期我还会再继续写几个复杂点的应用程序,哈哈哈~~~

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://xiaoxiao19811023.spaces.live.com/blog/cns!355A9AB9A67245EA!579.trak
    Weblogs that reference this entry
    • None