Professional Documents
Culture Documents
Fafadia Tech
Rohan Bomle (rohan@fafadia-tech.com)
Android
What is Android?
• A software platform and operating system for mobile
devices
• Android SDK
• Class Library
• Developer Tools
dx – Dalvik Cross-Assembler
aapt – Android Asset Packaging Tool
adb – Android Debug Bridge
ddms – Dalvik Debug Monitor Service
• Emulator and System Images
• Documentation and Sample Code
• You should now see the new site added to the search list (and
checked). Press Finish.
In the subsequent Search Results dialog box, select the checkbox
for Android Plugin > Eclipse Integration > Android Development
Tools and press Next.
• Read the license agreement and then select Accept terms of the
license agreement, if appropriate. Press Next. Press Finish.
The ADT plugin is not signed; you can accept the installation
anyway by pressing Install All.
Restart Eclipse.
Android applications have common structure
Activity
Activity is
is the
the presentation
presentation
layer
layer of
of your
your app:
app: there
there will
will
be
be one
one per
per screen,
screen, and
and the
the
Views
Views provide
provide the
the UI
UI to
to the
the
activity
activity
Intents
Intents specify
specify what
what specific
specific
action
action should
should be
be performed
performed
Services
Services run
run in
in the
the
background
background andand have
have no
no
UI
UI for
for the
the user
user –– they
they will
will
update
update data,
data, and
and trigger
trigger
events
events
There is a common file structure for
applications
code
Autogenerated
files resource list
images
UI layouts
constants
Standard components form building blocks for
Android apps
Notifications
Has life-cycle
Activity
screen
Views
App to handle content
Intents
Background app
Service Like music player
manifest
import android.app.Activity;
import android.os.Bundle;
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my_domain.app.helloactivity">
<application android:label="@string/app_name">
<activity android:name=".HelloActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000044">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
Creating and Running simple HelloWorld application
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Toast.makeText(getBaseContext(),“Wlecome to Hello
World”,Toast.LENGTH_SHORT).show();
}
}
Run HelloWorld application
• Android uses SQLite for its database needs. SQLite is a very fast
and lightweight database.