مشخصات کتاب
-
Mark Reynolds
-
2014
-
انگلیسی
-
6792
-
1144
-
0
Xamarin Mobile Application Development for Android
Chapter 1: The Anatomy of an Android App 7
The Android platform 7
Linux 8
Native libraries 8
The Android runtime 9
The Application Framework 9
Applications 9
The Android packages (.apk) 10
The application manifest 10
Versions of Android 10
The Android applications 11
Activities 11
The life cycle of an activity 12
The states of an activity 12
The events of an activity 13
Services 14
Content providers 14
Broadcast receivers 14
Views and ViewGroups 14
Declarative versus programmatic View creation 15
User interface widgets 15
Common layouts 15
Adapter layouts 16
XML layout files 17
Element and attribute names 17
IDs 17
Using XML layouts from activities 18
IntentsResources 18
The R.java file 19
Summary 19
Chapter 2: Xamarin.Android Architecture 21
Why Xamarin.Android? 21
What is Mono? 23
Mono and Dalvik side by side 23
The Java Native Interface 24
Peer objects 24
Xamarin.Android application packaging 25
The Android bindings design 25
Design principles 25
C# properties 25
Delegates 26
Constants to enumerations 26
Development environments 27
Xamarin Studio 27
Xamarin for Visual Studio 28
IDE comparison 29
Compatibility 29
Summary 29
Chapter 3: Creating the Points of Interest App 31
The sample app 31
Installing Xamarin.Android 32
Creating the app 34
Xamarin Studio IDE 35
The Project Options View 36
Setting the target framework 36
Setting the app icon and package name 37
The initial activity 38
Running and debugging the app 38
Creating and customizing emulators 41
Using the x86 emulator 43
Debugging with an Android device 44
Enabling USB debugging 44
Installing a USB driver 44
Running apps on a device 44
Behind the scenes 45
Peer object 45
The AndroidManifest.xml file 46
SummaryChapter 4: Creating a Data Storage Mechanism 47
Creating the Point of Interest entity class 48
Creating the POI storage interface 50
Implementing the POI storage services 51
Using Xamarin.Android NUnitLite 52
Setting up for tests 53
Creating the test methods 54
Executing the tests 57
Json.NET 59
Downloading Json.NET 59
Implementing and testing the POIJsonService methods 60
Implementing caching 61
Implementing SavePOI() 62
Implementing GetPOI() 64
Implementing DeletePOI() 64
Summary 64
Chapter 5: Adding a List View 65
Creating the POI ListView layout 65
Adding a RelativeLayout view group 70
Adding an ImageView widget 71
Adding a LinearLayout widget 71
Adding the name and address TextView classes 72
Adding the Distance TextView 73
Populating the ListView item 73
Shared instance of IPOIDataService 74
Permissions 75
Creating POIListViewAdapter 76
Implementing a constructor 76
Implementing Count { get; } 76
Implementing GetItemId() 77
Implementing the index getter method 77
Implementing GetView() 77
Reusing row Views 78
Populating row Views 78
Hooking up POIListViewAdapter 79
Adding actions to ActionBar 79
Defining the menu .xml file 80
Setting menus in OnCreateOptionsMenu 81
Handling selection in OnOptionsItemSelected() 81
Configuring an SD card for the emulator 82
Running POIApp 82
Android Device Monitor 82Handling row clicks 84
Summary 85
Chapter 6: Adding a Detail View 87
Creating the POIDetail layout 87
Working with InputType 90
Creating POIDetailActivity 91
Binding variables to controls 91
Adding navigation to POIDetailActivity 92
Navigating on new action 92
Navigating on POI Click 92
Receiving data in POIDetailActivity 93
Populating user interface widgets 94
Adding Save and Delete actions 94
Disabling the Delete action 95
Creating SavePOI() 96
Creating DeletePOI() 97
Adding validation 97
Using the EditText.Error property 98
Adding a Delete confirmation prompt 99
Toasting success 101
Refreshing POIListActivity 101
Wrapping up 102
Summary 102
Chapter 7: Making POIApp Location Aware 103
Location services 103
Setting app permissions 104
Configuring the emulator 106
Obtaining an instance of LocationManager 107
Requesting location change notifications 107
Implementing ILocationListener 108
Adding location services to POIApp 108
Adding location services to POIListActivity 109
Adding location services to POIDetailActivity 111
Getting an address for a location 114
Keeping the user informed 116
Dealing with configuration changes 116
Adding map integration 119
Navigating to the map app 120
Checking for registered map apps 121
Summary 122Chapter 8: Adding Camera App Integration 123
Picking an integration approach 123
Permissions and Features 124
Configuring the Emulator 125
Extending the data service 125
Defining GetImageFilename() 125
Implementing GetImageFilename() 126
Updating DeletePOI() 126
Capturing an image from POIDetailActivity 126
Adding UI elements 127
Creating the intent 128
Checking for registered camera apps 128
Providing additional information with the intent 129
Providing a filename and location 129
Providing size limit 129
Starting the intent 130
Completing the NewPhotoClicked() method 130
Processing the results of the intent 131
Displaying existing images in POIDetailActivity 133
Displaying POI images in POIListActivity 133
Summary 134
Chapter 9: Deploying Your App 135
App distribution options 135
Preparing for a release APK 137
Disabling debug 137
AndroidManifest.xml 137
AssemblyInfo.cs 138
Linking 138
Linking options 138
Side effects of linking 139
Selecting supported ABIs 140
Publishing a signed APK 141
Keystores 141
Publishing from Xamarin.Android 141
Republishing 144
Summary 144
Index 145