A Noob’S Guide To Android Application Development

100 %
0 %
Information about A Noob’S Guide To Android Application Development
Education

Published on February 27, 2009

Author: chuazy

Source: slideshare.net

Description

Slides for Singapore BarCamp3

A Noob’s Guide to Android Application Development By: Chua Zi Yong Singapore Android User Group www.codeandroid.org BarCamp Singapore 3 28/2/2009

Who am I? Student from NUS – Bioengineering Interest in mobile platforms C programming sellAndroid != false (Google can pay me if they want =D); Intent intent = new Intent(BarCamp3.this, ShareInterest.class); By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Student from NUS – Bioengineering

Interest in mobile platforms

C programming

sellAndroid != false (Google can pay me if they want =D);

Intent intent = new Intent(BarCamp3.this, ShareInterest.class);

What is in this presentation? Why Android? How to Get Started? “ Deep” Dive How to Publish? Resources Available Q&A

Why Android?

How to Get Started?

“ Deep” Dive

How to Publish?

Resources Available

Q&A

Why Android? I am cool! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Why Android? Open Market Place Instant publishing and feedback! You can create “ANYTHING” By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Open Market Place

Instant publishing and feedback!

You can create “ANYTHING”

Why Android? Background applications Finally useful apps fBook notification! Contextual based applications … .. yourapp.apk By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Background applications

Finally useful apps

fBook notification!

Contextual based applications

… .. yourapp.apk

Why Android? Develop on ANY platform FREE (no need to buy!) Windows Linux Mac By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Develop on ANY platform FREE (no need to buy!)

Windows

Linux

Mac

Why Android? Not just on mobile! Netbooks MIDs Desktop Phone?? By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Not just on mobile!

Netbooks

MIDs

Desktop Phone??

How to get started? Fix me! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

How to get started? Things to install (developer.android.com) Java Developers Kit (JDK ) Eclipse or any other IDE Android SDK Android Developers Tool (ADT) By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Things to install (developer.android.com)

Java Developers Kit (JDK )

Eclipse or any other IDE

Android SDK

Android Developers Tool (ADT)

“ Deep” Dive By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

“ Deep” Dive Applications in Java Import Java libraries Import Android libraries GUI Widgets Animation By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Applications in Java

Import Java libraries

Import Android libraries

GUI

Widgets

Animation

Starting an Application Activity Lifecyle void onCreate void onStart() void onRestart() void onResume()  void onPause() void onStop() void onDestroy() By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive

Starting an Application

Activity Lifecyle

void onCreate

void onStart()

void onRestart()

void onResume() 

void onPause()

void onStop()

void onDestroy()

Applications Fundamentals Activities (Application != Activity) What the user see on the screen 1 app can have multiple activities Draw using xml and call by Activity.setContentView() Services Runs in background indefinitely E.g. music playback even when activity is stopped Broadcast receivers does nothing but receive and react to broadcast announcements E.g. SMS receiver Content providers Data that can be accessed by the application SQlite or any file system By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive

Applications Fundamentals

Activities (Application != Activity)

What the user see on the screen

1 app can have multiple activities

Draw using xml and call by Activity.setContentView()

Services

Runs in background indefinitely

E.g. music playback even when activity is stopped

Broadcast receivers

does nothing but receive and react to broadcast announcements

E.g. SMS receiver

Content providers

Data that can be accessed by the application

SQlite or any file system

Applications Fundamentals Intent Intent object holds the content of the message E.g. intent is used when you want to start a new activity and intent will carry the name of the activity and content needed to be pass through Android Manifest Declaring the application's components e.g. libraries Identifying any permissions the application expects to be granted Mostly auto generated by ADT in Eclipse By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive

Applications Fundamentals

Intent

Intent object holds the content of the message

E.g. intent is used when you want to start a new activity and intent will carry the name of the activity and content needed to be pass through

Android Manifest

Declaring the application's components e.g. libraries

Identifying any permissions the application expects to be granted

Mostly auto generated by ADT in Eclipse

Example: PathFinder@SG extending ListActivity Package: com.pathfinder.sg CategoriesListActivity.java PlacesListActivity.java Services: MyPositionService .java (to obtain location from GPS, cell tower) Content Provider: xml file in /res/raw containing location data By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive

Example: PathFinder@SG extending ListActivity

Set view using ListAdapter (since this is ListActivity) Starting GPS/ntw service Staring the Application: OnCreate Android logging class for logcat on DDMS (debugging) By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive

