码迷,mamicode.com
首页 > 移动开发 > 详细

Android开发-环境搭建以及HelloWorld

时间:2014-09-09 17:47:59      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   color   io   ar   strong   for   

最近开始进行Android的开发,没有基础完全从0开始。

 

首先,知道Android开发的官方网站:

http://developer.android.com/index.html

网站本身教程非常优秀,建议从0开始的朋友先看这篇文章:

http://developer.android.com/training/index.html

言归正传下面开始介绍环境搭建和HelloWorld

1、环境搭建

   1.下载SDK,参考文章:http://developer.android.com/sdk/index.html

   注意:

      1.如果你没有Eclipse,可以下载集成好的包含Eclipse,SDK,ADT插件的集成包。bubuko.com,布布扣

      2.如果你已经有Eclipse,则在网站上选择:bubuko.com,布布扣,然后下载:bubuko.com,布布扣

2.下载完成之后,需要通过SDK Manager来下载响应的软件包:参考文章 http://developer.android.com/sdk/installing/adding-packages.html

3.下载ADT插件:参考:http://developer.android.com/sdk/installing/installing-adt.html

 

完整的中文参考:http://hi.baidu.com/wlj1013/item/3e6080351168b9302f0f815c

 

2、HelloWorld

参考文章:http://developer.android.com/training/basics/firstapp/index.html

 

过程遇到的问题:

1.eclipse安装ADT插件重启后不显示Android SDK Manager和Android Virtual Device Manager图标的一种解决办法

 

2.Create the Second Activity中提到:

In the window that appears, open theAndroid folder and select Android Activity. Click Next.

 

实际上应该选择:Android Activity with fragment。

3.在创建完成之后的ActionBarActivity缺少引用,需要引用v7包。

具体引用可以参考:https://developer.android.com/tools/support-library/setup.html

但是一定注意一点:必须保证android-support-v7-appcompat跟你的项目在同一个workspace中,并且路径中不能有中文。

4.程序中还是报错:

The method add(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, Fragment, String)

 

原因是类文件引用错误,解决思路:http://stackoverflow.com/questions/15517786/the-method-addint-fragment-string-in-the-type-fragmenttransaction-is-not-app

Android开发-环境搭建以及HelloWorld

标签:android   style   blog   http   color   io   ar   strong   for   

原文地址:http://www.cnblogs.com/sdjnzqr/p/3962721.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!