SlideShare a Scribd company logo
Android Application
Fundamentals
• Basic Java Programming Language
• Basic Knowledge about XML
Example
Android Training Session 1
App Components
• Activities
• Services
• Content Providers
• Broadcast Receivers
• Intents and Intents Filters
Activities & Services
Broadcast Receivers
& Content Providers
Activities Lifecycle
Android Training Session 1
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

PPTX
Android Trainning Session 2
PPTX
Android Training (Content Provider)
PPTX
Android Insights - 3 [Content Providers]
PPTX
Android content provider explained
PPTX
Custom content provider in android
PPTX
05 content providers - Android
PPT
android content providers
PPTX
Day 15: Content Provider: Using Contacts API
Android Trainning Session 2
Android Training (Content Provider)
Android Insights - 3 [Content Providers]
Android content provider explained
Custom content provider in android
05 content providers - Android
android content providers
Day 15: Content Provider: Using Contacts API

What's hot (11)

PDF
Android contentprovider
PDF
Secure Sharing PHI PCI PII -Android app_Content Provider
PDF
Communication Diagram
PPTX
Android Services
PPTX
Recovered file 1
PPTX
SAP BO Web Intelligence Basics
PPT
Android Bootcamp Tanzania:intents
PDF
Asp net interview_questions
DOC
PPT
4) databases
TXT
Android contentprovider
Secure Sharing PHI PCI PII -Android app_Content Provider
Communication Diagram
Android Services
Recovered file 1
SAP BO Web Intelligence Basics
Android Bootcamp Tanzania:intents
Asp net interview_questions
4) databases
Ad

Similar to Android Training Session 1 (20)

PPTX
Unit 2 part for information technology1 4.pptx
PPTX
Day 5 android app code advancement
PPTX
Lec-3-Mobile Application Development.pptx
PPTX
Modul 2.pptxhelllojobbigtufytfythjgjhbknkjlnlk
PPTX
Android components
PPTX
Adapter and adapter views that are used in android
PDF
Android Development Tutorial
PPT
"Android" mobilių programėlių kūrimo įvadas #2
PDF
Interface Programming Android
PPTX
chp 4 UI component hdjdjdduudfinalt.pptx
PDF
Android Introduction
DOCX
Android list view tutorial by Javatechig
PPTX
Android Chapter 4 part2 Types of View and View group
PDF
Android session 2
ODP
Android training day 2
PDF
Introduction to Andriod Studio Lecture note: Android Development Lecture 1.pdf
PPTX
Session 3 beccse
PDF
Mobile Application Development -Lecture 09 & 10.pdf
PDF
Session 3 android study jam
PPT
Android application development for TresmaxAsia
Unit 2 part for information technology1 4.pptx
Day 5 android app code advancement
Lec-3-Mobile Application Development.pptx
Modul 2.pptxhelllojobbigtufytfythjgjhbknkjlnlk
Android components
Adapter and adapter views that are used in android
Android Development Tutorial
"Android" mobilių programėlių kūrimo įvadas #2
Interface Programming Android
chp 4 UI component hdjdjdduudfinalt.pptx
Android Introduction
Android list view tutorial by Javatechig
Android Chapter 4 part2 Types of View and View group
Android session 2
Android training day 2
Introduction to Andriod Studio Lecture note: Android Development Lecture 1.pdf
Session 3 beccse
Mobile Application Development -Lecture 09 & 10.pdf
Session 3 android study jam
Android application development for TresmaxAsia
Ad

Recently uploaded (6)

DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
DOC
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
PPTX
ASMS Telecommunication company Profile
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
PDF
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
PPTX
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
证书学历UoA毕业证,澳大利亚中汇学院毕业证国外大学毕业证
ASMS Telecommunication company Profile
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
6-UseCfgfhgfhgfhgfhgfhfhhaseActivity.pdf
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx

Android Training Session 1

  • 1. Android Application Fundamentals • Basic Java Programming Language • Basic Knowledge about XML
  • 4. App Components • Activities • Services • Content Providers • Broadcast Receivers • Intents and Intents Filters
  • 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