Android ApiDemo示例工程的创建

一般SDK中都会带有一些示例程序,说明具体用法,Android SDK也是如此。它提供了一些ApiDemo示例,详细说明了Android中主要API,分为以下几大类:

       1、App

       2、Content

       3、Graphics

       4、Media

       5、OS

       6、Text

       7、Views

每个大类又分为几个小类,一共大约有200多个实例,涵盖了Android OS API的各个方面。下面是所有示例的列表:

App/Activity/Animation
App/Activity/Custom Dialog
App/Activity/Custom Title
App/Activity/Dialog
App/Activity/Forwarding
App/Activity/Hello World
App/Activity/Persistent State
App/Activity/QuickContactsDemo
App/Activity/Receive Result
App/Activity/Redirection
App/Activity/Reorder Activities
App/Activity/Save & Restore State
App/Activity/SetWallpaper
App/Activity/Translucent
App/Activity/Translucent Blur
App/Activity/Wallpaper
App/Alarm/Alarm Controller
App/Alarm/Alarm Service
App/Device Admin
App/Dialog
App/Intents
App/Launcher Shortcuts
App/Menu/Inflate from XML
App/Notification/IncomingMessage
App/Notification/Notifying Service Controller
App/Notification/NotifyWithText
App/Notification/Status Bar
App/Preferences/1. Preferences from XML
App/Preferences/2. Launching preferences
App/Preferences/3. Preference dependencies
App/Preferences/4. Default values
App/Preferences/5. Preferences from code
App/Preferences/6. Advanced preferences
App/Search/Invoke Search
App/Search/Query Search Results
App/Service/Foreground Service Controller
App/Service/Local Service Binding
App/Service/Local Service Controller
App/Service/Messenger Service
App/Service/Remote Service Binding
App/Service/Remote Service Controller
App/Service/Service Start Arguments Controller
App/Text-To-Speech
App/Voice Recognition
Content/Assets/Read Asset
Content/Resources/Resources
Content/Resources/Styled Text
Content/Storage/External Storage
Graphics/AlphaBitmap
Graphics/AnimateDrawables
Graphics/Arcs
Graphics/BitmapDecode
Graphics/BitmapMesh
Graphics/BitmapPixels
Graphics/CameraPreview
Graphics/Clipping
Graphics/ColorFilters
Graphics/ColorMatrix
Graphics/Compass
Graphics/CreateBitmap
Graphics/Density
Graphics/Drawable/GradientDrawable
Graphics/Drawable/ShapeDrawable
Graphics/FingerPaint
Graphics/Layers
Graphics/MeasureText
Graphics/OpenGL ES/Compressed Texture
Graphics/OpenGL ES/Cube Map
Graphics/OpenGL ES/Frame Buffer Object
Graphics/OpenGL ES/GLSurfaceView
Graphics/OpenGL ES/Kube
Graphics/OpenGL ES/Matrix Palette Skinning
Graphics/OpenGL ES/OpenGL ES 2.0
Graphics/OpenGL ES/Sprite Text
Graphics/OpenGL ES/Textured Triangle
Graphics/OpenGL ES/Touch Rotate
Graphics/OpenGL ES/Translucent GLSurfaceView
Graphics/PathEffects
Graphics/PathFillTypes
Graphics/Patterns
Graphics/Pictures
Graphics/Points
Graphics/PolyToPoly
Graphics/PurgeableBitmap/NonPurgeable
Graphics/PurgeableBitmap/Purgeable
Graphics/Regions
Graphics/RoundRects
Graphics/ScaleToFit
Graphics/SensorTest
Graphics/SurfaceView Overlay
Graphics/Sweep
Graphics/Text Align
Graphics/Touch Paint
Graphics/Typefaces
Graphics/UnicodeChart
Graphics/Vertices
Graphics/Xfermodes
Media/MediaPlayer
Media/VideoView
OS/Morse Code
OS/Sensors
OS/SMS Messaging
Text/Linkify
Text/LogTextBox
Text/Marquee
Views/Animation/3D Transition
Views/Animation/Interpolators
Views/Animation/Push
Views/Animation/Shake
Views/Auto Complete/1. Screen Top
Views/Auto Complete/2. Screen Bottom
Views/Auto Complete/3. Scroll
Views/Auto Complete/4. Contacts
Views/Auto Complete/5. Contacts with Hint
Views/Auto Complete/6. Multiple items
Views/Buttons
Views/Chronometer
Views/Controls/1. Light Theme
Views/Controls/2. Default Theme
Views/Custom
Views/Date Widgets/1. Dialog
Views/Date Widgets/2. Inline
Views/Expandable Lists/1. Custom Adapter
Views/Expandable Lists/2. Cursor (People)
Views/Expandable Lists/3. Simple Adapter
Views/Focus/1. Vertical
Views/Focus/2. Horizontal
Views/Focus/3. Circular
Views/Focus/4. Internal Selection
Views/Gallery/1. Photos
Views/Gallery/2. People
Views/Grid/1. Icon Grid
Views/Grid/2. Photo Grid
Views/ImageButton
Views/ImageSwitcher
Views/ImageView
Views/Layout Animation/1. Grid Fade
Views/Layout Animation/2. List Cascade
Views/Layout Animation/3. Reverse Order
Views/Layout Animation/4. Randomize
Views/Layout Animation/5. Grid Direction
Views/Layout Animation/6. Wave Scale
Views/Layout Animation/7. Nested Animations
Views/Layouts/Baseline/1. Top
Views/Layouts/Baseline/2. Bottom
Views/Layouts/Baseline/3. Center
Views/Layouts/Baseline/4. Everywhere
Views/Layouts/Baseline/5. Multi-line
Views/Layouts/Baseline/6. Relative
Views/Layouts/Baseline/Nested Example 1
Views/Layouts/Baseline/Nested Example 2
Views/Layouts/Baseline/Nested Example 3
Views/Layouts/LinearLayout/1. Vertical
Views/Layouts/LinearLayout/10. Background Image
Views/Layouts/LinearLayout/2. Vertical (Fill Screen)
Views/Layouts/LinearLayout/3. Vertical (Padded)
Views/Layouts/LinearLayout/4. Horizontal
Views/Layouts/LinearLayout/5. Simple Form
Views/Layouts/LinearLayout/6. Uniform Size
Views/Layouts/LinearLayout/7. Fill Parent
Views/Layouts/LinearLayout/8. Gravity
Views/Layouts/LinearLayout/9. Layout Weight
Views/Layouts/RelativeLayout/1. Vertical
Views/Layouts/RelativeLayout/2. Simple Form
Views/Layouts/ScrollView/1. Short
Views/Layouts/ScrollView/2. Long
Views/Layouts/ScrollView/3. Internal Selection
Views/Layouts/TableLayout/01. Basic
Views/Layouts/TableLayout/02. Empty Cells
Views/Layouts/TableLayout/03. Long Content
Views/Layouts/TableLayout/04. Stretchable
Views/Layouts/TableLayout/05. Spanning and Stretchable
Views/Layouts/TableLayout/06. More Spanning and Stretchable
Views/Layouts/TableLayout/07. Column Collapse
Views/Layouts/TableLayout/08. Toggle Stretch
Views/Layouts/TableLayout/09. Toggle Shrink
Views/Layouts/TableLayout/10. Simple Form
Views/Layouts/TableLayout/11. Gravity
Views/Layouts/TableLayout/12. Cell Spanning
Views/Lists/1. Array
Views/Lists/10. Single choice list
Views/Lists/11. Multiple choice list
Views/Lists/12. Transcript
Views/Lists/13. Slow Adapter
Views/Lists/14. Efficient Adapter
Views/Lists/2. Cursor (People)
Views/Lists/3. Cursor (Phones)
Views/Lists/4. ListAdapter
Views/Lists/5. Separators
Views/Lists/6. ListAdapter Collapsed
Views/Lists/7. Cursor (Phones)
Views/Lists/8. Photos
Views/Lists/9. Array (Overlay)
Views/Progress Bar/1. Incremental
Views/Progress Bar/2. Smooth
Views/Progress Bar/3. Dialogs
Views/Progress Bar/4. In Title Bar
Views/Radio Group
Views/Rating Bar
Views/ScrollBars/1. Basic
Views/ScrollBars/2. Fancy
Views/ScrollBars/3. Style
Views/Seek Bar
Views/Spinner
Views/Tabs/Content By Factory
Views/Tabs/Content By Id
Views/Tabs/Content By Intent
Views/TextSwitcher
Views/Visibility
Views/WebView

