SlideShare a Scribd company logo
1 of 35
Introduction to

Application Development

         Surendra Bajracharya
                Feb 4th, 2013
Android Development
                      Agenda

• What is Android?
• Installation (Eclipse)
• Android Application Fundamentals
• Hello World/Android Demo using Eclipse
• Demo using IntelliJ (Login UI)
• Google Maps application demo
• Comments/Feedback
Android Development
                  What is Android?
• Android is an open source operating system, created
by Google specifically for use on mobile devices (cell
phones and tablets)

• Linux based (2.6 kernel)

• Can be programmed in C/C++ but most app
development is done in Java (Java access to C Libraries
via JNI (Java Native Interface))
Android Development
      Android System Architecture
Android Development
                   Different Android Versions
Each major release is named in alphabetical order after a dessert or sugary treat; for
example, version 1.5 Cupcake was followed by 1.6 Donut.

Most Android devices to date still run the older OS version 2.3 Gingerbread that was
released on December 6, 2010, due to most lower-end devices still being released with it.
Android Development
              Installation (30 min ~ 1 hr)

• Eclipse
   – www.eclipse.org/downloads/
   – 3.5 or later version
   – Classic or a Java edition

• Android SDK and Android Development Tools (ADT)
Plugin
   – developer.android.com/sdk/requirements.html

• JDK, version 5, 6, or 7
Android Development
           Android ADT Plugin and SDK

• In Eclipse:
    – Navigate to Help | Install New Software
    – Follow the instructions on the android site to
    install the plugin.

• Point Eclipse to the location of the Android SDK:
   – In Eclipse, navigate to Preferences | Android
   – Browse to or enter the location in the “SDK Location”
   text field.
   – Apply, then OK
Android Development
Android Development
                 Install packages

•In Eclipse, navigate to Window | Android SDK
 Manager

• Install packages from the list
    – At least 2.2 and 2.3 for current phone
    development
    – One tablet package.
Android Development
Android Development

                 IntelliJ IDEA (another IDE)
•IntelliJ IDEA 12 offers advanced support for development Android
applications with the latest Android 4.2 SDK.
•Code Assistance
•Refactorings
•Deploy, run and debug Android applications either in emulator or on
a real device.
•UI Designer: With IntelliJ IDEA you can build rich UI for your Android
applications easily by drag and drop. The designer provides support
for layouts, custom components, device profiles, refactorings,
morphing and quick-fixes.
Android Development
         Android Application Fundamentals

•Android Applications are Collections of reusable
components.

•An Android App may have multiple entry points, and may
use components from other applications.

•In Android, the flow of user interaction across one or
more applications is called a “Task.”
Android Development
                       Application Components
 Activity
   ◦ Present a visual user interface for one focused endeavor the user can undertake
   ◦ Example: a list of menu items users can choose from
 Services
   ◦ Run in the background for an indefinite period of time
   ◦ Example: calculate and provide the result to activities that need it
 Broadcast Receivers
   ◦ Receive and react to broadcast announcements
   ◦ Example: announcements that the time zone has changed
 Content Providers
   ◦ Store and retrieve data and make it accessible to all applications
   ◦ Example: Android ships with a number of content providers for common data types
     (e.g., audio, video, images, personal contact information, etc.)
 Intents
   ◦ Hold the content of a message
   ◦ Example: convey a request for an activity to present an image to the user or let the
     user edit some text
Android Development

                     AndroidManifest.xml
•An application's contents are described in the AndroidManifest.xml
file.

•All Activities, Services, Content Providers, and Broadcast Receivers in
an app must have an entry in this file.

•Activities register the Intents they respond to using “Intent Filters”.

•Security permissions, version info, and the minimum sdk version are
also registered in AndroidManifest.xml.
Android Development

                             Resources
• An application's resources are described in .xml files in the /res
path

• Include UI layouts, drawables, values (such as strings and styles),
and even raw .xml files and other data.

• Resources are accessed using Context.getResources() and the
R class
    – The R class is defined in R.java, which is generated for each
    application.
    – Each resource is assigned a public static final int id (compile –
    time constant) in the R class.
Android Development

                             Activities
• An Activity is a unit of user interaction within an android
application.