Moving to Another Activity Using Intent By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Initialize intent variable: Intent(packageContext,  Class) Start activity Add extended content to be passed through intent: putExtra(String name, value) Bonus point: If you intend to end current activity and back to previous, use finish() instead “ Deep” Dive

Make sure you stop services that is not needed upon exit! i.e. GPS service will otherwise continue to run in background By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Remember to consider other parts of the lifecycle “ Deep” Dive

By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Android Manifest User permission needed Declare activities within the application “ Deep” Dive

Applications Debugging DDMS in Eclipse using ADB By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive

Applications Debugging

DDMS in Eclipse using ADB

How to Publish? By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

How to Publish? Export and signing your app Export your application from Eclipse project Application will be exported as .apk Sign myapp.apk with Keytool and Jarsigner (within JDK) Take note on validity date of private key during keygen – recommend at least “10000 days” http://developer.android.com/guide/publishing/app-signing.html By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Suggested commands $ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000 $ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name

Export and signing your app

Export your application from Eclipse project

Application will be exported as .apk

Sign myapp.apk with Keytool and Jarsigner (within JDK)

Take note on validity date of private key during keygen – recommend at least “10000 days”

http://developer.android.com/guide/publishing/app-signing.html

How to Publish? Publishing on Android Market Sign up as an Android developer at developer.android.com USD$25 sign up fee Upload and monitor! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Publishing on Android Market

Sign up as an Android developer at developer.android.com

USD$25 sign up fee

Upload and monitor!

How to Publish? Market Business Policies Payment - 70% developer 30% telco Currently paid apps in UK and US No obscene materials (porn etc) 24 hour return policy Dispute resolution handled by developer and user directly Google holds the right to remove application if found of violation http://www.codeandroid.org/forum/?wpforumaction=viewtopic&t=1.0 By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Market Business Policies

Payment - 70% developer 30% telco

Currently paid apps in UK and US

No obscene materials (porn etc)

24 hour return policy

Dispute resolution handled by developer and user directly

Google holds the right to remove application if found of violation

http://www.codeandroid.org/forum/?wpforumaction=viewtopic&t=1.0

Resources By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Resources Android Resources developer.android.com Open Source Codes for Android Application code.google.com/hosting/ Online Tutorials www.anddev.org Developers Group Google Group (Android Beginner, Developer, Discuss) Codeandroid.org (Singapore Android User Group) By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

Android Resources

developer.android.com

Open Source Codes for Android Application

code.google.com/hosting/

Online Tutorials

www.anddev.org

Developers Group

Google Group (Android Beginner, Developer, Discuss)

Codeandroid.org (Singapore Android User Group)

Resources GUI XML Tool for Android DroidDraw Hacking/Flashing Android ROMs XDA Developers List of all applications on Android Market http://www.cyrket.com/ By: Chua Zi Yong Singapore Android User Group www.codeandroid.org

GUI XML Tool for Android

DroidDraw

Hacking/Flashing Android ROMs

XDA Developers

List of all applications on Android Market

http://www.cyrket.com/

Q&A By: Chua Zi Yong Singapore Android User Group www.codeandroid.org ??

Add a comment

Related presentations

Related pages

A newbie's guide to Android development - TechRepublic

A newbie's guide to Android development. ... guides on the Internet for ... implementing Android applications. My goal with this guide is to ...
Read more

Noob's guide to Android App development | Step by Step ...

Noob's guide to Android App development Step by Step Guide to Android App Development ...
Read more

Android App Development Noob's Guide - YouTube

Android App Development Noob's Guide ... Setting up your Android Device in the developer options 10: ... Beginners Guide!
Read more

Introduction to Android | Android Developers

Android provides a rich application framework that allows you to build innovative ... Introduction to Android; ... If you're new to Android development, ...
Read more

App Components | Android Developers

API Guides; Reference; Tools; Google ... App Components. Android's application framework lets you create rich and ... Get the latest Android developer news ...
Read more

A Noob's Guide to Android Hacking - Hack My Android - All ...

A Noob’s Guide to Android Hacking. ... Backup SMS on Android. ... This can be don by Settings>Applications>Development and making sure that USB Debugging ...
Read more

Noob's Guide to a Droid X - Android Forum for Mobile ...

xda-developers Motorola Droid X Droid X General Noob's Guide to a ... into Settings-->Applications-->Development make ... Android Guides;
Read more

Android Application Development Tutorials - YouTube

thenewboston Official Android Application Development Playlist! ... Sign in now to see your channels and recommendations!
Read more

Android - A beginner's guide - CodeProject

Android - A beginner's guide. Felix Geilert, ... Covers the basics of Android application development (you don't even need an Android phone). Introduction.
Read more