Best Practices for Android and PHP development

Source: Internet
Author: User
Tags php language php server php session php development environment smarty template android games
Best Practices for Android and PHP development
Best Practices for Android and PHP development

Basic information

Author: Huang

Book Name: Mobile Application Development Technology Series

Publishing house: Mechanical Industry Press

isbn:9787111410508

Last Date: 2013-3-6

Publication date: March 2013

Folio: 16 Open

Page: 1

Edition: 1-1

Category: Computer

More about "Android and PHP development Best practices"

Content Introduction

Computer Books

"Best Practices for Android and PHP development" is the first classic in China that also tells about Android client development and PHP server development.

The best practices for Android and PHP development take a complete example of Weibo application projects as the main line, explaining the ideas and techniques of Android client development and PHP server development. From the early stage of product design, architecture design, to client and server-side coding implementation, to performance testing and system optimization, as well as the final packaging release, a complete introduction of mobile Internet application development process. At the same time, the book also introduces the features of the Android system, such as Google Maps, lbs features, sensors, cameras, multimedia and voice function use. In addition, the book introduces the development of the Android NDK and the development of Android games, including the use of OpenGL, popular game engine cocos2d-x and Unity 3d.

Android and PHP development best practices are suitable for all readers interested in Android and PHP technology. Both the client and the server developer can get a lot of useful experience from this book. In addition, it is worth mentioning that most of the examples of the book are derived from real projects, the reference value is very high.

Directory

Best Practices for Android and PHP development

Objective

First article of preparation

1th Pre-school must read 1

1.1 Advent of the mobile Internet era 1

1.2 Why Choose android and PHP 2

1.3 How to learn Android and PHP 3

1.3.1 How to learn Android 3

1.3.2 How to learn PHP 4

1.3.3 Learn Android and PHP 4 at the same time

1.4 Summary 5

2nd Android Development Preparation 6

2.1 Android Background Knowledge 6

2.2 Android System Framework 8

2.3 Android Application Framework 11

2.3.1 Activity 12

2.3.2 Message (Intent) 14

2.3.3 (view) 16

2.3.4 Tasks (Task) 17

2.4 Android system four components 19

.2.4.1 Activities (activity) 20

2.4.2 Services (Service) 21

2.4.3 Broadcast receiver (broadcast receiver) 23

2.4.4 Content Provider (contents Provider) 24

2.5 Android Context 25

2.5.1 Interface Context (activity context) 25

2.5.2 Application Context (application context) 27

2.6 Android Data Storage 28

2.6.1 application configuration (shared preferences) 28

2.6.2 local file (files) 29

2.6.3 Database (SQLite) 30

2.7 Android App Interface 31

2.7.1 Control Properties 31

2.7.2 Layouts (layout) 33

2.7.3 Events (Event) 37

2.7.4 Menus (menu) 39

2.7.5 Theme (theme) 41

2.7.6 dialog Box (dialog) 42

2.8 Android Graphics Interface 43

2.8.1 Brush (Paint) 43

2.8.2 Canvas (Canvas) 44

2.8.3 Basic Geometry 46

2.8.4 Common Graphics Transformations 47

2.9 Android Animation effect 50

2.9.1 Frame Animation (frame animation) 50

2.9.2 Motion Tween (tween animation) 51

2.10 Android Development Environment 52

Construction of 2.10.1 development environment 53

2.10.2 First Android Project 58

2.10.3 using the Ddms debugging tool 63

2.11 Summary 64

3rd PHP Development Preparation 65

3.1 PHP Development Fundamentals 65

3.1.1 PHP Language Introduction 65

3.1.2 PHP Syntax Introduction 66

3.1.3 PHP Development started 68

3.1.4 PHP Object-oriented Programming 75

3.1.5 PHP Session 78

3.2 PHP Development Environment 80

Construction of 3.2.1 Development Environment 80

3.2.2 Installation Configuration XAMPP 81

3.2.3 Management Apache 83

3.2.4 managing MySQL 84

3.3 Using JSON communication 87

3.4 Common PHP Development Framework 88

3.5 Understanding Smarty Template Engine 90

3.6 Introduction to the development Framework 93

