android - pune gtug

52
Programming on Android By Rohit Ghatol From Pune Google Technology User Group http://pune-gtug.blogspot.com http://blog.punegtug.org

Upload: rohit-ghatol

Post on 06-May-2015

974 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Android - Pune GTUG

Programming on Android

By Rohit GhatolFrom

Pune Google Technology User Grouphttp://pune-gtug.blogspot.com

http://blog.punegtug.org

Page 2: Android - Pune GTUG

What is Pune-GTUG?

GTUG stands for Google Technology User Group

http://blog.punegtug.org

Page 3: Android - Pune GTUG

Programming on Android

http://blog.punegtug.org

Page 4: Android - Pune GTUG

Topics

• What is Android?• Android Architecture• Building blocks• Programming Basics• Sample Application• Questions and Answers

http://blog.punegtug.org

Page 5: Android - Pune GTUG

What is Android?

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

http://blog.punegtug.org

Page 6: Android - Pune GTUG

What is Android?

Features• Application framework enabling reuse and replacement of components• Dalvik virtual machine optimized for mobile devices• Integrated browser based on the open source WenKit engine• Optimized graphics powered by a custom 2D graphics library; 3D graphics based on

the OpenGL ES 1.0 specification (hardware acceleration optional)• SQLite for structured data storage• Media support for common audio, video, and still image formats (MPEG4, H.264,

MP3, AAC, AMR, JPG, PNG, GIF)• GSM Telephony (hardware dependent)• Bluetooth, EDGE, 3G, and WiFi (hardware dependent)• Camera, GPS, compass, and accelerometer (hardware dependent)• Rich development environment including a device emulator, tools for debugging,

memory and performance profiling, and a plugin for the Eclipse IDE

http://blog.punegtug.org

Page 7: Android - Pune GTUG

Topics

• What is Android?• Android Architecture• Building blocks• Programming Basics• Sample Application• Questions and Answers

http://blog.punegtug.org

Page 8: Android - Pune GTUG

Android Architecture

http://blog.punegtug.org

Page 9: Android - Pune GTUG

Topics

• What is Android?• Android Architecture• Building blocks• Programming Basics• Sample Application• Questions and Answers

http://blog.punegtug.org

Page 10: Android - Pune GTUG

Building Blocks

http://blog.punegtug.org

Activity

Media Player Screen

Service

Background Service

Content ProviderBroadcast Receivers

MP3 DownloadedMusic Directory

Page 11: Android - Pune GTUG

Intent

Building Blocks – The Glue

http://blog.punegtug.org

What do I want to do?

Intent helps in • Launching Activities and Services• Application taking action on an event• Reusing building blocks (not code)

What if I want to send my mp3 file to my friend?• Do I write the email logic in my app?• How do I reuse existing email app?

• Explicit Intents• Implicit Intents

Page 12: Android - Pune GTUG

Topics

• What is Android?• Android Architecture• Building blocks• Programming Basics• Sample Application• Questions and Answers

http://blog.punegtug.org

Page 13: Android - Pune GTUG

Programming Basics

• Android SDK provides followingo An Emulatoro Command line tools to control emulatoro Eclipse Plugin (downloaded separately)o Direct Testing of application on Mobile Devices

http://blog.punegtug.org

Page 14: Android - Pune GTUG

Programming basics

http://blog.punegtug.org

Page 15: Android - Pune GTUG

Programming basics

http://blog.punegtug.org

Page 16: Android - Pune GTUG

Programming basics

http://blog.punegtug.org

Main Screen(Activity)

Main Config File

Layout File

Generated from res directory

Page 17: Android - Pune GTUG

Programming basics

HelloWorld.javapackage com.punegtug.helloworld;import android.app.Activity;import android.os.Bundle;public class HelloWorld extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }}

http://blog.punegtug.org

Page 18: Android - Pune GTUG

Programming basics

main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello"/></LinearLayout>

http://blog.punegtug.org

Page 19: Android - Pune GTUG

Programming basics

http://blog.punegtug.org

Page 20: Android - Pune GTUG

Programming basics

http://blog.punegtug.org

Page 21: Android - Pune GTUG

Topics

• What is Android?• Android Architecture• Building blocks• Programming Basics• Sample Applications• Questions and Answers

http://blog.punegtug.org

Page 22: Android - Pune GTUG

Digg

http://blog.punegtug.org

Page 23: Android - Pune GTUG

Digg in Action

http://blog.punegtug.org

Page 24: Android - Pune GTUG

Digg in Action

http://blog.punegtug.org

Page 25: Android - Pune GTUG

Del.icio.us

http://blog.punegtug.org

Page 26: Android - Pune GTUG

Del.icio.us in action

http://blog.punegtug.org

Page 27: Android - Pune GTUG

Del.icio.us in action

http://blog.punegtug.org

Page 28: Android - Pune GTUG

Del.icio.us in action

http://blog.punegtug.org

Page 29: Android - Pune GTUG

Del.icio.us in action

http://blog.punegtug.org

Page 30: Android - Pune GTUG

GodSpeed Application In Action

Page 31: Android - Pune GTUG

GodSpeed Application In Action

Page 32: Android - Pune GTUG

GodSpeed Application In Action

Page 33: Android - Pune GTUG

GodSpeed Application In Action

Page 34: Android - Pune GTUG

GodSpeed Application In Action

Page 35: Android - Pune GTUG

GodSpeed Application In Action

Page 36: Android - Pune GTUG

GodSpeed Application In Action

Page 37: Android - Pune GTUG

GodSpeed Application In Action

Page 38: Android - Pune GTUG

GodSpeed Application In Action

Page 39: Android - Pune GTUG

GodSpeed Application In Action

Page 40: Android - Pune GTUG

GodSpeed Application In Action

Page 41: Android - Pune GTUG

GodSpeed Application In Action

Page 42: Android - Pune GTUG

GodSpeed Application In Action

Page 43: Android - Pune GTUG

GodSpeed Application In Action

Page 44: Android - Pune GTUG

GodSpeed Application In Action

Page 45: Android - Pune GTUG

GodSpeed Application In Action

Page 46: Android - Pune GTUG

GodSpeed Application In Action

Page 47: Android - Pune GTUG

GodSpeed Application In Action

Page 48: Android - Pune GTUG

GodSpeed Application In Action

Page 49: Android - Pune GTUG

GodSpeed Application In Action

Page 50: Android - Pune GTUG

GodSpeed Application In Action

Page 51: Android - Pune GTUG

GodSpeed Application In Action

Page 52: Android - Pune GTUG

Questions?

?

http://blog.punegtug.org