本示例解读系列将逐个介绍每个示例中涉及到的知识及相关类的用法.

首先是使用Eclipse创建一个ApiDemo示例工程:File ->New Android Project 选择Create project from existing sample (不同Android版本有对应的ApiDemo示例)。

以上就是对Android  ApiDemo 示例工程的创建,希望能帮助到有需要的小伙伴!

(0)

相关推荐

  • android客户端从服务器端获取json数据并解析的实现代码

    首先客户端从服务器端获取json数据 1.利用HttpUrlConnection 复制代码 代码如下: /**      * 从指定的URL中获取数组      * @param urlPath      * @return      * @throws Exception      */     public static String readParse(String urlPath) throws Exception {                  ByteArrayOutputSt

  • Android 动画之TranslateAnimation应用详解

    android中提供了4中动画: AlphaAnimation 透明度动画效果 ScaleAnimation 缩放动画效果 TranslateAnimation 位移动画效果 RotateAnimation 旋转动画效果 本节讲解TranslateAnimation动画,TranslateAnimation比较常用,比如QQ,网易新闻菜单条的动画,就可以用TranslateAnimation实现, 通过TranslateAnimation(float fromXDelta, float toXD

  • 解决Android SDK下载和更新失败的方法详解

    最近刚换了电脑,开始搭建Android开发环境的时候,下载SDK总是会出现如下错误: 复制代码 代码如下: Failed to fetch URL http://dl-ssl.google.com/android/repository/addons_list-1.xml. 说dl-ssl.google.com在大陆被强了,解决方法就是修改C:\Windows\System32\drivers\etc\hosts文件.添加一行: 复制代码 代码如下: 74.125.237.1       dl-s

  • Android基础之使用Fragment控制切换多个页面

    今天讲解一下Fragment的控制,主要是切换View和页面替换等操作.还有就是如何获取Fragment的管理对象,以及与Activity的通信方式.1.管理Fragment要在activity中管理fragment,需要使用FragmentManager. 通过调用activity的getFragmentManager()取得它的实例. •可以通过FragmentManager做一些事情, 包括: 使用findFragmentById()(用于在activity layout中提供一个UI的f

  • android PopupWindow 和 Activity弹出窗口实现方式

    本人小菜一个.目前只见过两种弹出框的实现方式,第一种是最常见的PopupWindow,第二种也就是Activity的方式是前几天才见识过.感觉很霸气哦.没想到,activity也可以做伪窗口. 先贴上最常见的方法,主要讲activity的方法. 一.弹出PopupWindow 复制代码 代码如下: /** * 弹出menu菜单 */ public void menu_press(){ if(!menu_display){ //获取LayoutInflater实例 inflater = (Layo

  • android压力测试命令monkey详解

    一.Monkey 是什么?Monkey 就是SDK中附带的一个工具. 二.Monkey 测试的目的?:该工具用于进行压力测试. 然后开发人员结合monkey 打印的日志 和系统打印的日志,结局测试中出现的问题. 三.Monkey 测试的特点?Monkey 测试,所有的事件都是随机产生的,不带任何人的主观性. 四.Monkey 命令详解 1).标准的monkey 命令[adb shell] monkey [options] <eventcount> , 例如:adb shell monkey -

  • 六款值得推荐的android(安卓)开源框架简介

    1.volley 项目地址 https://github.com/smanikandan14/Volley-demo (1)  JSON,图像等的异步下载: (2)  网络请求的排序(scheduling) (3)  网络请求的优先级处理 (4)  缓存 (5)  多级别取消请求 (6)  和Activity和生命周期的联动(Activity结束时同时取消所有网络请求) 2.android-async-http 项目地址:https://github.com/loopj/android-asyn

  • 一看就懂的Android APP开发入门教程

    工作中有做过手机App项目,前端和android或ios程序员配合完成整个项目的开发,开发过程中与ios程序配合基本没什么问题,而android各种机子和rom的问题很多,这也让我产生了学习android和ios程序开发的兴趣.于是凌晨一点睡不着写了第一个android程序HelloAndroid,po出来分享给其他也想学习android开发的朋友,这么傻瓜的Android开发入门文章,有一点开发基础的应该都能看懂. 一.准备工作 主要以我自己的开发环境为例,下载安装JDK和Android SD

  • Android应用开发SharedPreferences存储数据的使用方法

    SharedPreferences是Android中最容易理解的数据存储技术,实际上SharedPreferences处理的就是一个key-value(键值对).SharedPreferences常用来存储一些轻量级的数据. 复制代码 代码如下: //实例化SharedPreferences对象(第一步) SharedPreferences mySharedPreferences= getSharedPreferences("test", Activity.MODE_PRIVATE);

  • Android Bitmap详细介绍

    复制代码 代码如下: package com.testbitmapscale; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Iterator; import com.testbitmapscale.R.drawable; im

  • android listview优化几种写法详细介绍

    这篇文章只是总结下getView里面优化视图的几种写法,就像孔乙己写茴香豆的茴字的几种写法一样,高手勿喷,勿笑,只是拿出来分享,有错误的地方欢迎大家指正,谢谢. listview Aviewthatshowsitemsinaverticallyscrollinglist. 一个显示一个垂直的滚动子项的列表视图在android开发中,使用listview的地方很多,用它来展现数据,成一个垂直的视图.使用listview是一个标准的适配器模式,用数据--,界面--xml以及适配器--adapter,

随机推荐