1. Introduction to Course(LEC#1)
• We will discus:
• Introduction to course(1.1)
• This course in for(1.2)
• Recipes of this course(1.3)
• Tips for get most of from this course(1.4)
3. This course is for(1.2)
• This course is for those who want to be a good android
developer and wants to use java as their programming language.
• This course will be easy for those who have some experience in
java.
• For those who have some knowledge about Android Studio
4. Recipes of this course(1.3)
• Introduction
1. Set up the environment
2. CreatingVirtual device
3. Run 1st program
4.Run program on Physical Device
5. Run Program onVirtual Device
6.Tips for using android studio Effectively
5. Recipes of this course(1.3)
• Activities
7. Declaring an activity
8. Starting a new activity with an intent object
9. Switching between activities
10.Passing data to another activity
11.Returning a result from an activity
12.Saving an activity's state
13.Storing persistent activity data
14.Understanding the activity lifecycle
6. Recipes of this course(1.3)
• Layouts
15.Defining and inflating a layout
16.Using RelativeLayout
17.Using LinearLayout
18.Creating tables –TableLayout and GridLayout
19.Using ListView, GridView, and Adapters
20.Changing layout properties during runtime
21.Optimizing layouts with the HierarchyViewer
7. Recipes of this course(1.3)
• Views,Widgets, and Styles
22.Inserting a widget into a layout
23.Using graphics to show the button state
24.Creating a widget at runtime
25.Creating a custom component
26.Applying a style to aView
27.Turning a style into a theme
28.Selecting a theme based on the Android OS version
8. Recipes of this course(1.3)
• Menus
29.Creating an Options menu
30.Modifying menus and menu items during runtime
31.EnablingContextual Action Mode for a view
32.Using Contextual Batch Mode with a ListView
33.Creating a pop-up menu
9. Recipes of this course(1.3)
• Exploring Fragments, AppWidgets, and the System UI
34.Creating and using a Fragment
35.Adding and removing Fragments during runtime
36.Passing data between Fragments
37.Creating a shortcut on the Home screen
38.Creating a Home screen widget
39.Adding Search to the Action Bar
40.Showing your app full screen
10. Recipes of this course(1.3)
• Working with Data
41.Storing simple data
42.Read and write a text file to internal storage
43.Read and write a text file to external storage
44.Including resource files in your project
45.Creating and using an SQLite database
46.Access data in the background using a Loader
11. Recipes of this course(1.3)
• Alerts and Notifications
47.Lights, Action, and Sound – getting the user's attention!
48.Creating aToast using a custom layout
49.Displaying a message box with AlertDialog
50.Displaying a progress dialog
51.Lights, Action, and Sound Redux using Notifications
52.Creating a Media Player Notification
53.Making a Flashlight with a Heads-Up Notification
12. Recipes of this course(1.3)
• Using theTouchscreen and Sensors
54.Listening for click and long-press events
55.Recognizing tap and other common gestures
56.Pinch-to-zoom with multi-touch gestures
57.Swipe-to-Refresh
58.Listing available sensors – an introduction to theAndroid Sensor
Framework
59.Reading sensor data – using the Android Sensor Framework events
60.Reading device orientation
13. Recipes of this course(1.3)
• Graphics and Animation
61.Scaling down large images to avoid Out of Memory exceptions
62.transition animation – defining scenes and applying a transition
63.Creating a Compass using sensor data and RotateAnimation
64.Creating a slideshow withViewPager
65.Creating a Card FlipAnimation with Fragments
66.Creating a Zoom Animation with a CustomTransition
14. Recipes of this course(1.3)
• A First Look at OpenGL ES
67.Setting up the OpenGL ES environment
68.Drawing shapes on GLSurfaceView
69.Applying projection and camera view while drawing
70.Moving the triangle with rotation
71.Rotating the triangle with user input
15. Recipes of this course(1.3)
• Multimedia
72.Playing sound effects with SoundPool
73.Playing audio with MediaPlayer
74.Responding to hardware media controls in your app
75.Taking a photo with the default camera app
76.Taking a photo using the (old) Camera API
77.Taking a photo using the Camera2 (the new) API
16. Recipes of this course(1.3)
• Telephony, Networks, and theWeb
78. How to make a phone call
79. Monitoring phone call events
80. How to send SMS (text) messages
81. Receiving SMS messages
82. Displaying a web page in your application
83. Checking online status and connection type
84. Getting started with Volley for Internet requests
85. Canceling a Volley request
86. Using Volley to request a JSON response
87. Using Volley to request an image
88. Using Volley's NetworkImageView and ImageLoader
17. Recipes of this course(1.3)
• Getting Location and Using Geofencing
89.How to get the last location
90.Resolving problems reported with the GoogleApiClient
OnConnectionFailedListener
91.How to receive location updates
92.Create and monitor a Geofence
18. Recipes of this course(1.3)
• Getting your app ready for the Play Store
93.The new Android 6.0 Run-Time permission model
94.How to schedule an alarm
95.Receive notification of device boot
96.Using AsyncTask for background work
97.Adding speech recognition to your app
98.Push Notification using Google Cloud Messaging
99.How to add Google sign-in to your app
19. Recipes of this course(1.3)
• The Backend as a Service(BaaS) Options
100.App42
101.Backendless
102.Buddy
103.Firebase
104.Kinvey
20. Tips to get most of from this course(1.4)
• Practice as a discuss
• 1st understand then write
• Comment if any query
• Follow all discussions
• Do not skip
• Try that concept by your self
21. Introduction recipes(2.0)
• Introduction
1. Set up the environment(2.1)
2. Run 1st program(2.2)
3. CreatingVirtual device(2.3)
4.Run program on Physical Device(2.4)
5. Run Program onVirtual Device(2.5)
6.Tips for using android studio Effectively(2.6)
22. Introduction recipe(2.0.0)
• What is Android?
• Android is an operating system and programming platform developed by
Google for smartphones and other mobile devices(such as tablets). I
• t can run on many different devices from many different manufacturers.
• Android includes a software development kit for writing original code and
assembling software modules to create apps for Android users.
• It also provides a marketplace to distribute apps.
• All together,Android represents an ecosystem for mobile apps.
23. Introduction recipe(2.0.1)
• Why develop apps for Android?
• Apps are developed for a variety of reasons:
• addressing business requirements, building new services, creating
new businesses, and providing games and other types of content
for users
• Developers choose to develop for Android in order to reach the
majority of mobile device users.
24. Introduction recipe(2.0.2)
• Most popular platform for mobile apps:
• As the world's most popular mobile platform, Android powers
hundreds of millions of mobile devices in more than 190 countries
around the world.
• It has the largest installed base of any mobile platform and is still
growing fast.
• Every day another million users power up their Android devices for
the first time and start looking for apps, games, and other digital
content.
25. Introduction recipe(2.0.3)
• Best experience for app users:
• Android provides a touch-screen user interface (UI) for interacting with
apps.
• Android's user interface is mainly based on direct manipulation, using
touch gestures such as swiping, tapping and pinching to manipulate
on-screen objects.
• In addition to the keyboard, there’s a customizable virtual keyboard for
text input.
• Android can also support game controllers and full-size physical
keyboards connected by Bluetooth or USB.
• Android can also play multimedia content such as music, animation,
and video.
26. Introduction recipe(2.0.3)
• Android is designed to provide immediate response to user input.
Besides a fluid touch interface, the vibration capabilities of an Android
device can provide haptic feedback.
• Internal hardware such as accelerometers, gyroscopes and proximity
sensors, are used by many apps to respond to additional user actions.
• These sensors can detect rotation of the screen
• from portrait to landscape for a wider view or it can allow the user to
steer a virtual vehicle in a racing game by rotating the device as if it
were a steering wheel.
• Android devices are usually battery-powered,Android is designed to
manage processes to keep power consumption at a minimum,
providing longer battery use.
27. Introduction recipe(2.0.4)
• Easy to develop apps:
• Use the Android software development kit (SDK) to develop apps that take
advantage of the Android operating system and UI.
• To develop apps using the SDK, use the Java programming language for
developing the app and Extensible Markup Language (XML) files for describing
data resources.
• By writing the code in Java and creating a single app binary, you will have an app
that can run on both phone and tablet form factors.
• Google offers a full Java Integrated Development Environment (IDE) called
Android Studio, with advanced features for developing, debugging, and
packaging Android apps.
• Android Studio, help to develop on any available Android device, or create
virtual devices that emulate any hardware configuration.
28. Introduction recipe(2.0.4)
• Android provides a rich development architecture.You don’t need
to know much about the components of this architecture, but it is
useful to know what is available in the system for your app to use.
29. Introduction recipe(2.0.5)
• Many distribution options:
• You can distribute your Android app in many different ways:
email, website or an app marketplace such as Google Play.
• Google Play is a digital distribution service, operated and
developed by Google, that serves as the official appstore for
Android, allowing consumers to browse and download apps
developed with the Android SDK and published through Google.
30. Introduction recipe(2.0.6)
• The challenges of Android app development:
• While the Android platform provide rich functionality for app
development, there are still a number of challenges you need to
address, such as:
• Building for a multi-screen world
• Getting performance right
• Keeping your code and your users secure
• Remaining compatible with older platform versions
• Understanding the market and the user.
32. Create new Project recipe(2.2)
• Create new ProjectTest(2.2.0)
• Name the projectTest
• Select Minimum support version
• ExploreAndroid Studio(2.2.1)
33. CreatingVirtual Device recipe(2.3)
• Create virtual Device
• CreateVirtual Device
• Select device
• Select device Version
• Download Version
• Run project onVirtual Device
34. Run Recipe on Physical Device(2.4)
• Run recipe on physical real device
• Connect your device with PC
• Take Cable
• Take android Device
• Connect Device with PC by cable
• Run Project
35. Tips for using Android Studio recipe(2.5)
• Tips for UsingAndroid Studio
1. Prioritize
2. ChangeThem to black
3. Increase font size
4. Auto Import
36. Activities Recipes(3.0)
• Activities
7. Declaring an activity (3.1)
8. Starting a new activity with an intent object (3.2)
9. Switching between activities (3.3)
10.Passing data to another activity (3.4)
11.Returning a result from an activity (3.5)
12.Saving an activity's state (3.6)
13.Storing persistent activity data (3.7)
14.Understanding the activity lifecycle (3.8)
37. Activities Recipes(3.0)
• An activity represents a single screen in your app with an
interface the user can interact with.
• Your app is a collection of activities that you either create
yourself, or that you reuse from other apps.
• activities in your app work together to form a cohesive user
experience in your app, each one is independent of the others.
This enables your app to start activities in other apps, and other
apps can start your activities (if your app allows it).
39. Activities Recipes(3.0)
• one activity in an app is specified as the "main" activity, which is
presented to the user when launching the application for the first
time. Each activity can then start other activities in order to
perform different actions.
• Each time a new activity starts, the previous activity is stopped,
but the system preserves the activity in a stack (the "back
stack").When the user is done with the current activity and
presses the Back button, it is popped from the stack (and
destroyed) and the previous activity resumes.
40. Declare An Activity(3.1)
1. Create new project named DeclareActivity
2. Launch MainActivity
3. Create New SecondActivity
4.Change launcher to second Activity from Manifest file
41. Starting a new Activity with an intent Recipe(3.2)
1. Understand Intent(R 3.2.0)
1. Intent ?
• Intents are message objects that make a request to the Android runtime to start an activity or other
app component in your app or in some other app.
2. Explicit Intent
• Explicit intents specify the receiving activity (or other component) by that activity's fully-qualified
class name. Use an explicit intent to start a component in your own app
3. Implicit Intent
• Implicit intents do not specify a specific activity or other component to receive the intent. Instead
you declare a general action to perform in the intent.
2. Create New Project Intent. (R 3.2.1)
3. Create other Activity SecondActivity.
4. Create a button to move to SecondActivity.
5. Launch App
6. Click button and go to SecondActivity.
42. Switch B/w Activities Recipe(3.3)
Understand Back Stack Operation in Android
• Create new Project SwitchActivities
• Create 2 more activities named SecondActivity,ThirdActivty.
• Use Explicit intent to switch.
• Create 1 button each to switch
• Main to 2nd
• 2nd to 3rd
• 3rd to main
• Set views to understand about current Activity & states
• Run app & use IT
• Understand the states of activities.
43. Passing data to an other activity Recipe(3.4)
1. Create new Project IntentData.
2. CreateTwo Activities one for sending data & other for receiving.
3. Create button for sending the data & text field for receiving the
data.
4.LaunchApp & Understand Operations by using.
44. Returning a result from a activity Recipe(3.5)
• Create Project Return Results with two Activities.
• One for sending the data & other for receiving.
• Create EditText field from which we will get results to 1st .
61. View,Widgets & Styles Recipes(5.0)
• Views,Widgets, and Styles
22.Inserting a widget into a layout (5.1)
23.Using graphics to show the button state (5.2)
24.Creating a widget at runtime (5.3)
25.Creating a custom component (5.4)
26.Applying a style to aView (5.5)
27.Turning a style into a theme (5.6)
28.Selecting a theme based on the Android OS version (5.7)
70. Menus Recipes(6.0)
• Menus
29.Creating an Options menu (6.1)
30.Modifying menus and menu items during runtime (6.2)
31.EnablingContextual Action Mode for a view (6.3)
32.Using Contextual Batch Mode with a ListView (6.4)
33.Creating a pop-up menu (6.5)
77. Exploring Fragments, AppWidgets, and the System UI recipes(7.0)
• Exploring Fragments, AppWidgets, and the System UI
34.Creating and using a Fragment (7.1)
35.Adding and removing Fragments during runtime (7.2)
36.Passing data between Fragments (7.3)
37.Creating a shortcut on the Home screen (7.4)
38.Creating a Home screen widget (7.5)
39.Adding Search to the Action Bar (7.6)
40.Showing your app full screen (7.7)
86. Working with data recipes(8.0)
• Working with Data
41.Storing simple data (8.1)
42.Read and write a text file to internal storage (8.2)
43.Read and write a text file to external storage (8.3)
44.Including resource files in your project (8.4)
45.Creating and using an SQLite database (8.5)
46.Access data in the background using a Loader (8.6)
93. Access data in the background using a Loader recipe(8.6)
94. Alerts and Notifications Recipes(9.0)
• Alerts and Notifications
47.Lights, Action, and Sound – getting the user's attention! (9.1)
48.Creating aToast using a custom layout (9.2)
49.Displaying a message box with AlertDialog (9.3)
50.Displaying a progress dialog (9.4)
51.Lights, Action, and Sound Redux using Notifications (9.5)
52.Creating a Media Player Notification (9.6)
53.Making a Flashlight with a Heads-Up Notification (9.7)
103. Using theTouchscreen and Sensors
Recipes(10.0)
• Using theTouchscreen and Sensors
54.Listening for click and long-press events (10.1)
55.Recognizing tap and other common gestures (10.2)
56.Pinch-to-zoom with multi-touch gestures (10.3)
57.Swipe-to-Refresh (10.4)
58.Listing available sensors – an introduction to theAndroid Sensor
Framework (10.5)
59.Reading sensor data – using theAndroid Sensor Framework events
(10.6)
60.Reading device orientation (10.7)
112. Graphics and Animation recipes(11.0)
• Graphics and Animation
61.Scaling down large images to avoid Out of Memory exceptions
(11.1)
62.transition animation – defining scenes and applying a transition
(11.2)
63.Creating a Compass using sensor data and RotateAnimation
(11.3)
64.Creating a slideshow withViewPager (11.4)
65.Creating a Card FlipAnimation with Fragments (11.5)
66.Creating a Zoom Animation with a CustomTransition (11.6)
119. Creating a Zoom Animation with a CustomTransition recipe(11.6)
120. A First Look at OpenGL ES Recipes(12.0)
• A First Look at OpenGL ES
67.Setting up the OpenGL ES environment (12.1)
68.Drawing shapes on GLSurfaceView (12.2)
69.Applying projection and camera view while drawing (12.3)
70.Moving the triangle with rotation (12.4)
71.Rotating the triangle with user input (12.5)
127. Multimedia recipes(13.0)
• Multimedia
72.Playing sound effects with SoundPool (13.1)
73.Playing audio with MediaPlayer (13.2)
74.Responding to hardware media controls in your app (13.3)
75.Taking a photo with the default camera app (13.4)
76.Taking a photo using the (old) Camera API (13.5)
77.Taking a photo using the Camera2 (the new) API (13.6)
135. Telephony, Networks, and theWeb Recipes (14.0)
• Telephony, Networks, and theWeb
78. How to make a phone call (14.1)
79. Monitoring phone call events (14.2)
80. How to send SMS (text) messages (14.3)
81. Receiving SMS messages (14.4)
82. Displaying a web page in your application (14.5)
83. Checking online status and connection type (14.6)
84. Getting started with Volley for Internet requests (14.7)
85. Canceling a Volley request (14.8)
86. Using Volley to request a JSON response(14.9)
87. Using Volley to request an image (14.10)
88. Using Volley's NetworkImageView and ImageLoader (14.11)
148. Getting Location and UsingGeofencing recipes(15.0)
• Getting Location and Using Geofencing
89.How to get the last location (15.1)
90.Resolving problems reported with the GoogleApiClient
OnConnectionFailedListener (15.2)
91.How to receive location updates (15.3)
92.Create and monitor a Geofence (15.4)
154. Getting your app ready for the Play Store recipes (16.0)
• Getting your app ready for the Play Store
93.The new Android 6.0 Run-Time permission model (16.1)
94.How to schedule an alarm (16.2)
95.Receive notification of device boot (16.3)
96.Using AsyncTask for background work (16.4)
97.Adding speech recognition to your app (16.5)
98.Push Notification using Google Cloud Messaging (16.6)
99.How to add Google sign-in to your app (16.7)
162. How to add google sign-in into your app recipe (16.7)
163. The BackendAs Service Options Recipes(17.0)
• The Backend as a Service Options
100.App42 (17.1)
101.Backendless (17.2)
102.Buddy (17.3)
103.Firebase (17.4)
104.Kinvey (17.5)
164. The BackendAs Service Options Recipe(17.0)
• As your application and user base grow, it's likely you'll want to
connect your app across devices and even users, such as a high
score leaderboard.You have two choices:
• Create and maintain your own server
• Use a Backend as a Service (BaaS) provider
165. The BackendAs Service Options Recipe(17.0)
• take a look at several BaaS providers with features specifically
targeting Android developers.
166. App42 Recipe(17.1)
• App42 is the BaaSAPI product of ShepHertz, a cloud provider
of multiple services, including gaming platforms, Platform as
a Service, and Marketing Analytics.
• They have a very rich feature set, including many services
especially useful for games.
167. App42 Recipe(17.1)
• The App42 Android SDK supports the following:
• User service
• Storage service (Storage as a service (SaaS) is a business model
in which a company leases or rents its storage infrastructure to
another company or individuals to store data.)
• Custom code service (Custom Programming means custom-
developed software and modifications to other software,
including Source Code, Object Code and related Documentation)
168. App42 Recipe(17.1)
• Push notification service (A push notification is a short in-app, or
web-based pop-up message. Push notifications are used for
various purposes: from sending system messages and in-app
updates to promotions.The key idea of sending push
notifications is to provide users with more value and keep them
engaged.)
• Event service (An instance or occasion of assistance received by a
client from a service provider.)
• Gift management service (A gift is property, money, or assets that
one person gives to another while receiving nothing or less than fair
market value in return.)
169. App42 Recipe(17.1)
• Timer service (Timer service is a JEE utility that can be used to schedule
notifications in enterprise applications. )
• Social service (Social services are a range of public services provided by the
government, private, profit and non-profit organizations.)
• A/B test service (A/B testing (also known as split testing or bucket testing) is a
method of comparing two versions of a webpage or app against each other to
determine which one performs better.)
• Buddy service (The buddy system is a procedure in which two individuals, the
"buddies", operate together as a single unit so that they are able to monitor and
help each other.)
• Avatar service (Graphical representation of user & user characters)
• Achievement service (An achievement is a great accomplishment—something
achieved with great effort or skill. )
170. App42 Recipe(17.1)
• Leaderboard service (It's a collection of high scores achieved in a
game session during a specific time segment in a specific portion of
a game for a specific set of users.)
• Reward service (something that is given in return for good or evil
done or received or that is offered or given for some service or
attainment the police offered a reward for his capture.)
• Upload service (Uploading means data is being sent from your
computer to the Internet. Examples of uploading include sending
email, posting photos on a social media site and using your
webcam.)
• Gallery service
171. App42 Recipe(17.1)
• Geo service ('Geo services' can be used to define an industry
encompassing all interactive digital mapping and location-
based services.)
• Session service (a session refers to a limited time of
communication between two systems. Some sessions involve a
client and a server, while other sessions involve two personal
computers. A common type of client/server session is aWeb or
HTTP session.)
172. App42 Recipe(17.1)
• Review service (A service review is a review of an
organization's services designed to identify
potential service delivery improvements.
• Cart service (CART Service means CommunicationAccess Real-
timeTranslation Service.CART Service provides instantaneous
translation of what is being said into visual print display so that it
can be read (instead of heard). CART Service is one means of
communication access for deaf or hard of hearing individuals
who read English fluently)
• Catalogue service
173. App42 Recipe(17.1)
• Message service (SMS (short message service) is
a text messaging service component of most telephone, Internet, and
mobile device systems.)
• Recommender service(The goal of a recommender system is to generate
meaningful recommendations to a collection of users for items or products
that might interest them.)
• Email service (Email services offer user-friendly features to
manage mailing lists, email design, and metrics to monitor your success.)
• Logging service (Logging as a service (LaaS) is an IT architectural model for
centrally ingesting and collecting any type of log files coming from any
given source or location; such as servers, applications, devices etc.)
174. App42 Recipe (Practical)
1. Create a new project in Android Studio and call it App42. Use the
default Phone &Tablet option and select Empty Activity when
prompted for ActivityType.
• Download and extract the App42 SDK from the following link:
• https://github.com/shephertz/App42_ANDROID_SDK/archive/master.z
ip
• After creating your App42 account
1. log in to the AppHQ ManagementConsole,
2. register your app.
• You will need the ApiKey and SecretKey.
175. App42 Recipe (Practical)
• To add support for App42 to your project, start by opening the Android
Manifest and following these steps:
1. Add the following permissions:
<uses-permission android:name= "android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2. Open the following folder in your file browser: <project folder>App42app libs
(if the libs folder does not exist, create it) and copy the App42_ANDROID-
CAMPAIGN_x.x.jar file to the applibs folder.
3. Open the app module's Gradle build file: build.gradle (Module: app) and add the
following to the dependencies section:
compile files('libs/App42_ANDROID-CAMPAIGN_x.x.jar')
176. App42 Recipe (Practical)
4. OpenActivityMain.java and add the following import:
import com.shephertz.app42.paas.sdk.android.App42API;
5. Add the following code to the onCreate() callback:
App42API.initialize(this, "YOUR_API_KEY",
"YOUR_SECRET_KEY");
6. You're ready to run the application on a device or emulator.