fundamentals & services

7

Upload: jetti-chowdary

Post on 13-Jul-2015

506 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Fundamentals & Services
Page 2: Fundamentals & Services

Fundamentals There are some key components that developers need to

understand before they can begin to write Apps.

Fundamental things of android are similar to JSP and Servlets in J2EE

Android has

Views

Activities

Intents

Content Providers

Services

AndroidManifest.xml

Page 3: Fundamentals & Services

Views The concept of a view in J2EE and Swing carries

over to Android. Views are UI elements that form the basic building blocks of a user interface Example of views are:TextButton Controls List ControlsGrid ControlsDate and Time Controls .

Page 4: Fundamentals & Services

Contents Providers Data sharing among mobile applications on a device is

common.

Android defines a standard mechanism for applications to share data (such as a list of contacts) without exposing the underlying storage, structure, and implementation

Through content providers, you can expose your data and have your applications use data from other applications.

Page 5: Fundamentals & Services

Service Services in Android resemble services you see in

Windows or other platforms

They’re background processes that can potentially run for a long time

Android defines two types of services

Local Services

Remote Services

Local services are components that are only accessible by the application that is hosting the service.

Page 6: Fundamentals & Services

Service Cont… Remote services are services that are meant to be accessed

remotely by other applications running on the device.

Example is mobile phone camera-battery

Any Class by inheriting a Service class becomes a Service

When a class extends Service class it must override onCreate() , onStart() & onDestroy() methods

When a Service is Called it first calls the onCreate() method and then the onStart() method and finally onDestroy()

All the Services must be registered in manifest.xml file

Page 7: Fundamentals & Services

Service Cont.. This can be done by using the syntax

<service android:name="StockQuoteService">

</service>

You can call the Local Service by using the

startService() method.

You can call the Remote Service by using the

bindService() method.