Features and benefits of the 3.6.1 Framework 94

3.6.2 Framework's underlying directory structure 94

3.6.3 Framework MVC Ideas explained 97

3.6.4 Framework MVC Example Analysis 99

3.7 Summary 108

The second practical article

The 4th chapter of the example product design 109

4.1 Why Choose Weibo 109

4.2 Pre-development preparation 110

4.2.1 Select development Mode 110

4.2.2 Understanding Project Planning 111

4.2.3 Understanding prototype Design 112

4.3 Function Module Design 112

4.4 Application Interface Design 114

4.5 Application Architecture Design 115

4.6 Communication Protocol Definition 116

4.7 Database Structure Design 118

4.8 Summary 120

5th Chapter Program Architecture Design 121

5.1 Service-side program Architecture Design 121

5.1.1 Basic Frame Design 122

5.1.2 Debug Frame Design 127

5.1.3 Core Class library design 130

5.1.4 MVC and SOA on the service side 136

5.2 Client program Architecture design 136

5.2.1 Basic Frame Design 137

5.2.2 Core Class package design 138

5.2.3 MVC 142 for Android apps

5.3 Client Interface Architecture Design 142

5.3.1 Interface Frame Design 143

5.3.2 Main interface Design 144

5.4 Summary 146

6th. Server Development 147

6.1 Introduction to Development 147

6.1.1 Interface Program Development 147

6.1.2 Debug Framework Development 151

6.1.3 Generating Interface Documentation 155

6.2 Verifying the Interface 156

6.2.1 User Login Interface 156

6.2.2 User Logout Interface 160

6.3 User Interface 162

6.3.1 New User Interface 162

6.3.2 Update user Information interface 164

6.3.3 viewing user Information Interface 165

6.3.4 adding fan Interface 167

6.3.5 Remove Fan Interface 171

6.4 Microblogging Interface 172

6.4.1 Publishing Microblogging Interface 172

6.4.2 viewing micro-blogging interface 174

6.4.3 Weibo list Interface 176

6.5 Reviews Interface 180

6.5.1 Comment Interface 180

6.5.2 Comment List Interface 182

6.6 Picture Interface 184

6.6.1 User Avatar Interface 185

6.6.2 Avatar List Interface 188

6.7 Notification Interface 189

6.8 Web Edition Interface 192

6.8.1 Web UI Interface (jquery mobile) 193

6.8.2 Web Edition Map interface 195

6.9 Summary 196

7th Client Development 198

7.1 Introduction to Development 198

7.1.1 Development Thinking Carding 198

7.1.2 Mastering Application Profiles 200

7.1.3 General Program development and commissioning 211

7.2 Interface layout and Behavior control 221

7.2.1 Using layout layouts 221

7.2.2 using the Merge integration interface 224

7.2.3 using event to control user behavior 226

7.2.4 switching using the intent control Interface 228

7.3 Network Communication Module 231

7.3.1 using httpclient for network communication 231

7.3.2 Support Cmwap Network access mode 237

7.3.3 decoding messages using the JSON library 240

7.3.4 using Toast message tip 245

7.4 Asynchronous Task Module 247

7.4.1 Processes and Threads 247

7.4.2 Task Creating thread 249

7.4.3 Task Handling Handler 255

7.4.4 using asynchronous Tasks Asynctask 257

7.5 Global Function Module 259

7.5.1 Global UI base class 259

7.5.2 global Menu Menu 264

7.5.3 Global Dialog Window 265

7.5.4 using service to get notifications 266

7.5.5 using notification to display notifications 270

7.6 User Login Interface 273

7.6.1 Interface Program Logic 273

7.6.2 using TextView 273

7.6.3 using EditText 274

7.6.4 using button 276

7.6.5 using shape and selector 277

7.6.6 Using the checkbox 279

7.6.7 using Sharedpreference 280

7.7 Weibo list Interface 281

7.7.1 Interface Program Logic 281

7.7.2 using the ListView 286

7.7.3 using ImageView 290

7.7.4 using Draw9patch 292

7.7.5 retrieving remote pictures asynchronously 294

7.7.6 using SDcard to cache pictures 297

