`
maimode
  • 浏览: 416256 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Android start from now on

阅读更多

从现在起,开始Android!

 

注意:在开始android开发之前,你首先需要具备一定的JavaSE开发经验,先搭建好java开发环境然后再开始。

 

帮助站点:http://developer.android.com/index.html

 

第一步:下载SDK,配置开发环境

 

http://developer.android.com/training/index.html 提供了android开发的全部教程。

 

下载

Android SDK:http://dl.google.com/android/installer_r20.0.3-windows.exe ,然后运行此文件安装SDK。

安装时,请记住安装的位置,后面需要使用。

 

这个sdk只包含了主要部分,其余一些所需的资源(tools,api)需要使用安装完毕的android sdk manager程序区下载。

启动Android SDK Manager

 

安装完毕sdk后在程序中会有此管理器的启动菜单,启动后配置需要下载的包,参见http://developer.android.com/sdk/installing/adding-packages.html

 

必须

SDK Tools

SDK Platform-tools

SDK Platform(至少选择一个 Platform 版本,强烈建议选择最新版本)

可选推荐

System Image

Android Support

SDK Samples

 

安装eclipse plugin

 

Android Development Tools(ADT)是Android开发时的eclipse插件。

eclipse在线安装地址:https://dl-ssl.google.com/android/eclipse/

或者下载离线安装包(http://dl.google.com/android/ADT-20.0.3.zip),然后在eclipse中安装。

 

参考:http://developer.android.com/sdk/installing/installing-adt.html#Configure

 

下载安装完毕后配置此插件

 

在window->preferences中找到android项,配置SDK location,选择刚才安装sdk时的位置。(一般安装完毕插件后自动会识别到sdk的位置,因此这一步只需要确认一下即可)

 

 

至此,开发环境搭建完毕,下一步开始编写第一个app程序。

 

第二部:创建第一个程序

 

参考:http://developer.android.com/training/basics/firstapp/creating-project.html

 

安装成功ADT的eclipse中会有android开发的快捷图标,在工具栏中点击图标创建android项目。

 

填写相关的项目属性,通常情况下使用默认值即可。其中build sdk是指此程序将来运行的目标android版本,minimum required sdk只可运行的最低android版本要求。

 

过程中选择BlankActivity。创建完项目后,可以简单看一下生成了哪些文件。

 

第三部:运行程序,先睹为快!

 

在运行android程序之前需要配置android程序的运行”目标“——模拟器或者实际设备:

a.如果有android设备则直接用USB连接到电脑上,并在系统中打开USB调试模式即可。(第一次连接电脑可能需要安装设备USB驱动,一般os会自动安装驱动)

b.推荐配置AVD(Android Virtual Device),在eclipse中点击图标然后新增avd配置。

 

以上两项任一条件满足即可运行android程序。

 

打开项目任何一个文件或者选中项目,然后点击eclipse的运行图标,接着eclipse会让你选择

运行方式,选择Android Application方式即可运行。

 

注:点击运行图标后,首先会编译项目文件,这个过程中有时候可能会出现提示xxx.out.xml文件格式不正确无法解析的错误(Error in an XML file: aborting build.),经过查询可通过删除报错的文件,然后clean项目、关闭项目、再打开项目来解决。(此问题目前我也还不明确究竟是什么问题)参考http://stackoverflow.com/questions/1674101/android-project-wont-build-when-editing-a-resource-file

 

下面是在模拟器(android4.1)上运行demo截图:

 

 

  • 大小: 3.3 KB
  • 大小: 2.1 KB
  • 大小: 403 Bytes
  • 大小: 99.9 KB
  • 大小: 43.6 KB
  • 大小: 60.7 KB
分享到:
评论

相关推荐

    Reactive Programming on Android with RxJava (2017).pdf

    Android developers who are new to RxJava so that they can start integrating it into their apps. The book is broken into two parts: The 1st part of the book will go through the basics: In Chapter 1, we...

    Android代码-Tux Paint

    At the start this Tux Paint source code was based on tuxpaint-sdl2 maintained by Pere Pujal i Carabantes with head commit b48c069b2ff6a0cabf82ec086ff6ef563eaaf3d3, now it has been synced back and for...

    PS-Phwoar__v1.4_Android_Installer.zip

    installing you can close the server on your phone and from now on PS-Phwoar! will automatically load from your PS4's internal offline cache. If you are having trouble installing the server on your...

    Android Studio Essentials

    4. **Emulator**: The Android emulator is a powerful tool for testing your app on various Android device configurations without needing physical devices. It supports hardware acceleration and can ...

    一本android的好书beginning android 2 和 源码

    And Now, a Word from Our Framework Letting Users Have Their Say Adding a Wee Bit o' Structure The Kind of Pop-Ups You Like ■Chapter 22: Managing and Accessing Local Databases The Database Example A ...

    Mobile Speech Recognizer 1.2

    Click on “Start Recording” button and start talking. You should see live results in text above. Notice that on Android it automatically detects when you stop talking, but it rely on user when it ...

    移植Bluetooth到Android4.0

    4. Now Device is in Flashing mode, We can start nvflash command now. #################################################################################################################################...

    XDA成员开发出Carrier IQ检测程序(Android)

    You will now have access to the menu items to patch logging on the device. Version 5 of pro adds in an option to convert webdb to ...

    softap_ap6212a0_tinav2.1_验证通过_旧版本的系统_20170915_1223没有外层目录.7z

    You're building on Linux Lunch menu... pick a combo: 1. tulip_d1-tina 2. tulip_d1-dragonboard 3. octopus_sch-tina 4. octopus_sch-dragonboard 5. azalea_perf2-tina 6. azalea_perf2-...

    EurekaLog_7.5.0.0_Enterprise

    3)....Fixed: spawned by ecc32/emake processes now start with the same priority 4)....Fixed: ThreadID = 0 in StandardEurekaNotify 5)....Fixed: Dialog auto-close timer may reset without user input 6)......

    apktool documentation

    As you probably know, Android apps utilize code and resources that are found on the Android OS itself. These are known as framework resources and Apktool relies on these to properly decode and build ...

    微软Visual Studio 2017社区版安装文件

    •You can Save All your pending changes before you start your update. •The update dialog provides you even more details about your update during installation. •C# 7.3 is included in Visual Studio ...

    React and React Native [Kindle Edition]

    The first part shows you how to start crafting composable UIs using React, from rendering with JSX and creating reusable components through to routing and creating isomorphic applications that run on ...

    Boost C++ Application Development Cookbook 1st 原版pdf by Polukhin

    I do not know where to start. Boost is huge; I have no time to read all about it." Well, that was a good hint but such a book would be of interest only to beginners. Professionals would find nothing ...

    ViewPager 放大缩小左右移动

    * Value from [0, 1) indicating the offset from the page at * position. * @param positionOffsetPixels * Value in pixels indicating the offset from position. */ public void ...

    hls.min.js

    BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},...

Global site tag (gtag.js) - Google Analytics