• Activities are represented by the Activity class
    – All android apps subclass Activity
    – Activities have methods that can be overridden to detect stages
    in the activity lifecycle.
Android Development

                              Default android app
                     package com.sourceallies.helloworldandroidapp;          1. The Activity

                     import android.app.Activity;
                     import android.os.Bundle;

                      public class HelloActivity extends Activity {
                      /** Called when the activity is first created. */
                      @Override
                           public void onCreate(Bundle savedInstanceState) {
                               super.onCreate(savedInstanceState);
                                    setContentView(R.layout.activity_hello);
                            }
                       }                                           2. onCreate is a lifecycle
                                                                   method of the Activity
3. The content view of the
Activity is set to main.xml
Android Development
                      Lifecycle methods of Activity
•onCreate()
•onStart()
•onResume()
•onPause()
•onRestart()
•onStop()
•onRestart()

All lifecycle methods must
call through to super!

More Information:
http://developer.android.com
/reference/android/app
/Activity.html
Android Development

   Android Emulator: 2.2 Device
Android Development
                     Hello World/Android Demo...

• Create a new AVD (Android Virtual Device)
• Setup a new Android Project in Eclipse
• Write/run the program
                              Setting up an AVD
• Open Eclipse and go to the Window tab
• Select the AVD manager from the dropdown
• Once the AVD manager is open, click New
• Name your AVD, and then select a version of the Android API for
the device to use
• Click “Create AVD” – let’s say myAVD
•Can't find AVD or SDK manager in Eclipse - solve it by going to Window ->
Customize Perspective, and under Command Groups Availability tab check the Android SDK
and AVD Manager
Android Development
                   Making an Android Project
• In Eclipse, go to File->New->Project
• Next, open the Android Folder and select Android Project
• Setup your project, so it'll run on your AVD (name it, select API,
etc...)
Android Development
                    Producing an Android App

            javac
Java code             Byte code

                                         dx
  .java                  .class                   Dalvik exe

                                                  classes.dex       aapt


                         Byte code                  <xml>

                    Other .class files        AndroidManifest.xml
                                                                            .apk
                                                                     Android Package Kit
                                                        <str>
                                  Resources
Android Development
Android Development
                       Writing the Program
• Open the .java file created by the project
• Initially the code should look like this:
Android Development
                Writing the Program...continued
After the initial code of the .java file is generated, edit the code so
that it then looks like this:
Android Development
                         Running the App

• Once the program is complete, save it, and then go up to Run.
• Eclipse will then start an appropriate AVD and load the app onto the
emulator
• Once the file is installed on the AVD, it'll launch and you will have
completed your first HELLO world/Android app!
Android Development
Running the App

                       R.java
Do not
modify!




                    activity_hello.xml

                                         strings.xml
Android Development


              AndroidManifest.xml
Android Development
                           Important Files
src/HelloActivity.java
     Activity which is started when app executes
res/layout/activity_hello.xml
     Defines & lays out widgets for the activity
res/values/strings.xml
     String constants used by app
gen/R.java (Don’t touch!)
     Auto-generated file with identifiers from activity_hello.xml, strings.xml,
     and elsewhere
AndroidManifest.xml
     Declares all the app’s components
     Names libraries app needs to be linked against
     Identifies permissions the app expects to be granted
Android Development
                Various Layouts




http://developer.android.com/resources/tutorials/views/index.html
Android Development
                    Various Widgets




http://developer.android.com/resources/tutorials/views/index.html
Android Development
  Demo Using IntelliJ IDEA 12.0.1
Android Development
                  Google Maps Demo
https://developers.google.com/maps/documentation/android/v1/mapkey
Android Maps API Key: 0qMq9sUdrh4V367erwY0h76w-hXBG9kzeV1R8bg
Android Development
Android Development


          THANKS!!!
          Comments/Feedback
     sbajracharya@sourceallies.com

More Related Content

What's hot

Five android architecture
Five android architectureFive android architecture
Five android architectureTomislav Homan
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Android project architecture
Android project architectureAndroid project architecture
Android project architectureSourabh Sahu
 
Android architecture
Android architecture Android architecture
Android architecture Trong-An Bui
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsiaMichael Angelo Rivera
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfweerabahu
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureVijay Rastogi
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101Michael Angelo Rivera
 
