SlideShare a Scribd company logo
Android Application
Fundamentals
• Basic Java Programming Language
• Basic Knowledge about XML
Example
App Components
• Activities
• Services
• Content Providers
• Broadcast Receivers
• Intents and Intents Filters
Activities & Services
Broadcast Receivers
& Content Providers
Activities Lifecycle
Intents and Intent Filters
• An Intent is a messaging object you can use to
request an action from another app component.
• Intent Types: 1. Explicit Intent 2. Implicit Intent
1. Explicit Intent: specify the component to start by
name (the fully-qualified class name). You'll typically
use an explicit intent to start a component in your
own app, because you know the class name of the
activity or service you want to start. For example,
start a new activity in response to a user action or
start a service to download a file in the background.
2. Implicit intents do not name a specific component, but instead declare a
general action to perform, which allows a component from another app to
handle it. For example, if you want to show the user a location on a map,
you can use an implicit intent to request that another capable app show a
specified location on a map.
Intent Filters:
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
Ex:
<data android:mimeType="application/vnd.google.panorama360+jpg"/>
<data android:mimeType="image/*"/>
<data android:mimeType="video/*"/>
Application Permission
• Requests a permission that the application must be
granted in order for it to operate correctly. Permissions
are granted by the user when the application is installed,
not while it's running
1. android.permission.CALL_EMERGENCY_NUMBERS
2. android.permission.READ_OWNER_DATA
3. android.permission.SET_WALLPAPER
4. android.permission.DEVICE_POWER
5. android.hardware.bluetooth
Views, Layouts and UI
Components
• Provides classes that expose basic user interface classes
that handle screen layout and interaction with the user
• Layouts:
Linear layout
Relative layout
Frame layout
UI Components
• Input Controls
Menu & Action bar
Android Version before 3.0
List view and Grid View
• Android List View is a view which groups several items and
display them in vertical scrollable list. The list items are
automatically inserted to the list using an Adapter that pulls
content from a source such as an array or database.
• An adapter actually bridges between UI components and the
data source that fill data into UI Component. Adapter can be
used to supply the data to like spinner, list view, grid view etc.
• The List View and Grid View are subclasses of Adapter View and
they can be populated by binding them to an Adapter, which
retrieves data from an external source and creates a View that
represents each data entry. Android provides several subclasses
of Adapter that are useful for retrieving different kinds of data and
building views for an Adapter View
Example:
String[] countryArray = {"India", "Pakistan", "USA",
"UK"};
ArrayAdapter adapter = new ArrayAdapter<String>(this, R.layout.ListView,
StringArray);
ListView listView = (ListView)
findViewById(R.id.listview);
listView.setAdapter(adapter);
Grid View
• Android GridView shows items in two-dimensional scrolling
grid (rows & columns) and the grid items are not
necessarily predetermined but they automatically inserted
to the layout using a ListAdapter
• An adapter actually bridges between UI components and
the data source that fill data into UI Component. Adapter
can be used to supply the data to like spinner, list view,
grid view etc.
• The ListView and GridView are subclasses of AdapterView
and they can be populated by binding them to an Adapter,
which retrieves data from an external source and creates a
View that represents each data entry.
public Integer[] mThumbIds = {
R.drawable.sample_2, R.drawable.sample_3,
R.drawable.sample_4, R.drawable.sample_5,
R.drawable.sample_6, R.drawable.sample_7,
R.drawable.sample_0, R.drawable.sample_1,
R.drawable.sample_2, R.drawable.sample_3,
R.drawable.sample_4, R.drawable.sample_5,
R.drawable.sample_6, R.drawable.sample_7,
R.drawable.sample_0, R.drawable.sample_1,
R.drawable.sample_2, R.drawable.sample_3,
R.drawable.sample_4, R.drawable.sample_5,
R.drawable.sample_6, R.drawable.sample_7
};
public View getView(int position, View convertView, ViewGroup parent)
{
ImageView imageView;
if (convertView == null) {
imageView = new ImageView(mContext);
imageView.setLayoutParams(new
GridView.LayoutParams(85, 85));
imageView.setScaleType(ImageView.ScaleType.CENT
ER_CROP);
imageView.setPadding(8, 8, 8, 8);
} else { imageView = (ImageView) convertView; }
imageView.setImageResource(mThumbIds[position]);
return imageView;
}
Tab layout & Swiper Views
• TabLayout provides a horizontal layout to display tabs
Swipe views
• Efficient navigation is one of the cornerstones of a well-
designed app.
Example Code:
Adding Styles and
Themes
• A style is a collection of properties that specify the look and
format for a view or window. A style can specify properties
such as height, padding, font color, font size, background
color, and much more. A style is defined in an XML resource
that is separate from the XML that specifies the layout.
Ex:
<TextView
style="@style/CodeFont"
android:text="@string/hello" />
END

