advance android application development workshop day 3
DESCRIPTION
10 Days Android Workshop at L J Institute of engineering and technology delivered by Cresco Solution visit: http://www.crescosolution.com/android-workshop-at-l-j-institute-of-engineering-and-technology-ahmedabad/TRANSCRIPT
![Page 1: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/1.jpg)
![Page 2: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/2.jpg)
• Each application runs it’s own process
• Each process has its own separate virtual machine
• Each application is assigned a unique linux user -ID
Application Fundamentals
www.crescosolution.com
![Page 3: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/3.jpg)
Application Fundamentals Types
www.crescosolution.com
Activity
Intent
Android Manifest
Content Provider
Service
Broadcast Receiver
![Page 4: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/4.jpg)
Activity
www.crescosolution.com
Basic component of most applications
Most applications have more than one activities that all start each other as needed
Each activity implements as a subclass of base Activity class.
Each activity is default window
The content of window is view or group of views
Example of views : text , buttons , scroll bars ,menu items etc…
Activity represents presentation layer in android UI.
![Page 5: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/5.jpg)
Intents
www.crescosolution.com
An Intent is exactly what it describes. It's an "intention" to do an action.
An Intent is a messaging object you can use to request an action from anotherapp component.
An Intent is basically a message to say you did or want something to happen.
Although intents facilitate communication between components in several ways.
![Page 6: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/6.jpg)
Types of Intents
www.crescosolution.com
•Specify the component to start by name 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
Explicit 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
Implicit intents
![Page 7: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/7.jpg)
Android Manifest
www.crescosolution.com
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.example.helloworld"android:versionCode="1" android:versionName="1.0" >
<uses-sdkandroid:minSdkVersion="8"android:targetSdkVersion="15" />
<application android:icon="@drawable/ic_launcher"android:label="@string/app_name"android:theme="@style/AppTheme" ><activity
android:name=".MainActivity"android:label="@string/title_activity_main" ><intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /></intent-filter>
</activity></application>
</manifest>
![Page 8: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/8.jpg)
Elements of Android Manifest File
www.crescosolution.com
•root element of the AndroidManifest.xml file
•It includes the namespace declaration
•It has package attribute that describes the package name of the activity class<manifest>
•contains several sub elements
•The commonly used attributes are of this element are icon, label, theme etc.<application>
•Each activity must be defined
•android:label represents a label for the activity, often displayed on the screen
•android:name represents a name for the activity class. It is required attribute<activity>
•describes the type of intent to which activity, service or broadcast receiver<intent-filter>
•It adds an action for the intent-filter
•intent-filter must have one or more action elements<action>
•It adds an category name to an intent-filter<category>
![Page 9: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/9.jpg)
Content Providers
www.crescosolution.com
Supplies data from one application to others on request
Such requests are handled by the methods of the ContentResolver class
A content provider can use different ways to store its data and the data can be stored in a database, in files, or even over a network
![Page 10: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/10.jpg)
Service
www.crescosolution.com
❏ Does not have visual interface❏ Runs in background indefinitely❏ Examples:
Playing Music
❏ You can bind to a an existing service and control its operation
❏ Content provider and intents are short lived but services are always running
❏ Suppose even you exit from app ,the background process running.
![Page 11: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/11.jpg)
Broadcast Receiver
www.crescosolution.com
Receive and react to
broadcast announcements
Extend the class BroadcastReceiver
Examples:
•Low battery, power connected, shutdown, time zone changed, etc.
A broadcast receiver is an Android component which allows you to register for system or application events.
![Page 12: Advance Android application development workshop day 3](https://reader036.vdocuments.us/reader036/viewer/2022062304/558fc3a71a28ab9c318b456a/html5/thumbnails/12.jpg)