E-shop 4 E-Learners

E-shop 4 E-Learners အမွန္တကယ္အဖိုးတန္ၿပီးရွားပါးေသာစာ?

Android Apps for Absolute Beginners (4th Edition-English Version)*******************************************************...
03/09/2017

Android Apps for Absolute Beginners (4th Edition-English Version)
**********************************************************************

စာအုပ္နံမည္ကိုၾကည့္ရံဳနဲ႔ Android ဖုန္းေဆာ့၀ဲေတြကို ေရးသားဖန္တီးခ်င္ၾကသူေတြထဲက ဘာဆိုဘာမွ မသိေသးတဲ့ Beginner ေတြအတြက္ လံုး၀အသင့္ေတာ္ဆံုး စာအုပ္ဆိုတာကို သိႏိုင္ပါတယ္။

အမွန္တကယ္လည္း အေျခခံအက်ဆံုး အဆင့္ကေန ေရးသားတင္ျပထားတဲ့ အဂၤလိပ္ဘာသာနဲဲ႔ ထုတ္ေ၀ထားတဲ့စာအုပ္ေလး တစ္အုပ္ျဖစ္ပါတယ္။

Online Shopping ေတာ္ေတာ္မ်ားမ်ားမွာ e-book အျဖစ္နဲ႔ေတာင္ တစ္အုပ္ကို ၂၈ေဒၚလာ၀န္းက်င္နဲ႔ ေရာင္းအားေကာင္းေနဆဲ စာအုပ္တစ္အုပ္ျဖစ္ပါတယ္။

ဒီတစ္အုပ္ကေတာ့ အႀကိမ္ႀကိမ္ မြမ္းမံထုတ္ေ၀လာတဲ့ထဲက ေနာက္ဆံုးထြက္ 4th Edition ျဖစ္ပါတယ္။

၀ယ္ယူေလ့လာခ်င္တယ္ဆိုရင္ တစ္အုပ္ကို ၃၀၀၀ က်ပ္နဲ႔ ေရာင္းေပးမွာျဖစ္ပါတယ္။

ေမးျမန္းေဆြးေႏြးလိုတာရွိရင္ Chat Box ကေနျဖစ္ျဖစ္
09766700905 ကို ဖုန္းဆက္ၿပီးျဖစ္ျဖစ္ ေမးျမန္းေဆြးေႏြးႏိုင္ပါတယ္။
စာအုပ္ပါ Content ေတြကိုေတာ့ ေအာက္မွာေဖၚျပထားပါတယ္။

Chapter 1: Preliminary Information: Before We Get Started ........................... 1
Some History: What Is Android? ......................... 2
Advantage Android: How Can Android Benefit Me? .. 3
The Scope of This Book .. 4
What’s Covered .. 4
What’s Not Covered ... 5
Preparing for Liftoff: SDK Tools to Download . 5
Java ................... 6
Eclipse ............ 7
Android SDK ....... 8
Summary ... 8

■Chapter 2: What’s Next? Our Road Ahead .... 11
Your Android Development IDE ........... 11
Java, XML, and How Android Works ... 13
The Android Application Framework .... 14
Screen Layout Design ............ 14
User Interface Design ...... 15
Graphics and Animation Design ... 15
Interactivity ............. 16
Content Providers ........... 16
Intents and Intent Filters ....... 17
The Future of Android ....... 17
Summary .......................... 18

■Chapter 3: Setting Up Your Android Development Environment ................... 19
Installing Java, Eclipse, and Android ....... 19
Java SE and JRE: Your Foundation for Application Development .................................................................... 20
■ CONTENTS
vi
Eclipse IDE: The Development Environment ..... 21
Android SDK: The Android Tool Kit for Eclipse ......... 25
Android Development Tool: Android Tools for Eclipse ..... 26
The Android Environment Within Eclipse .... 30
Updating the Android SDK ........ 31
Setting Up AVDs and Smartphone Connections ..... 33
AVDs: Smartphone Emulators ....... 33
USB Smartphone Drivers: External Devices ............... 35
Developing on 64-Bit Computing Platforms .... 36
Summary .............. 38