Case Study: Cool Clock - An Intro to Android Development
Case Study: Cool Clock - An Intro to Android DevelopmentCase Study: Cool Clock - An Intro to Android Development
Case Study: Cool Clock - An Intro to Android DevelopmentRichard Creamer
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorialnazzf
 
Android application-component
Android application-componentAndroid application-component
Android application-componentLy Haza
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulatorguru472
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentRaman Pandey
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013DuckMa
 
03 Beginning Android Application Development
03 Beginning Android Application Development03 Beginning Android Application Development
03 Beginning Android Application DevelopmentArief Gunawan
 
Android programming
Android programmingAndroid programming
Android programmingvijay_uttam
 

What's hot (20)

Five android architecture
Five android architectureFive android architecture
Five android architecture
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Android project architecture
Android project architectureAndroid project architecture
Android project architecture
 
Android architecture
Android architecture Android architecture
Android architecture
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsia
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Android xml-based layouts-chapter5
Android xml-based layouts-chapter5Android xml-based layouts-chapter5
Android xml-based layouts-chapter5
 
Case Study: Cool Clock - An Intro to Android Development
Case Study: Cool Clock - An Intro to Android DevelopmentCase Study: Cool Clock - An Intro to Android Development
Case Study: Cool Clock - An Intro to Android Development
 
Training android
Training androidTraining android
Training android
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Android application-component
Android application-componentAndroid application-component
Android application-component
 
Android chapter02-setup2-emulator
Android chapter02-setup2-emulatorAndroid chapter02-setup2-emulator
Android chapter02-setup2-emulator
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 
03 Beginning Android Application Development
03 Beginning Android Application Development03 Beginning Android Application Development
03 Beginning Android Application Development
 
Android programming
Android programmingAndroid programming
Android programming
 

Viewers also liked

Android System Developement
Android System DevelopementAndroid System Developement
Android System DevelopementSiji Sunny
 
Android application developement seminar
Android application developement seminarAndroid application developement seminar
Android application developement seminarNiraj Narkhede
 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MBenjamin Cabé
 
Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Opersys inc.
 
Android Basic Development Day 1 Introduction & ADT
Android Basic Development Day 1 Introduction & ADTAndroid Basic Development Day 1 Introduction & ADT
Android Basic Development Day 1 Introduction & ADTEakapong Kattiya
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App DevelopmentTodd Burgess
 
Android application- Location Detection For Human Mobility
Android application- Location Detection For Human Mobility Android application- Location Detection For Human Mobility
Android application- Location Detection For Human Mobility Atul Chounde
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App DevelopmentAbhijeet Gupta
 
Fire Detector And Extinguisher Robot- Project Report
Fire Detector And Extinguisher Robot- Project ReportFire Detector And Extinguisher Robot- Project Report
Fire Detector And Extinguisher Robot- Project ReportRobolab Technologies Pvt. Ltd
 

Viewers also liked (9)

Android System Developement
Android System DevelopementAndroid System Developement
Android System Developement
 
Android application developement seminar
Android application developement seminarAndroid application developement seminar
Android application developement seminar
 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2M
 
Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012
 
Android Basic Development Day 1 Introduction & ADT
Android Basic Development Day 1 Introduction & ADTAndroid Basic Development Day 1 Introduction & ADT
Android Basic Development Day 1 Introduction & ADT
 
Introduction to Android App Development
Introduction to Android App DevelopmentIntroduction to Android App Development
Introduction to Android App Development
 
Android application- Location Detection For Human Mobility
Android application- Location Detection For Human Mobility Android application- Location Detection For Human Mobility
Android application- Location Detection For Human Mobility
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App Development
 
Fire Detector And Extinguisher Robot- Project Report
Fire Detector And Extinguisher Robot- Project ReportFire Detector And Extinguisher Robot- Project Report
Fire Detector And Extinguisher Robot- Project Report
 

Similar to Android application development

Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting StartedHemant Chhapoliya
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development PracticesRoy Clarkson
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversJagdish Gediya
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Mobile application development
Mobile application developmentMobile application development
Mobile application developmentumesh patil
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a NutshellAleix Solé
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopKasun Dananjaya Delgolla
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_programEyad Almasri
 
