編輯:關於Android編程
Android ApiDemos示例解析(199):總結
前面基本介紹完Android ApiDemos中除與OpenGL ES相關的所有示例,
ApiDemo詳細介紹了Android平台主要API,分成了
App
Content
Graphics
Media
OS
Text
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/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/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
另外提供了Android ApiDemos 索引頁面
注: Android 4.x 增加了一些ApiDemos例子並重新分類,後面將陸續補充這些新增加的實例解析
Accessibility分類
Accessibility Node Querying示例解析
Accessibility Service示例解析
Custom View示例解析
Animation分類
Bouncing Balls示例解析
Cloning示例解析
Custom Evaluator示例解析
Default Layout Animations示例解析
Events示例解析
Hide-Show Animations示例解析
Layout Animations示例解析
Loading示例解析
Multiple Properties示例解析
Reversing示例解析
Seeking示例解析
View Flip示例解析
App分類
Action Bar示例
Action Bar Mechanics示例解析
Action Bar Tabs示例解析
Action Bar Usage示例解析
Settings Action Provider示例解析
Share Action Provider示例解析
Display Options示例解析
Activity示例
Animation示例解析
Custom Dialog示例解析
Custom Title示例解析
Dialog示例解析
Forwarding示例解析
Hello World示例解析
Intent Activity Flags示例解析
Intents示例解析
Persistent State示例解析
QuickContactsDemo示例解析
Receive Result示例解析
Recreate示例解析
Redirection示例解析
Reorder Activities示例解析
Save & Restore State示例解析
Screen Orientation示例解析
SetWallpaper示例解析
Soft Input Modes示例解析
Translucent Blur示例解析
Translucent示例解析
Wallpaper示例解析
Alarm示例
Alarm Controller示例解析
Alarm Service示例解析
Alert Dialogs示例解析
Device Admin示例解析
Fragment示例
Alert Dialog示例解析
Arguments示例解析
Context Menu示例解析
Custom Animations示例解析
Dialog or Activity示例解析
Dialog示例解析
Hide and Show示例解析
Layout示例解析
List Array示例解析
Menu示例解析
Receive Result示例解析
Retain Instance示例解析
Stack示例解析
Tabs示例解析
Launcher Shortcuts示例解析
Loader示例
Cursor示例解析
Custom示例解析
Throttle示例解析
Menu示例
Inflate from XML示例解析
Notification示例
IncomingMessage示例解析
Notifying Service Controller示例解析
NotifyWithText示例解析
Status Bar示例解析
Search示例
Invoke Search示例解析
Query Search Results示例解析
Service示例
Foreground Service Controller示例解析
Local Service Binding示例解析
Local Service Controller示例解析
Messenger Service示例解析
Remote Service Binding Options示例解析
Remote Service Binding示例解析
Remote Service Controller示例解析
Service Start Arguments Controller示例解析
Text-To-Speech示例解析
Voice Recognition示例解析
Content分類
Assets示例
Read Asset示例解析
Clipboard示例
Data Types示例解析
Packages示例
Install Apk示例解析
Provider示例
Pick Contact示例解析
Resources示例
Layout Reference示例解析
Resources示例解析
Smallest Width示例解析
Styled Text示例解析
Width and Height示例解析
Storage示例
External Storage示例解析
Graphics分類
AlphaBitmap示例解析
AnimateDrawables示例解析
Arcs示例解析
BitmapDecode示例解析
BitmapMesh示例解析
BitmapPixels示例解析
CameraPreview示例解析
Clipping示例解析
ColorFilters示例解析
ColorMatrix示例解析
Compass示例解析
CreateBitmap示例解析
Density示例解析
Drawable示例
GradientDrawable示例解析
ShapeDrawable示例解析
FingerPaint示例解析
Layers示例解析
MeasureText示例解析
OpenGL ES示例
Compressed Texture示例解析
Cube Map示例解析
Frame Buffer Object示例解析
GLSurfaceView示例解析
Kube示例解析
Matrix Palette Skinning示例解析
OpenGL ES 2.0示例解析
Sprite Text示例解析
Textured Triangle示例解析
Touch Rotate示例解析
Translucent GLSurfaceView示例解析
PathEffects示例解析
PathFillTypes示例解析
Patterns示例解析
Pictures示例解析
Points示例解析
PolyToPoly示例解析
PurgeableBitmap示例
NonPurgeable示例解析
Purgeable示例解析
Regions示例解析
RoundRects示例解析
ScaleToFit示例解析
SensorTest示例解析
Surface Window示例解析
SurfaceView Overlay示例解析
Sweep示例解析
Text Align示例解析
Touch Paint示例解析
Typefaces示例解析
UnicodeChart示例解析
Vertices示例解析
Xfermodes示例解析
Media分類
AudioFx示例解析
MediaPlayer示例解析
VideoView示例解析
NFC分類
ForegroundDispatch示例解析
ForegroundNdefPush示例解析
TechFilter示例解析
OS分類
Morse Code示例解析
Rotation Vector示例解析
Sensors示例解析
SMS Messaging示例解析
Preference分類
1. Preferences from XML示例解析
2. Launching preferences示例解析
3. Preference dependencies示例解析
4. Default values示例解析
5. Preferences from code示例解析
6. Advanced preferences示例解析
7. Fragment示例解析
8. Headers示例解析
9. Switch示例解析
Text分類
Linkify示例解析
LogTextBox示例解析
Marquee示例解析
Layouts分類
Baseline示例
1. Top示例解析
2. Bottom示例解析
3. Center示例解析
4. Everywhere示例解析
5. Multi-line示例解析
6. Relative示例解析
Nested Example 1示例解析
Nested Example 2示例解析
Nested Example 3示例解析
GridLayout示例
0. Simple Form (Java)示例解析
1. Simple Form (XML)示例解析
HorizontalScrollView示例解析
LinearLayout示例
1. Vertical示例解析
2. Vertical (Fill Screen)示例解析
3. Vertical (Padded)示例解析
4. Horizontal示例解析
5. Simple Form示例解析
6. Uniform Size示例解析
7. Fill Parent示例解析
8. Gravity示例解析
9. Layout Weight示例解析
10. Background Image示例解析
RelativeLayout示例
1. Vertical示例解析
2. Simple Form示例解析
ScrollView示例
1. Short示例解析
2. Long示例解析
3. Internal Selection示例解析
TableLayout示例
01. Basic示例解析
02. Empty Cells示例解析
03. Long Content示例解析
04. Stretchable示例解析
05. Spanning and Stretchable示例解析
06. More Spanning and Stretchable示例解析
07. Column Collapse示例解析
08. Toggle Stretch示例解析
09. Toggle Shrink示例解析
10. Simple Form示例解析
11. Gravity示例解析
12. Cell Spanning示例解析
Views分類
Animation示例
3D Transition示例解析
Interpolators示例解析
Push示例解析
Shake示例解析
Auto Complete示例
1. Screen Top示例解析
2. Screen Bottom示例解析
3. Scroll示例解析
4. Contacts示例解析
5. Contacts with Hint示例解析
6. Multiple items示例解析
Buttons示例解析
Chronometer示例解析
Controls示例
1. Light Theme示例解析
2. Dark Theme示例解析
3. Holo Light Theme示例解析
4. Holo Dark Theme示例解析
5. Custom Theme示例解析
6. Holo or Old Theme示例解析
Custom示例解析
Date Widgets示例
1. Dialog示例解析
2. Inline示例解析
Drag and Drop示例解析
Expandable Lists示例
1. Custom Adapter示例解析
2. Cursor (People)示例解析
3. Simple Adapter示例解析
Focus示例
1. Vertical示例解析
2. Horizontal示例解析
3. Circular示例解析
4. Internal Selection示例解析
5. Sequential (Tab Order)示例解析
Full Screen Modes示例解析
Gallery示例
1. Photos示例解析
2. People示例解析
Game Controller Input示例解析
Grid示例
1. Icon Grid示例解析
2. Photo Grid示例解析
3. Selection Mode示例解析
Hover Events示例解析
ImageButton示例解析
ImageSwitcher示例解析
ImageView示例解析
Layout Animation示例
1. Grid Fade示例解析
2. List Cascade示例解析
3. Reverse Order示例解析
4. Randomize示例解析
5. Grid Direction示例解析
6. Wave Scale示例解析
7. Nested Animations示例解析
Lists示例
01. Array示例解析
02. Cursor (People)示例解析
03. Cursor (Phones)示例解析
04. ListAdapter示例解析
05. Separators示例解析
06. ListAdapter Collapsed示例解析
07. Cursor (Phones)示例解析
08. Photos示例解析
09. Array (Overlay)示例解析
10. Single choice list示例解析
11. Multiple choice list示例解析
12. Transcript示例解析
13. Slow Adapter示例解析
14. Efficient Adapter示例解析
15. Selection Mode示例解析
16. Border selection mode示例解析
17. Activate items示例解析
Popup Menu示例解析
Progress Bar示例
1. Incremental示例解析
2. Smooth示例解析
3. Dialogs示例解析
4. In Title Bar示例解析
Radio Group示例解析
Rating Bar示例解析
Rotating Button示例解析
ScrollBars示例
1. Basic示例解析
2. Fancy示例解析
3. Style示例解析
Search View示例
Action Bar示例解析
Always Expanded示例解析
Filter示例解析
Secure View示例解析
Seek Bar示例解析
Spinner示例解析
Splitting Touches across Views示例解析
Switches示例解析
Tabs示例
1. Content By Id示例解析
2. Content By Factory示例解析
3. Content By Intent示例解析
4. Non Holo theme示例解析
5. Scrollable示例解析
6. Right aligned示例解析
TextSwitcher示例解析
Visibility示例解析
WebView示例解析
在Android下,事件的發生是在監聽器下進行,android系統可以響應按鍵事件和觸摸屏事件,本文主要介紹了button點擊事件的方法一、實現button點
效果圖: public SimpleAdapter(Context context, List extends Map data, int resou
簡介:基本概念:Service是Android四大組件之一,運行在後台執行耗時操作並且不提供用戶界面。其他組件(如Activity)可以通過startService啟動該
Starting an Activity 開啟一個ActivityThis lesson teaches you to 這節課教給你Understand the Life
最近更新了一下Android Studio,在導入新項目之後出現Erro