■Chapter 4: Introducing the Android Software Development Platform ........... 41
Understanding Java SE and the Dalvik Virtual Machine ....................................................................................... 42
The Directory Structure of an Android Project ...................................................................................................... 43
Common Default Resources Folders ................................................................................................................ 44
The Values Folder ............................................................................................................................................ 45
Leveraging Android XML (Your Secret Weapon) ................................................................................................... 46
Screen Sizes .................................................................................................................................................... 47
Desktop Clocks ................................................................................................................................................ 47
Using Your Android Application Resources ........................................................................................................... 48
Bitmap Images ................................................................................................................................................. 48
Alternate Resource Folders .............................................................................................................................. 49
Launching Your Application: The AndroidManifest.xml File .................................................................................. 50
Creating Your First Android Application ................................................................................................................ 51
Launching Eclipse ............................................................................................................................................ 51
Creating an Android Project ............................................................................................................................. 52
Inspecting and Editing the Application Files .................................................................................................... 55
Setting a Variable Value in strings.xml ............................................................................................................ 59
Running the App .............................................................................................................................................. 60
Adding an Application Icon .............................................................................................................................. 61
Summary .............................................................................................................................................................. 65
■Chapter 5: Android Framework Overview ..................................................... 67
The Foundation of OOP: The Object ...................................................................................................................... 68
Some OOP Terminology ................................................................................................................................... 69
The Blueprint for an Object: The Class ............................................................................................................. 70
Providing Structure for Your Classes: Inheritance ........................................................................................... 75
Defining an Interface ....................................................................................................................................... 76
Bundling Classes in a Logical Way: The Package ............................................................................................ 77
An Overview of XML .............................................................................................................................................. 78
The Anatomy of an Android Application: The APK File .......................................................................................... 79
Android Application Components .......................................................................................................................... 80
Android Activities: Defining the UI ................................................................................................................... 81
Android Services: Processing in the Background ............................................................................................ 82
Broadcast Receivers: Announcements and Notifications ................................................................................ 82
Content Providers: Data Management ............................................................................................................. 83
Android Intent Objects: Messaging for Components ............................................................................................. 84
Android Manifest XML: Declaring Your Components ............................................................................................ 85
Summary .............................................................................................................................................................. 87
■ CONTENTS
vii
■Chapter 6: Screen Layout Design: Views and Layouts .................................. 89
Android View Hierarchies ...................................................................................................................................... 89
Using the View Class ........................................................................................................................................ 90
Nesting Views: Using the ViewGroup Class ..................................................................................................... 90
Defining Screen Layouts: Using XML .................................................................................................................... 92
Setting Up for Your Screen Layout ................................................................................................................... 92
Using Linear Layouts ........................................................................................................................................ 93
Using Relative Layouts ................................................................................................................................... 104
Sliding Drawers: Expanding Your UI .............................................................................................................. 108
Using Padding and Margins with Views and Layouts .................................................................................... 111
Setting Padding in Views ............................................................................................................................... 112
Setting Margins in ViewGroups ...................................................................................................................... 112
Summary ............................................................................................................................................................ 112
■Chapter 7: UI Design: Buttons, Menus, and Dialogs .................................... 115
Using Common UI Elements ................................................................................................................................ 115
Adding an Image Button to Your Layout ........................................................................................................ 116
Adding a Text to Your Layout ......................................................................................................................... 126
Adding an Image ............................................................................................................................................ 127
Using Menus in Android ...................................................................................................................................... 129
Creating the Menu Structure with XML .......................................................................................................... 130
Defining Menu Item Strings ........................................................................................................................... 131
Inflating the Menu Structure via Java ............................................................................................................ 134
Running the Application in the Android Emulator .......................................................................................... 136
Making the Menu Work .................................................................................................................................. 136
Adding Dialogs .................................................................................................................................................... 140
Using Custom Dialog Subclasses ................................................................................................................... 140
Displaying an Alert Dialog .............................................................................................................................. 140
Summary ............................................................................................................................................................ 145
■Chapter 8: An Introduction to Graphics Resources in Android ................... 147
Introducing the Drawables .................................................................................................................................. 148
Implementing Images .................................................................................................................................... 148
Core Drawable Subclasses ............................................................................................................................ 149
Using Bitmap Images in Android ......................................................................................................................... 149
PNG Images ................................................................................................................................................... 150
JPEG and GIF Images ..................................................................................................................................... 151
Creating Animation in Android ............................................................................................................................ 151
Frame-based or Cel 2D Animation ................................................................................................................. 151
Tween Animation in Android .......................................................................................................................... 160
Using Transitions ................................................................................................................................................ 166
Creating 9-Patch Custom Scalable Images ......................................................................................................... 170
Playing Video in Your Android Apps .................................................................................................................... 176
Adding a VideoView Object ............................................................................................................................ 176
Adding the Java for Video .............................................................................................................................. 178
Summary ............................................................................................................................................................ 181
■Chapter 9: Adding Interactivity: Handling UI Events ................................... 183
An Overview of UI Events in Android ................................................................................................................... 183
Listening for and Handling Events ................................................................................................................. 183
■ CONTENTS
viii
Handling UI Events via the View Class ........................................................................................................... 184
Event Callback Methods ................................................................................................................................ 184
Handling onClick Events ..................................................................................................................................... 185
Implementing an onClick Listener for a UI Element ....................................................................................... 186
Adding an onClick Listener to an Activity in Android ..................................................................................... 187
Android Touchscreen Events: onTouch ............................................................................................................... 195
Touchscreen’s Right-Click Equivalent: onLongClick ........................................................................................... 195
Keyboard Event Listeners: onKeyUp and onKeyDown ........................................................................................ 198
Adding the XML for Keyboard Events ............................................................................................................. 199
Adding the Java for Keyboard Events ............................................................................................................ 199
Context Menus in Android: onCreateContextMenu ............................................................................................. 202
Adding the XML for Context Menus ............................................................................................................... 202
Adding the Java for Context Menus ............................................................................................................... 204
Controlling the Focus in Android ......................................................................................................................... 209
Adding the XML for Focus Control ................................................................................................................. 210
Adding the Java for Focus Control ................................................................................................................. 214
Setting Focus Availability ............................................................................................................................... 216
Summary ............................................................................................................................................................ 216
■Chapter 10: Understanding Content Providers ............................................ 217
An Overview of Android Content Providers ......................................................................................................... 217
Databases and Database Management Systems ........................................................................................... 218
Android Built-in Content Providers ................................................................................................................ 219
Defining a Content Provider ................................................................................................................................ 222
Creating the Content Providers Example Project in Eclipse ........................................................................... 223
Defining Security Permissions ....................................................................................................................... 224
Adding Data to the Contacts Database .......................................................................................................... 228
Working with a Database .................................................................................................................................... 231
Querying a Content Provider: Accessing the Content .................................................................................... 231
Appending to a Content Provider: Adding New Content ................................................................................. 237
Modifying Content Provider Data: Updating the Content ............................................................................... 243
Removing Content Provider Data: Deleting Content ...................................................................................... 248
Summary ............................................................................................................................................................ 253
■Chapter 11: Understanding Intents and Intent Filters ................................. 255
What Is an Intent? ............................................................................................................................................... 255
Android Intent Messaging via Intent Objects ...................................................................................................... 256
Intent Resolution: Implicit Intents & Explicit Intents ........................................................................................... 259
Explicit Intents ............................................................................................................................................... 259
Implicit Intents ............................................................................................................................................... 260
Using Intents with Activities ............................................................................................................................... 261
Writing the Digital Clock Activity .................................................................................................................... 266
Wiring up the Application ............................................................................................................................... 269
Sending Intents .............................................................................................................................................. 271
Android Services: Data Processing in its own Class ........................................................................................... 274
Using Intents with Services ........................................................................................................................... 274
Creating a Service .......................................................................................................................................... 277
Implementing Our MediaPlayer Functions ..................................................................................................... 281
Wiring the Buttons to the Service .................................................................................................................. 282
■ CONTENTS
ix
Running the Application ................................................................................................................................. 283
Using Intents with Broadcast Receivers ............................................................................................................. 284
Creating the Timer User Interface via XML .................................................................................................... 285
Creating a Timer Broadcast Receiver ............................................................................................................ 286
Configuring the AndroidManifest.xml file Tag ............................................................................. 288
Implementing our Intent ................................................................................................................................ 289
Running the Timer Application via the Android 1.5 Emulator ........................................................................ 294
Summary ............................................................................................................................................................ 295
■Chapter 12: The Future ................................................................................ 297
Widgets: Creating Your Own Widgets in Android ................................................................................................ 297
Location-Based Services in Android ................................................................................................................... 299
Google Maps in Android ...................................................................................................................................... 300
Google Search in Android ................................................................................................................................... 303
Data Storage in Android ...................................................................................................................................... 304
Shared Preferences ....................................................................................................................................... 304
Internal Memory ............................................................................................................................................. 305
External Memory ............................................................................................................................................ 305
Using SQLite ................................................................................................................................................... 306
Device Administration: Security for IT Deployments ........................................................................................... 306
Using the Android Camera Class to control a Camera ........................................................................................ 307
3D Graphics: Using OpenGL ES 1.x in Android .................................................................................................... 307
FaceDetector ....................................................................................................................................................... 308
SoundPool ........................................................................................................................................................... 308
MediaRecorder .................................................................................................................................................... 309
Summary ............................................................................................................................................................ 310
Index ............................................................................................................... 311