More Related Content

What's hot

Android contentprovider
Android contentproviderAndroid contentprovider
Android contentproviderKrazy Koder
 
Secure Sharing PHI PCI PII -Android app_Content Provider
Secure Sharing PHI PCI PII -Android app_Content ProviderSecure Sharing PHI PCI PII -Android app_Content Provider
Secure Sharing PHI PCI PII -Android app_Content Provider
Avinash Sinha
 
Communication Diagram
Communication DiagramCommunication Diagram
Communication Diagram
University of Texas at Dallas
 
Recovered file 1
Recovered file 1Recovered file 1
Recovered file 1Uthara Iyer
 
SAP BO Web Intelligence Basics
SAP BO Web Intelligence BasicsSAP BO Web Intelligence Basics
SAP BO Web Intelligence Basics
Kiran Joy
 
Android Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intentsAndroid Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intents
Denis Minja
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questionsBilam
 
Ado
AdoAdo
4) databases
4) databases4) databases
4) databasestechbed
 

What's hot (11)

Android contentprovider
Android contentproviderAndroid contentprovider
Android contentprovider
 
Secure Sharing PHI PCI PII -Android app_Content Provider
Secure Sharing PHI PCI PII -Android app_Content ProviderSecure Sharing PHI PCI PII -Android app_Content Provider
Secure Sharing PHI PCI PII -Android app_Content Provider
 
Communication Diagram
Communication DiagramCommunication Diagram
Communication Diagram
 
Android Services
Android ServicesAndroid Services
Android Services
 
Recovered file 1
Recovered file 1Recovered file 1
Recovered file 1
 
SAP BO Web Intelligence Basics
SAP BO Web Intelligence BasicsSAP BO Web Intelligence Basics
SAP BO Web Intelligence Basics
 
Android Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intentsAndroid Bootcamp Tanzania:intents
Android Bootcamp Tanzania:intents
 
Asp net interview_questions
Asp net interview_questionsAsp net interview_questions
Asp net interview_questions
 
Ado
AdoAdo
Ado
 
4) databases
4) databases4) databases
4) databases
 
Apiload
ApiloadApiload
Apiload
 

Similar to Android Training Session 1

Day 5 android app code advancement
Day 5  android app code advancementDay 5  android app code advancement
Day 5 android app code advancement
FatimaYousif11
 
Android components
Android componentsAndroid components
Android components
NAVEENA ESWARAN
 
Android Development Tutorial
Android Development TutorialAndroid Development Tutorial
Android Development Tutorial
Germán Bringas
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
Tadas Jurelevičius
 
Interface Programming Android
Interface Programming AndroidInterface Programming Android
Interface Programming Android
Maksym Davydov
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
Daniela Da Cruz
 
Android list view tutorial by Javatechig
Android list view tutorial by JavatechigAndroid list view tutorial by Javatechig
Android list view tutorial by Javatechig
Javatechig Resources for Developers
 
Android session 2
Android session 2Android session 2
Android session 2
Ahesanali Suthar
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
Vivek Bhusal
 
Session 3 beccse
Session 3 beccseSession 3 beccse
Session 3 beccse
vin123456gangal
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdf
AbdullahMunir32
 
Session 3 android study jam
Session 3 android study jamSession 3 android study jam
Session 3 android study jam
AtharvKarbhari
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsia
Michael Angelo Rivera
 
Lecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile AppsLecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile Apps
Maksym Davydov
 
Data Transfer between activities and Database
Data Transfer between activities and Database Data Transfer between activities and Database
Data Transfer between activities and Database
faiz324545
 
Hello android world
Hello android worldHello android world
Hello android world
eleksdev
 
Beginning android
Beginning android Beginning android
Beginning android
Igor R
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
Muhammad Sajid
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
Muhammad Sajid
 

Similar to Android Training Session 1 (20)

Day 5 android app code advancement
Day 5  android app code advancementDay 5  android app code advancement
Day 5 android app code advancement
 
Android components
Android componentsAndroid components
Android components
 
Android Development Tutorial
Android Development TutorialAndroid Development Tutorial
Android Development Tutorial
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Interface Programming Android
Interface Programming AndroidInterface Programming Android
Interface Programming Android
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Android list view tutorial by Javatechig
Android list view tutorial by JavatechigAndroid list view tutorial by Javatechig
Android list view tutorial by Javatechig
 