Android application development workshop day1
Android application development workshop   day1Android application development workshop   day1
Android application development workshop day1Borhan Otour
 
Session 2 prepare android development environment
Session 2   prepare android development environmentSession 2   prepare android development environment
Session 2 prepare android development environmentAdham Enaya
 
Introduction to Android Development Part 1
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1Kainda Kiniel Daka
 

Similar to Android application development (20)

Android studio
Android studioAndroid studio
Android studio
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a Nutshell
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Session 2 beccse
Session 2 beccseSession 2 beccse
Session 2 beccse
 
ANDROID PPT 1.pdf
ANDROID PPT 1.pdfANDROID PPT 1.pdf
ANDROID PPT 1.pdf
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
 
Android application development workshop day1
Android application development workshop   day1Android application development workshop   day1
Android application development workshop day1
 
Session 2 prepare android development environment
Session 2   prepare android development environmentSession 2   prepare android development environment
Session 2 prepare android development environment
 
Introduction to Android Development Part 1
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1
 
Synapseindia android apps application
Synapseindia android apps applicationSynapseindia android apps application
Synapseindia android apps application
 

Recently uploaded

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 

Recently uploaded (20)

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 

Android application development

  • 1. Introduction to Application Development Surendra Bajracharya Feb 4th, 2013
  • 2. Android Development Agenda • What is Android? • Installation (Eclipse) • Android Application Fundamentals • Hello World/Android Demo using Eclipse • Demo using IntelliJ (Login UI) • Google Maps application demo • Comments/Feedback
  • 3. Android Development What is Android? • Android is an open source operating system, created by Google specifically for use on mobile devices (cell phones and tablets) • Linux based (2.6 kernel) • Can be programmed in C/C++ but most app development is done in Java (Java access to C Libraries via JNI (Java Native Interface))
  • 4. Android Development Android System Architecture
  • 5. Android Development Different Android Versions Each major release is named in alphabetical order after a dessert or sugary treat; for example, version 1.5 Cupcake was followed by 1.6 Donut. Most Android devices to date still run the older OS version 2.3 Gingerbread that was released on December 6, 2010, due to most lower-end devices still being released with it.
  • 6. Android Development Installation (30 min ~ 1 hr) • Eclipse – www.eclipse.org/downloads/ – 3.5 or later version – Classic or a Java edition • Android SDK and Android Development Tools (ADT) Plugin – developer.android.com/sdk/requirements.html • JDK, version 5, 6, or 7
  • 7. Android Development Android ADT Plugin and SDK • In Eclipse: – Navigate to Help | Install New Software – Follow the instructions on the android site to install the plugin. • Point Eclipse to the location of the Android SDK: – In Eclipse, navigate to Preferences | Android – Browse to or enter the location in the “SDK Location” text field. – Apply, then OK
  • 9. Android Development Install packages •In Eclipse, navigate to Window | Android SDK Manager • Install packages from the list – At least 2.2 and 2.3 for current phone development – One tablet package.
  • 11. Android Development IntelliJ IDEA (another IDE) •IntelliJ IDEA 12 offers advanced support for development Android applications with the latest Android 4.2 SDK. •Code Assistance •Refactorings •Deploy, run and debug Android applications either in emulator or on a real device. •UI Designer: With IntelliJ IDEA you can build rich UI for your Android applications easily by drag and drop. The designer provides support for layouts, custom components, device profiles, refactorings, morphing and quick-fixes.
  • 12. Android Development Android Application Fundamentals •Android Applications are Collections of reusable components. •An Android App may have multiple entry points, and may use components from other applications. •In Android, the flow of user interaction across one or more applications is called a “Task.”
  • 13. Android Development Application Components  Activity ◦ Present a visual user interface for one focused endeavor the user can undertake ◦ Example: a list of menu items users can choose from  Services ◦ Run in the background for an indefinite period of time ◦ Example: calculate and provide the result to activities that need it  Broadcast Receivers ◦ Receive and react to broadcast announcements ◦ Example: announcements that the time zone has changed  Content Providers ◦ Store and retrieve data and make it accessible to all applications ◦ Example: Android ships with a number of content providers for common data types (e.g., audio, video, images, personal contact information, etc.)  Intents ◦ Hold the content of a message ◦ Example: convey a request for an activity to present an image to the user or let the user edit some text
  • 14. Android Development AndroidManifest.xml •An application's contents are described in the AndroidManifest.xml file. •All Activities, Services, Content Providers, and Broadcast Receivers in an app must have an entry in this file. •Activities register the Intents they respond to using “Intent Filters”. •Security permissions, version info, and the minimum sdk version are also registered in AndroidManifest.xml.
  • 15. Android Development Resources • An application's resources are described in .xml files in the /res path • Include UI layouts, drawables, values (such as strings and styles), and even raw .xml files and other data. • Resources are accessed using Context.getResources() and the R class – The R class is defined in R.java, which is generated for each application. – Each resource is assigned a public static final int id (compile – time constant) in the R class.
  • 16. Android Development Activities • An Activity is a unit of user interaction within an android application. • Activities are represented by the Activity class – All android apps subclass Activity – Activities have methods that can be overridden to detect stages in the activity lifecycle.
  • 17. Android Development Default android app package com.sourceallies.helloworldandroidapp; 1. The Activity import android.app.Activity; import android.os.Bundle; public class HelloActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_hello); } } 2. onCreate is a lifecycle method of the Activity 3. The content view of the Activity is set to main.xml
  • 18. Android Development Lifecycle methods of Activity •onCreate() •onStart() •onResume() •onPause() •onRestart() •onStop() •onRestart() All lifecycle methods must call through to super! More Information: http://developer.android.com /reference/android/app /Activity.html
  • 19. Android Development Android Emulator: 2.2 Device
  • 20. Android Development Hello World/Android Demo... • Create a new AVD (Android Virtual Device) • Setup a new Android Project in Eclipse • Write/run the program Setting up an AVD • Open Eclipse and go to the Window tab • Select the AVD manager from the dropdown • Once the AVD manager is open, click New • Name your AVD, and then select a version of the Android API for the device to use • Click “Create AVD” – let’s say myAVD •Can't find AVD or SDK manager in Eclipse - solve it by going to Window -> Customize Perspective, and under Command Groups Availability tab check the Android SDK and AVD Manager
  • 21. Android Development Making an Android Project • In Eclipse, go to File->New->Project • Next, open the Android Folder and select Android Project • Setup your project, so it'll run on your AVD (name it, select API, etc...)
  • 22. Android Development Producing an Android App javac Java code Byte code dx .java .class Dalvik exe classes.dex aapt Byte code <xml> Other .class files AndroidManifest.xml .apk Android Package Kit <str> Resources
  • 24. Android Development Writing the Program • Open the .java file created by the project • Initially the code should look like this:
  • 25. Android Development Writing the Program...continued After the initial code of the .java file is generated, edit the code so that it then looks like this:
  • 26. Android Development Running the App • Once the program is complete, save it, and then go up to Run. • Eclipse will then start an appropriate AVD and load the app onto the emulator • Once the file is installed on the AVD, it'll launch and you will have completed your first HELLO world/Android app!
  • 27. Android Development Running the App R.java Do not modify! activity_hello.xml strings.xml
  • 28. Android Development AndroidManifest.xml
  • 29. Android Development Important Files src/HelloActivity.java Activity which is started when app executes res/layout/activity_hello.xml Defines & lays out widgets for the activity res/values/strings.xml String constants used by app gen/R.java (Don’t touch!) Auto-generated file with identifiers from activity_hello.xml, strings.xml, and elsewhere AndroidManifest.xml Declares all the app’s components Names libraries app needs to be linked against Identifies permissions the app expects to be granted
  • 30. Android Development Various Layouts http://developer.android.com/resources/tutorials/views/index.html
  • 31. Android Development Various Widgets http://developer.android.com/resources/tutorials/views/index.html
  • 32. Android Development Demo Using IntelliJ IDEA 12.0.1
  • 33. Android Development Google Maps Demo https://developers.google.com/maps/documentation/android/v1/mapkey Android Maps API Key: 0qMq9sUdrh4V367erwY0h76w-hXBG9kzeV1R8bg
  • 35. Android Development THANKS!!! Comments/Feedback sbajracharya@sourceallies.com