Crazy android handout (version 2nd)

Source: Internet
Author: User
Author: Li Gang [Translator's introduction] Press: Electronic Industry Press ISBN: 2nd Release Date: March 2013: 16 open pages: 796 versions: 1-1 categories: Computer> Software and programming> mobile development> android
For more information, "" crazy android handout (2nd) "computer books mobile Internet has become the world's fastest growing business with the largest market potential and the most attractive prospects, android is the platform with the highest market share on the mobile Internet (far ahead of iOS, with the latest statistics: Android accounts for 53.7% and iOS accounts for 35%). At the same time, android applications use Java as their development language, which is also an excellent opportunity for Java. This is the 2nd version of crazy android handout. This book is based on the latest Android 4.2, Android SDK and ADT are all based on Android 4.2, and each case in the book is fully upgraded to Android 4.2. This book 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 with 3D application development, network communication programming, Android platform Web Service, sensor application development, GPS application development, Google map service, etc. Crazy android handout (version 2nd) is not limited to introducing various theoretical knowledge about Android programming, but to teaching theory from the perspective of "project-driven. The book contains nearly instances. These demonstration instances can help readers better understand the application of each knowledge point in actual development, and can also be used as a reference for actual development. This book also provides two practical cases: the android client of the crazy serialization and electronic auction system, which has a high reference value. This book provides a supporting Q & A site, if readers encounter technical problems when reading this book, you can log on to the crazy Java Alliance (http://www.crazyit.org) post, the author will answer in time. Crazy android handout (version 2nd) is suitable for readers who have a certain degree of Java programming basics. If you are familiar with Java programming syntax and have some experience in graphic interface programming, it is very suitable to read this book. Otherwise, before reading this book, we recommend that you carefully read the crazy Java handout of the crazy Java System. Contents of the crazy android handout (version 2nd) chapter 2 Android Application and Development Environment 1 1st Android development and History 2 1.1.1 Android development and introduction 2 1.1.2 Android platform architecture and features 3 1.1 build Android Development Environment 5 1.2.1 download and install Android SDK 5 1.2.2 install and run the debugging environment 7 1.2.3 install eclipse and ADT plug-in 10 1.3 common android development tools usage 13 1.3.1 create, delete, and browse AVD 13 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 18 1.3.7 use mksdcard to manage virtual SD card 18 1.4 start the first Android app 19 1.4.1 use eclipse to develop the first Android app 19 1.4.2 run Android app 23 through ADT. 1.5 Android Application structure analysis 23 1.5.1 create an Android Application 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 introduction to basic components of Android applications 30 1.6.1 activity and view 30 1.6.2 service 31 1.6.3 broadcastreceiver 31 1.6.4 contentprovider 32 1.6.5 intent and intentfilter 32 1.7 signature Android applications 33 1.7.1 in eclipse, the Android app signature 34 1.7.2 use commands to sign the APK package 35 1.8 Chapter Summary 37 Chapter 2nd Interface Programming for Android apps 38 2.1 Interface Programming and views (view) component 39 2.1.1 view component and container component 39 2.1.2 use XML layout file control UI 44 2.1.3 control UI in code 45 2.1.4 use XML layout file and Java code hybrid control UI interface 46 2.1.5 develop custom view 47 2.2 1st sets of UI components: layout manager 50 2.2.1 linear layout 50 2.2.2 table layout 53 2.2.3 frame layout 56 2.2.4 relative layout 59 2.2.5 Android 4.0 new grid layout 61 2.2.6 absolute layout 63 2.3 2nd sets of UI components: functions and usage of textview and its subclass 65 2.3.1 text box (textview) and edittext 65 2.3.2 functions and usage of edittext 72 2.3.3 buttons) component functions and usage 74 2.3.4 use 9patch image as button background 76 2.3.5 radio button (radiobutton) and check box (checkbox) Functions and usage 77 2.3.6 status switch button (togglebutton) functions and usage of the switch 79 2.3.7 clock (analogclock and digitalclock) Functions and usage 81 2.3.8 timer (chronometer) 83 2.4 3rd sets of UI components: imageview and its subclass 84 2.5 4th sets of UI components: adapterview and subclass 91 2.5.1 List View (listview) and listactivity 91 2.5.2 adapter interfaces and implementation class 93 2.5.3 automatically complete the text box (autocompletetextview) functions and usage 102 2.5.4 grid view (gridview) Functions and usage 104 2.5.5 list components (expandablelistview) 107 2.5.6 functions and usage 110 2.5.7 gallery view (Gallery) 112 2.5.8 functions and usage of adapterviewflipper 114 2.5.9 functions and usage of stackview 117 2.6 5th sets of UI components: progressbar and its subclass 119 2.6.1 progress bar (progressbar) functions and usage 119 2.6.2 functions and usage of a drag bar (seekbar) 123 2.6.3 star rating bar (ratingbar) 125 2.7 6th sets of UI components: viewanimator and its subclass 126 2.7.1 functions and usage of viewswitcher 127 2.7.2 functions and usage of imageswitcher 132 2.7.3 textswitcher) functions and usage 134 2.7.4 functions and usage of viewflipper 136 miscellaneous Components 2.8 2.8.1 use the toast display prompt box 138 2.8.2 calendar view (calendarview) functions and usage of the component 140 2.8.3 functions and usage of the date and time Picker (datepicker and timepicker) 141 2.8.4 functions and usage of the numberpicker 144 2.8.5 search box (searchview) 146 2.8.6 tab (tabhost) Functions and usage 148 2.8.7 rolling view (scrollview) functions and usage 150 2.8.8 notification functions and usage 151 dialog box 2.9 2.9.1 use alertdialog create dialog box 154 2.9.2 dialog box style window 154 2.9.3 use popupwindow 161 2.9.4 use datepickerdialog, role 161 2.9.5 use progressdialog create progress dialog box 164 2.10 menu 167 2.10.1 option menu and submenu) 167 2.10.2 use a listener to listen to menu events 171 2.10.3 create check menu items and single-choice menu items 171 2.10.4 set activity 171 2.10.5 context menu 172 2.10.6 use XML file to define menu 174 2.10.7 use popupmenu to create a pop-up menu 178 2.11 use an actionbar) 179 2.11.1 enable actionbar 180 2.11.2 use actionbar display option menu 181 2.11.3 enable program icon navigation 183 2.11.4 Add action view 184 2.11.5 use actionbar to implement tab navigation 185 2.11.6 use actionbar to implement drop-down navigation 191 2.12 summary of this Chapter 192 chapter 3rd Android event handling 193 3.1 Android event handling overview 194 3.2 listener-based event handling 194 3.2.1 listener Processing Model 195 3.2.2 events and Event Listeners 197 3.2.3 internal classes as Event Listeners 200 3.2.4 external Class As event listener class 200 3.2.5 activity itself as event listener 202 3.2.6 anonymous internal class as event listener class 203 3.2.7 directly bound to tag 204 3.3 callback-based event processing 205 3.3.1 callback mechanism and listening mechanism 205 3.3.2 callback-based event propagation 206 3.3.3 rewrite ontouchevent method response to touch screen event 208 3.4 system-set event 210 3.4.1 configuration class Introduction 210 3.4.2 rewrite onconfigurationchanged response to system settings changes 212 3.5 handler message transmission mechanism 214 3.5.1 handler class Introduction 214 3.5.2 working principles of handler, loop, and messagequeue 216 3.6 asynctask) 220 3.7 chapter summary Chapter 223 chapter 4th deep understanding of creating, configuring, and using activity 224 4.1.1 Activity 4.1 4.1.2 configure activity 225 4.1.3 to start and close activity 225 4.1.4 use bundle between activities exchange data 237 4.1.5 start other activities and return results 241 4.2 activity callback mechanism 245 4.3 activity lifecycle and Loading Mode 246 4.3.1 activity lifecycle demonstration 246 4.3.2 similarity and Servlet differences 250 4.3.3 Activity 4 loading modes 251 4.4 fragment details 257 4.4.1 fragment overview and design philosophy 257 4.4.2 create fragment 258 4.4.3 fragment and activity communication 262 4.4.4 fragment management and fragment transaction 264 4.5 Fragment lifecycle 268 4.6 Summary 272 chapter 5th use intent and intentfilter for communication 273 5.1 intent Object Description 274 5.1.1 use intent to start system components 274 5.2 intent attributes and intent-filter configuration 275 5.2.1 component Attribute 275 5.2.2 action, category attribute and intent-filter configuration 277 5.2.3 specify action, category call system activity 282 5.2.4 data, type attribute and intent-filter configuration 287 5.2.5 extra attribute 295 5.2.6 flag attribute 295 5.3 use intent to create a tab page 296 5.4 summary of this Chapter 297 chapter 6th Android Application Resources 298 6.1 Resource types and storage methods 299 6.1.1 resource types and storage methods 299 6.1.2 use resources 301 6.2 use string, color, size resource 302 6.2.1 definition of color value 303 6.2.2 definition of string, color, size resource file 303 6.2.3 use string, color, size resource 305 6.3 array (array) resource 307 6.4 usage resource 310 6.4.1 image resource 310 6.4.2 statelistdrawable resource 311 6.4.3 layerdrawable resource 312 6.4.4 shapedrawable resource 314 6.4.5 clipdrawable resource 316 6.4.6 runtime resource 318 6.5 property Animation) resource 320 6.6 use original XML resource 322 6.6.1 define original XML resource 322 6.6.2 use original XML file 323 6.7 use layout resource 325 6.8 use menu) resource 325 6.9 style and theme resource 326 6.9.1 style resource 326 6.9.2 topic resource 327 6.10 attribute) resource 329 6.11 using original resources 332 6.12 internationalization and Resource Adaptation 333 6.12.1 Java internationalization idea 334 6.12.2 Java Supported languages and countries 334 6.12.3 program internationalization 335 6.12.4 providing internationalized resources 337 for Android applications 6.12.5 internationalization Android app 338 6.13 adaptive resources of different screens 340 6.14 summary of this Chapter 343 chapter 7th graphics and image processing 344 7.1 use simple images 345 7.1.1 use drawable objects 345 7.1.2 bitmap and bitmapfactory 345 7.2 plotting 348 7.2.1 Android plotting basics: canvas, paint, etc. 348 7.2.2 path class 352 7.2.3 draw game animation 355 7.3 graphic effects processing 362 7.3.1 use Matrix Control Transform 362 7.3.2 use drawbitmapmesh distorted image 366 7.3.3 use shader fill graphics 368 frame by frame (FRAME) animation 370 7.4.1 animation drawable and frame-by-frame animation 371 (Tween) animation 374 7.5.1 tween animation and interpolator 374 7.5.2 position, size, rotation, transparency Change Compensation animation 376 7.5.3 custom compensation animation 380 7.6 attribute animation 383 7.6.1 attribute animation API 383 7.6.2 use property animation 385 7.7 use surfaceview for animation 393 7.7.1 surfaceview plotting mechanism 394 7.8 Summary of this Chapter 398 chapter 8th Android data storage and IO 399 8.1 use sharedpreferences 400 8.1.1 sharedpreferences and editor introduction 400 8.1.2 sharedpreferences storage location and format 401 8.1.3 Read and Write Other applications sharedpreferences 403 8.2 file storage 404 8.2.1 openfileoutput and openfileinput 405 8.2.2 Read and Write files on the SD card 407 8.3 SQLite database 414 8.3.1 sqlitedatabase introduction 414 8.3.2 create Database and table 415 8.3.3 use SQL statements to operate SQLite database 416 8.3.4 use sqlite3 tool 418 8.3.5 use specific methods to operate SQLite database 419 8.3.6 transaction 422 8.3.7 sqliteopenhelper class 422 8.4 gesture (gesture) 427 8.4.1 gesture detection 427 8.4.2 added gesture 434 8.4.3 recognition of user gestures 437 8.5 automatic reading (TTS) 439 8.6 summary of this chapter 441 chapter 9th use contentprovider for data sharing 442 9.1 data sharing standards: contentprovider Introduction 443 9.1.1 contentprovider Introduction 443 9.1.2 URI introduction 444 9.1.3 using contentresolver to operate data 445 9.2 developing contentprovider 446 9.2.1 relationship between contentprovider and handler 446 9.2.2 developing contentprovider 447 9.2.3 configuring contentprovider 448 9.2.4 using contentresolver method 449 9.2.5 create contentprovider description 451 9.3 contentprovider 457 9.3.1 use contentprovider to manage contacts 457 9.3.2 use contentprovider to manage multimedia content 463 9.4 466 listen to contentprovider Data Change 466 9.4.1 contentobserver introduction 9.5 this chapter summary chapter 468 service and broadcastreceiver 10th 469 service Introduction 10.1 10.1.1 create and configure service 470 10.1.2 Start and Stop Service 470 10.1.3 bind and communicate with local service 472 10.1.4 service lifecycle 473 10.1.5 use intentservice 478 10.2 to call service (aidl Service) across processes) 481 10.2.1 aidl service Introduction 482 10.2.2 create aidl file 482 10.2.3 expose the interface to client 483 10.2.4 client access aidlservice 484 10.3 telephone Manager (telephonymanager) 491 10.4 SMS Manager (smsmanager) 498 10.5 audio manager 502 10.5.1 audiomanager introduction 502 10.6 vibrator 504 10.6.1 vibrator introduction 504 10.6.2 using vibrator to control mobile phone vibration 505 10.7 mobile phone alarm service (alarmmanager) 505 10.7.1 alarmmanager introduction 505 10.7.2 set alarm clock 506 10.8 receive broadcast message 510 10.8.1 broadcastreceiver introduction 510 10.8.2 send broadcast 512 10.8.3 ordered broadcast 513 10.9 receive system broadcast message 520 10.10 chapter summary 523 chapter Multimedia Applications development 524 11.1 audio and video playback 525 11.1.1 use mediaplayer to play audio 525 11.1.2 music special effect control 528 11.1.3 use soundpool to play audio 536 11.1.4 use videoview to play video 539 11.1.5 use mediaplayer and surfaceview to play video 540 11.2 use mediarecorder to record audio 543 11.3 control camera to take photos 546 11.3.1 use camera to take photos 546 11.3.2 recording video clips 551 11.4 summary of this chapter 555 chapter 12th OpenGL and 3D application development 556 12.1 3D image and 3D Development basic knowledge 557 12.2 OpenGL and OpenGL ES introduction 558 12.3 draw 2D graphics 559 12.3.1 in Android applications use OpenGL ES 559 12.3.2 to draw a polygon on a plane 562 12.3.3 rotate 567 12.4 draw 3D graphics 569 12.4.1 build 3D graphics 569 12.4.2 apply texture textures 573 12.5 summary of this Chapter 578 chapter 13th android network applications 579 13.1 TCP-based network communication 580 13.1.1 TCP protocol basics 580 13.1.2 use serversocket to create a TCP Server 581 13.1.3 use socket for communication 582 13.1.4 add multithreading 586 13.2 use URL to access network resources 592 13.2.1 use URL to read Network Resources 593 13.2.2 use urlconnection to submit requests 594 13.3 Use http to access network 599 13.3.1 use httpurlconnection 600 13.3.2 use Apache httpclient 605 13.4 use webview view to display webpage 609 13.4.1 use webview to browse webpage 610 13.4.2 use webview to load HTML code 611 13.4.3 use JavaScript in webview to call Android method 612 13.5 use Web Service network Programming 615 13.5.1 Web Service Platform overview 615 13.5.2 use Android applications to call Web Service 617 13.6 Summary of this chapter 628 chapter 14th management Android mobile desktop 629 14.1 management mobile desktop 630 14.1.1 Delete desktop components 630 14.1.2 add desktop components 630 14.2 change mobile phone wallpaper 631 14.2.1 live wallpapers) 631 14.3 add shortcuts through programs 636 14.4 manage desktop controls 638 14.4.1 develop desktop controls 638 14.4.2 Android 4.0 add desktop controls for displaying datasets 642 14.5 647 summary of this chapter 15th chapter 648 Sensor Application Development 15.1 development of sensor applications using Android sensor 649 15.1.1 649 Android commonly used sensor 15.2 15.2.1 direction sensor orientation 651 15.2.2 Magnetic Field Sensor magnetic field 651 15.2.3 Temperature Sensor 652 15.2.4 light 652 15.2.5 Pressure Sensor pressure 653 15.3 Sensor Application Case 655 15.4 summary of this chapter 660 chapter 16th GPS application development 661 16.1 support for GPS core API 662 16.2 get locationprovider 664 16.2.1 get all available locationprovider 664 16.2.2 get specified by name locationprovider 665 16.2.3 obtain location information from criteria locationprovider 665 16.3 obtain location information 666 16.3.1 send GPS information through simulator 666 16.3.2 get location data 667 approaching warning 16.4 668 summary of this chapter 16.5 chapter 670 use Google map service 17th 17.1. call Google map preparation 672 17.1.1 get map API key 672 17.1.2 create AVD 674 that supports Google map API 17.2 locate 676 17.3 681 GPS navigation 17.4 locate 683 17.4.1 Based on address address Resolution and reverse address resolution 683 17.4.2 Location Based on address 688 17.5 summary of this chapter 689 chapter 18th crazy connection viewing 690 18.1 connection viewing game introduction 691 18.2 game development interface 691 18.2.1 development interface layout 692 18.2.2 game development interface component 693 18.2.3 connection line between processing cube 696 18.3 connection status data model 697 18.3.1 definition data model 697 18.3.2 initialize game status data 698 18.4 loading interface image 700 18.5 implement game activity 703 implement game logic 708 18.6.1 define gameservice Component Interface 708 18.6.2 implement gameservice component 709 18.6.3 obtain the contact point's square 710 18.6.4 determine whether two squares can be connected 711 18.6.5 define the tool method for obtaining the channel 713 18.6.6 without turning point horizontal connection 715 18.6.7 no turning point longitudinal connection 715 18.6.8 one turning point connection 716 18.6.9 two turning points connection 718 18.6.10 find the shortest distance 724 18.7 chapter summary 726 chapter 19th electronic auction system 727 system functions introduction and Architecture Design 728 19.1.1 system function introduction 728 19.1.2 System Architecture Design 729 19.2 JSON introduction 730 19.2.1 use JSON syntax to create an object 731 19.2.2 use JSON syntax to create an array 732 19.2.3 Java JSON 733 tools for sending requests 734 19.4 735 User Login 736 19.4.1 servlet 737 19.4.2 User Login 19.5 745 view streaming items 745 19.5.1 servlet 746 19.5.2 view streaming items 19.6 manage item categories 751 752 browse item categories servlet 752 19.6.2 view item categories 757 19.6.3 add type servlet 758 19.6.4 add item categories 19.7 760 manage auction item 19.7.1 view your own auction item Servlet 760 19.7.2 view your auction items 761 19.7.3 add an auction item servlet 764 19.7.4 add an auction item 765 19.8 participate in the auction 771 19.8.1 select an item type 771 19.8.2 browse items servlet 772 19.8.3 based on categories browsing items 773 19.8.4 servlet 775 19.8.5 participating in bidding 776 19.9 permission control 781 19.10 summary of this chapter 782 source of this book information: china Interactive publishing network
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.