Head First Android Development (pdf) အဂၤလိပ္ဘာသာ*******************************************************************Andro...
01/09/2017

Head First Android Development (pdf) အဂၤလိပ္ဘာသာ
*******************************************************************

Android Application ေရးသားလိုသူ ၀ါသနာရွင္ Beginner မ်ားအတြက္ အဖတ္သင့္ဆံုး စာအုပ္တစ္အုပ္ျဖစ္ၿပီး Android Developer ေတြၾကားမွာလည္း နံမည္ႀကီးတဲ့ စာအုပ္တစ္အုပ္ျဖစ္ပါတယ္။
Online Shop ေတြမွာ ebook အျဖစ္နဲ႔ေတာင္ တစ္အုပ္ကို ၂၈ေဒၚလာေက်ာ္နဲ႔ ေရာင္းခ်ေနဆဲစာအုပ္ျဖစ္ပါတယ္။

၀ယ္ယူေလ့လာခ်င္တယ္ဆိုရင္ေတာ့ pdf တစ္အုပ္ကို ၅၀၀၀ က်ပ္နဲ႔ ေရာင္းခ်ေပးမွာျဖစ္ပါတယ္။

ေမးျမန္းစံုစမ္းခ်င္တယ္ဆိုရင္ Chat Box ကေန လာေရာက္ေမးျမန္းႏိုင္ပါတယ္။
Online Shopping ကိစၥေတြမွာ အသံုးခ်မခံရေစဖို႔အတြက္ ဖုန္းနံပါတ္ေတြ ေနရပ္လိပ္စာေတြကို Comment မွာ ေရးမထည့္ၾကဖို႔ အသိေပးပါရေစ။