7.7.7 using SQLite to cache data 300

7.8 My Weibo list 303

7.8.1 Interface Program Logic 303

7.8.2 using ScrollView 309

7.8.3 using a custom microblog list 310

7.9 Weibo article Interface 313

7.9.1 Interface Program Logic 313

7.9.2 Interface Layout Advanced (using UI controls in general) 319

7.9.3 Comment Function Implementation 322

7.9.4 Publishing Weibo features for 326

7.10 User Configuration Interface 328

7.10.1 Interface Program Logic 328

7.10.2 using the Custom Options list 333

7.10.3 Modifying the signature feature implementation 334

7.10.4 change avatar Feature for 334

7.11 Web Interface Development 340

7.11.1 Interface Program Logic 340

7.11.2 using WebView 341

7.11.3 using ProgressDialog 343

7.11.4 rewrite and callback using WebView 346

7.11.5 Web Map Example Analysis 348

7.12 Summary 349

The third optimization chapter

8th Chapter Performance Analysis 351

8.1 About Performance Testing 351

8.1.1 Service-Side pressure test 352

8.1.2 Client Performance Test 359

8.2 Bottleneck 364

8.2.1 Service-Side bottleneck analysis 365

8.2.2 Client Bottleneck Analysis 366

8.3 Ideas for Optimization 366

8.4 Summary 367

9th. Service-Side optimization 368

9.1 Optimizing PHP Programs 368

9.1.1 Optimizing PHP Code 368

9.1.2 Optimization session mechanism 371

9.1.3 Using cache middleware 373

9.1.4 Using APC Acceleration 376

9.2 Optimizing data Transfer 377

9.2.1 Optimization JSON Protocol 377

9.2.2 using gzip compression 379

9.3 Other Optimizations 380

9.3.1 Server Optimization 380

9.3.2 Database Optimization 383

9.3.3 Network Optimization 386

9.4 Summary 386

10th Client Optimization 387

10.1 Optimizing Android Programs 387

10.1.1 Optimizing Java Code 387

10.1.2 Retrieving data asynchronously 391

10.1.3 File Resource Cache 391

10.1.4 Database Cache 392

10.2 Avoiding memory leaks 392

10.2.1 Android Memory Management 392

10.2.2 how to determine memory leaks 393

10.2.3 Common memory leak handling 395

10.3 Optimizing Android UI 396

10.3.1 Template code Optimization 396

10.3.2 About layout Optimization 397

10.3.3 using the Hierarchy Viewer tool 402

10.4 Other Optimizations 403

10.4.1 Optimization Picture 403

10.4.2 Optimizer APK Pack 403

10.4.3 using Keytool and Jarsigner signatures 404

10.4.4 using Zipalign Optimization 407

10.5 Summary 408

Fourth Advanced article

11th Android Featured feature Development 409

11.1 Using the Google Map API 409

11.2 Using LBS function 414

11.3 Using the Sensor 419

11.4 Using the camera 422

11.5 Multi-media development 431

11.6 Speech recognition 439

11.7 Summary 441

12th Chapter Android NDK Development 442

12.1 NDK Development Fundamentals 442

Why 12.1.1 uses the NDK 442

12.1.2 using the NDK to call C or C + + 443

12.1.3 Android.mk and Application.mk 445

12.2 NDK Development Primer 448

12.2.1 Development Environment Construction 448

12.2.2 First NDK Project 449

12.3 Summary 456

13th Android Game Development 457

13.1 Hand Tour Development Basics 457

13.1.1 Hand Tour Development Thinking 457

13.1.2 Snake and spaceship game example 462

13.1.3 know Android game engine 464

13.1.4 using OpenGL and OpenGL ES 466

13.1.5 using Renderscript 472

13.2 Hand Tour Development Advanced 474

13.2.1 Know Cocos2d-x 475

13.2.2 erecting cocos2d-x development environment 475

13.2.3 First Cocos2d-x Item 475

13.2.4 Know Unity 3d 487

13.3 Summary 489

Appendix A hush Framework instance source deployment 490

Appendix B Weibo application example source deployment 495


The source of book Information: China Interactive Publishing Network

  • 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.