Crazy android Handouts
Crazy comes from dreams
Brilliant Technological Achievements
Basic Information
Author:Li Gang
Press: Electronic Industry Press
ISBN:9787121135767
Mounting time:
Published on: February 1, July 2011
Http://product.china-pub.com/193974
Online reading of crazy android Handouts
Introduction
Computer portability is the future development trend. As one of the most popular mobile phone and tablet operations, Android is becoming increasingly popular. Android applications use Java as their development language, which is also an excellent opportunity for Java.
The crazy android handout comprehensively introduces the knowledge of Android Application Development. The book covers Android User Interface Programming, four Android components,
Android resource access, graphics/image processing, event processing, Android input/output processing, audio/video multimedia application development, OpenGL and 3D application development, and network communication
Information programming, Android platform Web Service, sensor application development, GPS application development, Google map service, etc.
The crazy android handout is not limited to introducing various theoretical knowledge about Android programming, but to teaching the theory from the perspective of "project-driven". The book contains nearly a hundred examples.
Instances can help readers better understand the application of various knowledge points in actual development, and can also be used as a reference and reference for actual development. The crazy android handout also provides two practical
Case: The Android client of the crazy serialization and electronic auction system has extremely high reference value. Crazy android handout provides a supporting Q & A website.
Android handouts "encountered technical problems, you can log on to the crazy Java Alliance (http://www.crazyit.org) post, the author will promptly answer.
Crazy android handout is suitable for readers who have certain Java programming basics. If you are familiar with Java programming syntax and have some graphic interface programming experience, read crazy
Android handouts are suitable. Otherwise, we recommend that you carefully read the crazy Java handout of the crazy java system before reading the crazy android handout.
Directory
Crazy android handout
Chapter 2 Android applications and development environment 1
1.1 Android development and History 2
1.1.1 Development and introduction of Android 2
1.1.2 architecture and feature 3 of the Android platform
1.2 build an android Development Environment 5
1.2.1 download and install Android SDK 5
1.2.2 install eclipse and ADT plug-in 7
1.3 usage of common android development tools 10
1.3.1 create, delete, and browse AVD 10
1.3.2 use the android Simulator
(Emulator) 14
1.3.3 use ddms for debugging 15
1.3.4 Android debug bridge (ADB)
Usage 16
1.3.5 use dx to compile Android app 18
1.3.6 use Android asset Packaging
Tool (aapt) package resources 19
1.3.7 use mksdcard to manage virtual SD card 19
1.4 first Android app 20
. 1.4.1 use eclipse to develop the first
Android app 20
1.4.2 run Android app through ADT 23
1.5 Android Application structure analysis 24
1.5.1 create an Android app 24
1.5.2 automatically generated R. Java 26
1.5.3 res directory description 27
1.5.4 list file of the Android Application:
Androidmanifest. xml 28
1.5.5 application permission description 29
1.6 Basic Components of Android applications
Introduction 31
1.6.1 activity and view 31
1.6.2 service 32
1.6.3 broadcastreceiver 32
1.6.4 contentprovider 32
1.6.5 intent and intentfilter 33
1.7 chapter 33
Chapter 5 Interface Programming for Android applications 35
2.1 Interface Programming and view component 36
2.1.1 view components and container components 36
2.1.2 use XML layout file to control the UI
Interface 40
2.1.3 control UI in Code 41
2.1.4 use XML layout file and Java
Code mixed control UI interface 42
2.1.5 Develop custom view 43
2.2 layout manager 46
2.2.1 linear layout 47
2.2.2 table layout 49
2.2.3 frame layout 52
2.2.4 relative layout 55
2.2.5 absolute layout 58
2.3 Basic interface component 60
2.3.1 text box (textview) and edit box
(Edittext) Functions and usage 60
2.3.2 functions and
Usage 66
2.3.3 use a 9patch image as the button Background 68
2.3.4 radio button (radiobutton) and check
Box (checkbox) introduction and application 69
2.3.5 status switch button (togglebutton)
Functions and usage 71
2.3.6 clock (analogclock and digital
Clock) Functions and techniques 73
2.3.7 Image view
Functions and usage 75
2.4 Advanced Interface Component 79
2.4.1 automatically complete
Functions and usage 79
2.4.2 functions and usage of the spinner 80
2.4.3 Date and Time selector (datepicker
And timepicker) Functions and usage 83
2.4.4 progress bar
Functions and usage 85
2.4.5 functions and
Usage 90
2.4.6 rating bar (ratingbar)
Functions and usage 91
2.4.7 tab (tabhost) Functions and
Usage 93
2.4.8
Functions and usage 95
2.4.9 List View (listview and
Listactivity) 95
2.4.10 expanded list component (expandablelistview) 101
2.4.11 grid view (gridview) and
Imageswitcher)
Features and usage 104
2.4.12 functions and
Usage 107
2.5 Dialog Box 110
2.5.1 simple creation using alertdialog
Dialog 110
2.5.2 use alertdialog to create a list
Dialog 112
2.5.3 use alertdialog to create a custom
Dialog 116
2.5.4 use popupwindow 121
2.5.5 use datepickerdialog and timepickerdialog 123
2.5.6 use progressdialog to create progress
Dialog 125
2.6 message 127
2.6.1 use toast to display the prompt box 128
2.6.2 functions and usage of notification 129
2.7 menu 132
2.7.1 option menu and sub menu
(Submenu) 132
2.7.2 use a listener to listen to menu events 136
2.7.3 create check menu items and single-choice menu items 137
2.7.4 set activity 140 associated with the menu item
2.7.5 context menu 141
2.8 summary of this Chapter 143
Chapter 1 event handling 3rd
3.1 Android event handling 145
3.2 listener-based event handling 145
3.2.1 event monitoring processing model 145
3.2.2 event and event listener 148
3.2.3 internal class as event listener class 151
3.2.4 external Class As event listener class 152
3.2.5 activity itself serves as the event listener 153
3.2.6 anonymous internal class as event listener 154
3.2.7 bind directly to tag 155
3.3 callback-based event processing 156
3.3.1 callback and listener 156
3.3.2 callback-based event propagation 158
3.3.3 override ontouchevent method response
Touch screen event 160
3.4 system-set events responded 162
3.4.1 configuration 162
3.4.2 override onconfigurationchanged
164 response to system settings change
3.5 handler message transmission mechanism 166
3.5.1 handler class Introduction 166
3.5.2 handler Use Case 167
3.6 summary of this chapter 168
Chapter 2 deep understanding of activity 4th
4.1 create, configure, and use activity 170
4.1.1 establish activity 170
4.1.2 configure the activity 177
4.1.3 Start and Stop activity 179
4.1.4 use bundle between activities
Exchange data 181
4.1.5 start other activities and return result 185
4.2 activity callback mechanism 189
4.3 activity lifecycle 190
4.3.1 activity lifecycle demonstration 190
4.3.2 similarity and
Difference 194
4.4 summary of this chapter 195
Chapter 2 Use intent and intentfilter
Chapter 1 Communication 5th
5.1 intent object details 197
5.1.1 use intent to start system components 197
5.2 intent attributes and intent-Filter
Configure 198
5.2.1 Component Property 198
5.2.2 action, category attributes and
Configure intent-filter 200
5.2.3 specify action and category call
System activity 204
5.2.4 data and type attributes and intent-Filter
Configure 209
5.2.5 extra property 211
5.3 use intent to create a tab page 211
5.4 summary of this Chapter 212
Chapter 2 Android Application resources 6th
6.1 Resource types and storage methods 214
6.1.1 resource type and storage method 214
6.1.2 use resource 216
6.2 use strings, colors,
Size resource 217
6.2.1 definition of color value 217
6.2.2 define strings, colors, and size Resources
File 218
6.2.3 use strings, colors,
Size resource 219
6.3 array resources 222
6.4 Use (drawable) Resource 225
6.4.1 image resources 225
6.4.2 statelistdrawable resource 225
6.4.3 layerdrawable resource 227
6.4.4 shapedrawable resource 229
6.4.5 clipdrawable resource 231
6.4.6 animationdrawable resource 233
6.5 use the original XML resource 236
6.5.1 define the original XML resource 236
6.5.2 use the original XML file 237
6.6 use layout resources 239
6.7 use menu resources 239
6.7.1 define menu resource 239
6.7.2 use menu resource 240
6.8 style and theme)
Resource 243
6.8.1 style resource 243
6.8.2 theme resource 245
6.9 attribute resource 247
6.10 use original resource 249
6.11 internationalization and Resource Adaptation 251
6.11.1 idea of Java internationalization 252
6.11.2 languages and countries supported by Java 252
6.11.3 completion program internationalization 253
6.11.4 provides internationalization for Android apps
Resource 255
6.11.5 International Android app 256
6.12 summary of this chapter 258
Chapter 2 graphics and image processing 7th
7.1 use simple images 260
7.1.1 use drawable object 260
7.1.2 bitmaps and bitmapfactory 260
7.2 plot 263
7.2.1 Android plotting basics: canvas,
Paint and other 263
7.2.2 path 267
7.2.3 draw game animation 270
7.3 graphic effects processing 278
7.3.1 use matrix to control transformation 278
7.3.2 use drawbitmapmesh Distortion
Image 282
7.3.3 use shader to fill the image 285
7.4 frame-by-frame animation 288
7.4.1 animationdrawable and frame-by-frame
Animation 288
7.5 tween animation 292
7.5.1 tween animation and interpolator 292
7.5.2 position, size, rotation, transparency
Changed compensation animation 293
7.5.3 custom compensation animation 298
7.6 use surfaceview for animation 300
7.6.1 surfaceview plotting 301
7.7 Summary of this Chapter 305
Chapter 2 Android data storage and IO 8th
8.1 use sharedpreferences 307
8.1.1 sharedpreferences and Editor
Introduction 307
8.1.2 storage of sharedpreferences
Position and format 308
8.1.3 Read and Write Other applications shared
Preferences 310.
8.2 file storage 311
8.2.1 openfileoutput and open
Fileoutput 312
8.2.2 Read and Write files on the SD card 314
8.3 SQLite database 321
8.3.1 sqlitedatabase 321
8.3.2 create a database and a table 323
8.3.3 use SQL statements to operate SQLite
Database 323
8.3.4 use sqlite3 tool 325
8.3.5 use specific methods to operate SQLite
Database 327
8.3.6 transaction 329
8.3.7 sqliteopenhelper class 330
8.4 gesture 335
8.4.1 gesture detection 335
8.4.2 increase gesture 342
8.4.3 recognition of user gestures 346
8.5 automatic reading (TTS) 347
8.6 summary of this chapter 350
Chapter 2 using contentprovider
Chapter 4 data sharing 9th
9.1 data sharing standards:
Contentprovider introduction 352
9.1.1 contentprovider description 352
9.1.2 URI introduction 353
9.1.3 use contentresolver
Data 354
9.2 operating system contentprovider 355
9.2.1 use contentprovider for management
Contact 355
9.2.2 use contentprovider for management
Multimedia 360
9.3 implement contentprovider 364
9.3.1 create contentprovider step 364
9.4 listen to contentprovider data
Change 370
9.4.1 contentobserver profile 370
9.5 summary of this chapter 372
Chapter 2 service and broadcast
Chapter 2 faster er 10th
10.1 service Introduction 374
10.1.1 create and configure service 374
10.1.2 start and stop the service 376
10.1.3 bind a local service
Communication 377
10.1.4 service lifecycle 381
10.2 cross-process service calling
(Aidl Service) 382
10.2.1 aidl service Introduction 382
10.2.2 create aidl file 383
10.2.3 expose the interface to client 383
10.2.4 client access aidlservice 385
10.3 Phone Manager
(Telephonymanager) 393
10.4 SMS Manager (smsmanager) 400
10.5 audio manager
(Audiomanager) 404
10.5.1 introduction to audiomanager 404
10.6 vibrator (vibrator) 407
10.6.1 vibrator Introduction 407
10.6.2 use vibrator to control the mobile phone vibration 407
10.7 mobile alarm service
(Alarmmanager) 408
10.7.1 alarmmanager introduction 408
10.7.2 set the alarm to 409
10.8 receive broadcast messages 413
10.8.1 broadcastreceiver introduction 413
10.8.2 send broadcast 414
10.8.3 broadcast order 416
10.9 receive system broadcast messages 424
10.10 summary of this Chapter 427
Chapter 2 Multimedia Application Development 11th
11.1 audio and video playback 429
11.1.1 use mediaplayer to play audio 429
11.1.2 use soundpool to play sound 432
11.1.3 use videoview to play video 435
11.1.4 use mediaplayer and
Surfaceview video 436
11.2 use mediarecorder for recording
Audio 439
11.3 Control Camera Photo 442
11.3.1 photograph via camera 442
11.3.2 video clip 446
11.4 summary of this chapter 450
Chapter 2 OpenGL and 3D Application Development 12th
12.1 3D image and 3D Development
452 basic knowledge
12.2 introduction to OpenGL and OpenGL ES 453
12.3 draw 2D images 454
12.3.1 used in Android applications
OpenGL ES 454
12.3.2 draw a polygon 457 on the plane
12.3.3 rotate 463
12.4 draw 3D images 465
12.4.1 construct 3D image 465
12.4.2 apply texture map 469
12.5 summary of this Chapter 475
Chapter 2 network applications of Android 13th
13.1 TCP-based network communication 477
13.1.1 TCP 477
13.1.2 create using serversocket
TCP server 478
13.1.3 use socket for communication 479
13.1.4 add multithreading 483
13.2 use a URL to access network resources 488
13.2.1 use a URL to read Network Resources 489
13.2.2 use urlconnection
Submit request 490
13.3 Use http to access the network 496
13.3.1 use httpurlconnection 496
13.3.2 use Apache httpclient 501
13.4 use webview
Display webpage 505
13.4.1 use webview to browse Web page 506
13.4.2 use webview to load HTML
Code 507:
13.5 use Web Service
Network Programming 508
13.5.1 introduction to Web Service 509
13.5.2 Web Service Platform overview 510
13.5.3 use the Android app to call
Web Service 512
13.6 Summary of this Chapter 524
Chapter 4 Management of Android mobile desktop 14th
14.1 manage mobile desktop 526
14.1.1 Delete desktop components 526
14.1.2 add desktop components 526
14.2 change mobile phone wallpaper 527
14.2.1 develop live wallpapers
(Live wallpapers) 528
14.3 Desktop shortcuts 532
14.3.1 create shortcuts on the desktop 532
14.3.2 add shortcuts to launcher 534
14.4 manage desktop widgets 535
14.5 livefolder 539
14.5.1 use real-time folder display
Contentprovider data 540
14.6 summary of this chapter 545
Chapter 2 sensor application development 15th
15.1 use Android sensors 547
15.1.1 development of sensor applications 547
15.1.2 download and install sensorsimulator 549
15.1.3 developed using sensorsimulator
Sensor Application 551
15.2 common android sensors 553
15.2.1 orientation 553
15.2.2 Magnetic Field Sensor magnetic field 554
15.2.3 temperature sensor temperature 554
15.2.4 light 554
15.2.5 pressure sensor pressure 554
15.3 sensor application cases 557
15.4 summary of this chapter 564
Chapter 2 GPS application development 16th
16.1 core APIs supporting GPS 566
16.2 obtain locationprovider 568
16.2.1 obtain all available
Locationprovider 568
16.2.2 get the specified name by name
Locationprovider 569
16.2.3 obtained based on criteria
Locationprovider 569
16.3 obtain location information 570
16.3.1 send GPS information 571 through Simulator
16.3.2 obtain positioning data 571
16.4 approaching warning 573
16.5 summary of this Chapter 575
Chapter 4 use Google map 17th
17.1 prepare for calling Google map 577
17.1.1 obtain map API key 577
17.1.2 create a project that supports the Google map API
AVD 580
17.2 Map Based on GPS information
Positioning 582
17.3 GPS navigation 588
17.4 locate 590 by address
17.4.1 address parsing and reverse address parsing 590
17.4.2 locate 595 Based on the address
17.5 summary of this chapter 597
Chapter 2 crazy connection 18th
18.1 connected video game introduction 599
18.2 develop game interface 600
18.2.1 development interface layout 600
18.2.2 develop game interface component 601
18.2.3 connection line between processing blocks 605
18.3 connection status data model 606
18.3.1 define data model 606
18.3.2 initialize game status 606
18.4 load the image of the interface 610
18.5 game activity 612
18.6 game logic 618
18.6.1 define gameservice Component Interface 618
18.6.2 implement the gameservice component 619
18.6.3 get the square 620 of the touch point
18.6.4 determine whether two squares can be connected. 622
18.6.5 define a tool for obtaining a channel 623
18.6.6 horizontal connections without turning points 625
18.6.7 longitudinal connections without turning points 626
18.6.8 connections at a turning point 626
18.6.9 connections at two turning points 629
18.6.10 find the shortest distance of 636
18.7 summary of this chapter 638
Chapter 2 electronic auction system 19th
19.1 system function introduction and Architecture Design 640
19.1.1 system functions 640
19.1.2 System Architecture Design 641
19.2 JSON introduction 643
19.2.1 create an object using JSON syntax 643
19.2.2 use JSON syntax to create array 644
19.2.3 Java JSON 645
19.3 tools for sending requests 646
19.4 User Login 647
19.4.1 process login servlet 648
19.4.2 User Login 649
19.5 view streaming items 655
19.5.1 servlet 655 for viewing streaming items
19.5.2 view streaming object 656
19.6 manage item categories 661
19.6.1 servlet 661 for viewing item types
19.6.2 view item type 662
19.6.3 Add a type of servlet 666
19.6.4 add item Category 666
19.7 manage auction items 668
19.7.1
Servlet 668
19.7.2 view your auction items 669
19.7.3 Add the servlet 672 for the auction
19.7.4 add an auction item 673
19.8 participate in bidding 678
19.8.1 select item type 678
19.8.2 servlet 680
19.8.3 view items by category 680
19.8.4 servlet 682
19.8.5 participate in bidding 683
19.9 permission control 688
19.10 summary of this chapter 689