Chinaunix首页 | 论坛 | 博客
  • 博客访问: 662296
  • 博文数量: 186
  • 博客积分: 1875
  • 博客等级: 上尉
  • 技术积分: 2117
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-23 23:21
个人简介

有时候,就是想窥视一下不知道的东东,因为好奇!

文章分类

全部博文(186)

文章存档

2024年(2)

2023年(3)

2019年(1)

2018年(1)

2017年(2)

2016年(69)

2015年(53)

2014年(14)

2013年(1)

2012年(5)

2011年(25)

2010年(9)

分类: Android平台

2013-07-07 22:50:35


这两天折腾android,郁闷了一阵,总算让helloworld跑起来了。回忆一下。

一.环境:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

Linux zhanglong 3.2.0-49-generic #75-Ubuntu SMP Tue Jun 18 17:39:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

二.下载的东东:
 jdk-6u31-linux-x64.bin
  下载地址:
 adt-bundle-linux-x86_64-20130522.zip(其中包含了eclipse/adt/android SDK工具等)
  下载地址:http://developer.android.com/sdk/index.html
 另一个:sudo apt-get install ia32-libs没怎么注意的。
三.安装过程
 1.jdk安装
 sudo ./jdk-6u31-linux-x64.bin
 环境变量:
  在/etc/profile最后添加以下几行:
  export JAVA_HOME=/opt/study/linux/javaArchive/6u31/jdk1.6.0_31
    export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
    export PATH=$PATH:$JAVA_HOME/bin
 2.安装adt-bundle
   unzip adt-bundle-linux-x86_64-20130522.zip -d /home/zl/androidAPP/
    环境变量:
   在/etc/environment中的PATH变量加入两路径:
    “/home/zl/androidAPP/adt-bundle-linux-x86_64-20130522/sdk/tools”
    “/home/zl/androidAPP/adt-bundle-linux-x86_64-20130522/sdk/platform-tools”
  下载SDK工具:
  运行/home/zl/androidAPP/adt-bundle-linux-x86_64-20130522/sdk/tools目录下的“android”工具
  ./android
    如果网速够快!把自己认为需要的都下载下来吧!

四.新建一Android Virtual Device Manager
    new->..->具体的,看网络上的视频教程。

五.运行HelloWorld实例
  1.运行/home/zl/androidAPP/adt-bundle-linux-x86_64-20130522/eclipse/目录下的eclipse
  ./eclipse
   2.新建一个project
    new(最左上角)->Android Application Project->next->..->一路next即可
  3.运行
  "右击helloworld"->"Run As"->"Android Aplication"
六.瞎折腾
  首要目标只想让helloworld跑起来。下面两个郁闷的原因
  新建一个helloworld工程后,"右击helloworld"->"Run As"->"Android Aplication" ... 居然100多个错误!
  几番折腾不治,重新新建AVD,重新新建project并且注意到API level的一致性:将新建AVD时的Target选择Android 2.1 API Level 7,将新建Android Application的"Minimum Required SDK","Target SDK","Compile With",全部选择“API 7: Android 2.1(Eclair)”
    重新"右击helloworld"->"Run As"->"Android Aplication" ...仍有一个错误“AndroidManifest.xml file missing”但helloworld目录下有此文件,几番google仍没能解决。想起曾经在网络上看到的一个修复project的办法,抱着死马当活马医的态度:右击helloworld"->"Android Tools"->"Fix Project Properties"
   再次试运行之:"右击helloworld"->"Run As"->"Android Aplication"! helloworld终于现身

阅读(5376) | 评论(11) | 转发(1) |
给主人留下些什么吧!~~