ဖုန္းဆက္ၿပီးေမးျမန္းလိုတယ္ဆိုရင္လည္း 09766700905 ကို ဖုန္းဆက္ၿပီးေမးျမန္းႏိုင္ပါတယ္။

စာမ်က္ႏွာ ၆၀၀ ေက်ာ္ပါ၀င္ၿပီး စာအုပ္ထဲမွာပါတဲ့ အေၾကာင္းအရာေတြကို မူရင္းအေရာင္း Page မွာေဖၚျပထားတဲ့အတိုင္းပဲ ေအာက္မွာေဖာ္ျပေပးလိုက္ပါတယ္။

Chapter 1 Getting Started: Diving In
Welcome to Androidville
The Android platform dissected
Here’s what we’re going to do
Your development environment
Install Java
Build a basic app
Let’s build the basic app
Activities and layouts from 50,000 feet
Building a basic app (continued)
Building a basic app (continued)
You’ve just created your first Android app
Android Studio creates a complete folder structure for you
Useful files in your project
Edit code with the Android Studio editors
Run the app in the Android emulator
Creating an Android Virtual Device
Run the app in the emulator
You can watch progress in the console
Test drive
What just happened?
Refining the app
What’s in the layout?
activity_main.xml has two elements
The layout file contains a reference to a string, not the string itself
Let’s look in the strings.xml file
Take the app for a test drive
Your Android Toolbox
Chapter 2 Building Interactive Apps: Apps That Do Something
You’re going to build a Beer Adviser app
Here’s what you need to do
Create the project
We’ve created a default activity and layout
Adding components with the design editor
activity_find_beer.xml has a new button
A closer look at the layout code
Changes to the XML...
...are reflected in the design editor
Use string resources rather than hardcoding the text
Change the layout to use the string resources
Let’s take the app for a test drive
Add values to the spinner
Get the spinner to reference a string-array
Test drive the spinner
We need to make the button do something
Make the button call a method
What activity code looks like
Add an onClickFindBeer() method to the activity
onClickFindBeer() needs to do something
Once you have a View, you can access its methods
Update the activity code
The first version of the activity
What the code does
Test drive the changes
Building the custom Java class
Enhance the activity to call the custom Java class so that we can get REAL advice
Activity code version 2
What happens when you run the code
Test drive your app
Your Android Toolbox
Chapter 3 Multiple Activities and Intents: State Your Intent
Apps can contain more than one activity
Here’s the app structure
Create the project
Update the layout
Update strings.xml...
Create the second activity and layout
What just happened?
Welcome to the Android manifest file
Every activity needs to be declared
An intent is a type of message
Use an intent to start the second activity
What happens when you run the app
The story continues...
Test drive the app
Pass text to a second activity
Update the text view properties
putExtra() puts extra information in an intent
Update the CreateMessageActivity code
Get ReceiveMessageActivity to use the information in the intent
What happens when the user clicks the Send Message button
Test drive the app
We can change the app to send messages to other people
How Android apps work
But we don’t know what apps are on the device
Create an intent that specifies an action
Change the intent to use an action
What happens when the code runs
The story continues...
The intent filter tells Android which activities can handle which actions
How Android uses the intent filter
You need to run your app on a REAL device
Test drive the app
What if you ALWAYS want your users to choose an activity?
What happens when you call createChooser()
The story continues...
Change the code to create a chooser
Test drive the app
If you have NO matching activities
Your Android Toolbox
Chapter 4 The Activity Lifecycle: Being an Activity
How do activities really work?
The Stopwatch app
The stopwatch layout code
How the activity code will work
Add code for the buttons
The runTimer() method
Handlers allow you to schedule code
The full runTimer() code
The full StopwatchActivity code
What happens when you run the app
The story continues
Test drive the app
What just happened?
Rotating the screen changes the device configuration
From birth to death: the states of an activity
The activity lifecycle: from create to destroy
Your activity inherits the lifecycle methods
How do we deal with configuration changes?
Or save the current state...
...then restore the state in onCreate()
What happens when you run the app
The story continues
Test drive the app
There’s more to an activity’s life than create and destroy
The activity lifecycle: the visible lifetime
We need to implement two more lifecycle methods
The updated StopwatchActivity code
What happens when you run the app
Test drive the app
But what if an app is only partially visible?
The activity lifecycle: the foreground lifetime
Stop the stopwatch if the activity’s paused
What happens when you run the app
Test drive the app
The complete activity code
Your handy guide to the lifecycle methods
Your Android Toolbox
Chapter 5 The User Interface: Enjoy the View
Your user interface is made up of layouts and GUI components
Three key layouts: relative, linear, and grid
RelativeLayout displays views in relative positions
Adding padding
Positioning views relative to the parent layout
Attributes for positioning views relative to the parent layout
Positioning views relative to other views
Attributes for positioning views relative to other views
Use margins to add distance between views
RelativeLayout: a summary
LinearLayout displays views in a single row or column
A linear layout displays views in the order they appear in the layout XML
Let’s change up a basic linear layout
Here’s the starting point for the linear layout
Make a view streeeeetch by adding weight
Adding weight to one view
Adding weight to multiple views
Use gravity to specify where text appears in a view
Test drive
Using the android:gravity attribute: a list of values
Move the button to the right with layout-gravity
More values you can use with the android:layout-gravity attribute
The full linear layout code
LinearLayout: a summary
GridLayout displays views in a grid
Adding views to the grid layout
Let’s create a new grid layout
We’ll start with a sketch
Row 0: add views to specific rows and columns
Row 1: make a view span multiple columns
Row 2: make a view span multiple columns
The full code for the grid layout
GridLayout: a summary
Layouts and GUI components have a lot in common
GUI components are a type of View
What being a view buys you
A layout is really a hierarchy of Views
Playing with views
Text view
Edit Text
Button
Toggle button
Switch
Check boxes
Radio buttons
Spinner
Image views
Images: the layout XML
Adding images to buttons
Image Button
Scroll views
Toasts
Your Android Toolbox
Chapter 6 List Views and Adapters: Getting Organized
Every app starts with ideas
Categorize your ideas: top-level, category, and detail/edit activities
Navigating through the activities
Use ListViews to navigate to data
We’re going to build part of the Starbuzz app
The drink detail activity
The Starbuzz app structure
Here are the steps
The Drink class
The image files
The top-level layout contains an image and a list
Use a list view to display the list of options
The full top-level layout code
Test drive
Get ListViews to respond to clicks with a Listener
Set the listener to the list view
The full TopLevelActivity code
Where we’ve got to
A category activity displays the data for a single category
A ListActivity is an activity that contains only a list
How to create a list activity
android:entries works for static array data held in strings.xml
Connect list views to arrays with an array adapter
Add the array adapter to DrinkCategoryActivity
What happens when you run the code
Test drive the app
App review: where we’ve got to
How we handled clicks in TopLevelActivity
Pass data to an activity using the ListActivity onListItemClick() method
The full DrinkCategoryActivity code
A detail activity displays data for a single record
Retrieve data from the intent
Update the views with the data
The DrinkActivity code
What happens when you run the app
The story continues
Test drive the app
Your Android Toolbox
Chapter 7 Fragments: Make it Modular
Your app needs to look great on all devices
Your app may need to behave differently too
Fragments allow you to reuse code
The Workout app structure
Here are the steps
The Workout class
How to add a fragment to your project
Fragment layout code looks just like activity layout code
What fragment code looks like
Adding a fragment to an activity’s layout
Passing the workout ID to the fragment
Get the activity to set the workout ID
Activity states revisited
The fragment lifecycle
Your fragment inherits the lifecycle methods
Set the view’s values in the fragment’s onStart() method
Test drive the app
Where we’ve got to
We need to create a fragment with a list
A ListFragment is a fragment that contains only a list
How to create a list fragment
We’ll use an ArrayAdapter to set the values in the ListView
The updated WorkoutListFragment code
Display WorkoutListFragment in the MainActivity layout
Test drive the app
Wiring up the list to the detail
We need to decouple the fragment with an interface
First, add the interface to the list fragment
Then make the activity implement the interface
You want fragments to work with the back button
Don’t update—instead, replace
Using fragment transactions
The updated MainActivity code
Test drive the app
Rotating the device breaks the app
The WorkoutDetailFragment code
Phone versus tablet
The phone and tablet app structures
Put screen-specific resources in screen-specific folders
The different folder options
Tablets use layouts in the layout-large folder
The MainActivity phone layout
Phones will use DetailActivity to display details of the workout
The full DetailActivity code
Use layout differences to tell which layout the device is using
The revised MainActivity code
Test drive the app
Your Android Toolbox
Chapter 8 Nested Fragments: Dealing with Children
Creating nested fragments
Fragments and activities have similar lifecycles...
The StopwatchFragment code
The StopwatchFragment layout
Adding the stopwatch fragment to WorkoutDetailFragment
Add a FrameLayout where the fragment should appear
Then display the fragment in Java code
getFragmentManager() creates transactions at the activity lavel
Nested fragments need nested transactions
Display the fragment in its parent’s onCreate() method
The full WorkoutDetailFragment code
Test drive the app
Why does the app crash if you press a button?
Let’s look at the StopwatchFragment layout code
The onClick attribute calls methods in the activity, not the fragment
First, remove the onClick attributes from the fragment’s layout
Make the fragment implement OnClickListener
Attach the OnClickListener to the buttons
The StopwatchFragment code
Test drive the app
Rotating the device re-creates the activity
onCreate() REPLACES the fragment
The WorkoutDetailFragment code
Test drive the app
Your Android Toolbox
Chapter 9 Action Bars: Taking Shortcuts
Great apps have a clear structure
Different types of navigation
Let’s start with the action bar
The Android support libraries
Your project may include support libraries
We’ll get the app to use up to date themes
Apply a theme in AndroidManifest.xml
Define styles in style resource files
Set the default theme in styles.xml
What happens when you run the app
Test drive the app
Adding action items to the action bar
The menu resource file
The menu showAsAction attribute
Add a new action item
Inflate the menu in the activity with the onCreateOptionsMenu() method
React to action item clicks with the onOptionsItemSelected() method
Create OrderActivity
Start OrderActivity with the Create Order action item
The full MainActivity.java code
Test drive the app
Sharing content on the action bar
Add a share action provider to menu_main.xml
Specify the content with an intent
The full MainActivity.java code
Test drive the app
Enabling Up navigation
Setting an activity’s parent
Adding the Up button
Test drive the app
Your Android Toolbox
Chapter 10 Navigation Drawers: Going Places
The Pizza app revisited
Navigation drawers deconstructed
The Pizza app structure
Create TopFragment
Create PizzaFragment
Create PastaFragment
Create StoresFragment
Add the DrawerLayout
The full code for activity_main.xml
Initialize the drawer’s list
Use an OnItemClickListener to respond to clicks in the list view
The selectItem() method so far
Changing the action bar title
Closing the navigation drawer
The updated MainActivity.java code
Get the drawer to open and close
Using an ActionBarDrawerToggle
Modifying action bar items at runtime
The updated MainActivity.java code
Enable the drawer to open and close
Syncing the ActionBarDrawerToggle state
The updated MainActivity.java code
Test drive the app
The title and fragment are getting out of sync
Dealing with configuration changes
Reacting to changes on the back stack
Adding tags to fragments
Find the fragment using its tag
The full MainActivity.java code
Test drive the app
Your Android Toolbox
Chapter 11 SQLite Databases: Fire Up the Database
Back to Starbuzz
Android uses SQLite databases to persist data
Android comes with SQLite classes
The current Starbuzz app structure
We’ll change the app to use a database
The SQLite helper manages your database
Create the SQLite helper
1. Specify the database
Inside a SQLite database
You create tables using Structured Query Language (SQL)
Insert data using the insert() method
Update records with the update() method
Multiple conditions
The StarbuzzDatabaseHelper code
What the SQLite helper code does
What if you need to change the database?
SQLite databases have a version number
Upgrading the database: an overview
The story continues....
How the SQLite helper makes decisions
Upgrade your database with onUpgrade()
Downgrade your database with onDowngrade()
Let’s upgrade the database
Upgrading an existing database
Renaming tables
The full SQLite helper code
The SQLite helper code (continued)
What happens when the code runs
Your Android Toolbox
Chapter 12 Cursors and Asynctasks: Connecting to Databases
The story so far...
We’ll change the app to use the database
The current DrinkActivity code
Get data from the database with a cursor
A query lets you say what records you want from the database
The SQLiteDatabase query() method lets you build SQL using a query builder
Specifying table and columns
Applying multiple conditions to your query
Order data in your query
Using SQL functions in queries
SQL GROUP BY and HAVING clauses
Get a reference to the database
getReadableDatabase() versus getWritableDatabase()
getReadableDatabase()
getWritableDatabase()
The code for getting a cursor
To read a record from a cursor, you first need to navigate to it
Navigating cursors
Getting cursor values
The DrinkActivity code
What we’ve done so far
The current DrinkCategoryActivity code
How do we replace the array data in the ListView?
A CursorAdapter reads just enough data
The story continues
A SimpleCursorAdapter maps data to views
Creating the SimpleCursorAdapter
Closing the cursor and database
The revised code for DrinkCategoryActivity
Test drive the app
Put important information in the top-level activity
Add favorites to DrinkActivity
Add a new column to the cursor
Respond to clicks to update the database
The DrinkActivity code
Display favorites in TopLevelActivity
Display the favorite drinks in activity_top_level.xml
What changes are needed for TopLevelActivity.java
The new top-level activity code
Test drive the app
Cursors don’t automatically refresh
Change the cursor with changeCursor()
The revised TopLevelActivity.java code
Test drive the app
Databases can make your app go in sloooo-moooo....
What code goes on which thread?
AsyncTask performs asynchronous tasks
The onPreExecute() method
The doInBackground() method
The onProgressUpdate() method
The onPostExecute() method
The AsyncTask class
Execute the AsyncTask
The DrinkActivity.java code
A summary of the AsyncTask steps
Your Android Toolbox
Chapter 13 Services: At Your Service
Services work behind the scenes
The started service app
We’re going to create an IntentService
The IntentService from 50,000 feet
How to log messages
The full DelayedMessageService code
You declare services in AndroidManifest.xml
Add a button to activity_main.xml
You start a service using startService()
Test drive the app
We want to send a message to the screen
onStartCommand() runs on the main thread
The full DelayedMessageService.java code
The application context
Test drive the app
Can we improve on using Toasts?
How you use the notification service
You create notifications using a notification builder
Getting your notification to start an activity
Send the notification using the notification service
The full code for DelayedMessageService.java
What happens when you run the code
The story continues
Test drive the app
Bound services are more interactive
The steps needed to create the OdometerService
Create a new Odometer project
How binding works
Define the Binder
Get the service to do something
The Service class has four key methods
Location, location, location...
Add the LocationListener to the service
Registering the LocationListener
Stop location updates when the service is destroyed
Tell the activity the distance traveled
The full OdometerService.java code
Update AndroidManifest.xml
Where we’ve got to
Update MainActivity’s layout
Create a ServiceConnection
Bind to the service when the activity starts
Display the distance traveled
The full MainActivity.java code
What happens when you run the code
The story continues
Test drive the app
Your Android Toolbox
Chapter 14 Material Design: Living in a Material World
Welcome to Material Design
CardViews and RecyclerViews
The Pizza app structure
Add the pizza data
Add the support libraries
Create the CardView
The full card_captioned_image.xml code
RecyclerViews use RecyclerView.Adapters
Create the basic adapter
Define the adapter’s ViewHolder
Create the ViewHolders
Each card view displays an image and a caption
Add the data to the card views
The full code for CaptionedImagesAdapter.java
Create the recycler view
Add the RecyclerView to the layout
The PizzaMaterialFragment.java code
A RecyclerView uses a layout manager to arrange its views
Specifying the layout manager
The full PizzaMaterialFragment.java code
Get MainActivity to use the new PizzaMaterialFragment
What happens when the code runs
The story continues
Test drive the app
Where we’ve got to
Create PizzaDetailActivity
What PizzaDetailActivity.java needs to do
The code for PizzaDetailActivity.java
Getting a RecyclerView to respond to clicks
You can listen to views from the adapter
Keep your adapters reusable
Add the interface to the adapter
Implement the listener in PizzaMaterialFragment.java
Test drive the app
Bring the content forward
The full code for fragment_top.xml
The full code for TopFragment.java
Test drive the app
Your Android Toolbox
Leaving town...
Appendix ART: The Android Runtime
What is the Android runtime (ART)?
Performance and size
Appendix ADB: The Android Debug Bridge
adb: your command-line pal
Running a shell
Get the output from logcat
And much, much more...
Appendix The Emulator: The Android Emulator
Why the emulator is so slow
How to speed up your Android development
Appendix Leftovers: The Top Ten Things (we didn’t cover)
1. Distributing your app
2. Content providers
3. The WebView class
4. Animation
5. Maps
6. Cursor loaders
7. Broadcast receivers
8. App widgets
9. NinePatch graphics
10. Testing

Address

73
Mandalay
4802

Alerts

Be the first to know and let us send you an email when E-shop 4 E-Learners posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Shortcuts

Share