Android session 2
Android session 2Android session 2
Android session 2
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
 
Session 3 beccse
Session 3 beccseSession 3 beccse
Session 3 beccse
 
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdfMobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 09 & 10.pdf
 
Session 3 android study jam
Session 3 android study jamSession 3 android study jam
Session 3 android study jam
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsia
 
Lecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile AppsLecture 05. UI programming for Mobile Apps
Lecture 05. UI programming for Mobile Apps
 
Data Transfer between activities and Database
Data Transfer between activities and Database Data Transfer between activities and Database
Data Transfer between activities and Database
 
Hello android world
Hello android worldHello android world
Hello android world
 
Beginning android
Beginning android Beginning android
Beginning android
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
 

Android Training Session 1

  • 1. Android Application Fundamentals • Basic Java Programming Language • Basic Knowledge about XML
  • 3.
  • 4. App Components • Activities • Services • Content Providers • Broadcast Receivers • Intents and Intents Filters
  • 8.
  • 9. Intents and Intent Filters • An Intent is a messaging object you can use to request an action from another app component. • Intent Types: 1. Explicit Intent 2. Implicit Intent 1. Explicit Intent: specify the component to start by name (the fully-qualified class name). You'll typically use an explicit intent to start a component in your own app, because you know the class name of the activity or service you want to start. For example, start a new activity in response to a user action or start a service to download a file in the background.
  • 10. 2. Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it. For example, if you want to show the user a location on a map, you can use an implicit intent to request that another capable app show a specified location on a map. Intent Filters: <intent-filter> <action android:name="android.intent.action.SEND"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="text/plain"/> </intent-filter> Ex: <data android:mimeType="application/vnd.google.panorama360+jpg"/> <data android:mimeType="image/*"/> <data android:mimeType="video/*"/>
  • 11. Application Permission • Requests a permission that the application must be granted in order for it to operate correctly. Permissions are granted by the user when the application is installed, not while it's running 1. android.permission.CALL_EMERGENCY_NUMBERS 2. android.permission.READ_OWNER_DATA 3. android.permission.SET_WALLPAPER 4. android.permission.DEVICE_POWER 5. android.hardware.bluetooth
  • 12. Views, Layouts and UI Components • Provides classes that expose basic user interface classes that handle screen layout and interaction with the user • Layouts:
  • 17. Menu & Action bar Android Version before 3.0
  • 18. List view and Grid View • Android List View is a view which groups several items and display them in vertical scrollable list. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database. • An adapter actually bridges between UI components and the data source that fill data into UI Component. Adapter can be used to supply the data to like spinner, list view, grid view etc. • The List View and Grid View are subclasses of Adapter View and they can be populated by binding them to an Adapter, which retrieves data from an external source and creates a View that represents each data entry. Android provides several subclasses of Adapter that are useful for retrieving different kinds of data and building views for an Adapter View
  • 19. Example: String[] countryArray = {"India", "Pakistan", "USA", "UK"}; ArrayAdapter adapter = new ArrayAdapter<String>(this, R.layout.ListView, StringArray); ListView listView = (ListView) findViewById(R.id.listview); listView.setAdapter(adapter);
  • 20. Grid View • Android GridView shows items in two-dimensional scrolling grid (rows & columns) and the grid items are not necessarily predetermined but they automatically inserted to the layout using a ListAdapter • An adapter actually bridges between UI components and the data source that fill data into UI Component. Adapter can be used to supply the data to like spinner, list view, grid view etc. • The ListView and GridView are subclasses of AdapterView and they can be populated by binding them to an Adapter, which retrieves data from an external source and creates a View that represents each data entry.
  • 21. public Integer[] mThumbIds = { R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7 }; public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); imageView.setScaleType(ImageView.ScaleType.CENT ER_CROP); imageView.setPadding(8, 8, 8, 8); } else { imageView = (ImageView) convertView; } imageView.setImageResource(mThumbIds[position]); return imageView; }
  • 22. Tab layout & Swiper Views • TabLayout provides a horizontal layout to display tabs
  • 23. Swipe views • Efficient navigation is one of the cornerstones of a well- designed app.
  • 25. Adding Styles and Themes • A style is a collection of properties that specify the look and format for a view or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that is separate from the XML that specifies the layout. Ex: <TextView style="@style/CodeFont" android:text="@string/hello" />
  • 26. END