Android Development in a Nutshell

Aleix Solé
Aleix SoléConsultor - Desenvolupador Linkat
Android development
       (in a nutshell)
●


                 ●
                     Guillem Mayol
                       ●
                           Aleix Solé


                     EETAC - DXAT
Overview
●
    What is Android
●
    Android Development
         ●
             App Fundamentals
         ●
             Framework API
         ●
             Framework API: Activities
         ●
             Framework API: Tasks
         ●
             Framework API: Services
         ●
             Framework API: Content Providers
         ●
             Framework API: Broadcast Receivers
         ●
             Framework API: AndroidManifest.xml
●
    A simple example
What is Android
●
    „Android is a software stack for mobile
    devices that includes an operating
    system, middleware and key
    applications.“
●
    Based on the Linux Kernel, open source
    libraries, an open source VM to abstract
    the phone features (Dalvik) and the
    programmable app framework
●
    All code is Apache v2 licensed
What is Android
Android Development
               App Fundamentals


●
    Apps are written in Java. → .apk files
●
    Each App has their Linux user ID. →
    permissions
●
    Each process has its own VM → isolation
●
    An App has only access to necessary
    components. → Security & Sharing
Android Development
                       Framework API
●
    An App can be composed by the next
    components:
       ●
           Activities : Single screen with user interface.
           Ex: Mail App → Its composed by several activities
             (List of mails, new message, …)
       ●
           Services : A component that runs in the backgroud.
           Ex: Listening music while the device is locked.
       ●
           Content Providers : Manages a shared set of App
             data.
           Ex: User's contact info. → ContactsContract.Data
       ●
           Broadcast Receivers : Allow to share
             announcements
Android Development
                         Framework API : Activities
●
    Activity States
    - Resumed (running)
    - Paused (another activity is visible on
    top of this one)
    *can be killed by System in low mem. Situation.

    - Stopped (in the backgroud)
●
    Activity Lifetime
    -Entire Lifetime      OnCreate() to OnDestroy()

    -Visible Lifetime      OnStart() to OnStop()

    -Foregroud      Lifetime    OnResume() to OnPause()
Android Development
                 Framework API : Tasks
●
    When an activity is launched, the previous ones are
    saved to BackStack.
●
    An activity can start activities that exist in other Apps.
    → A task is a collection of activities that users can
    interact with.
Android Development
                     Framework API : Services
●
    A Service is an App component running in the background and
    doesn't provide a user interface.
●
    A service can take two forms:
    - Started [startService()]: Indepently of
    father App (can run indefinitely).
    Usually a single operation. (Upload file)
    - Bound [bindService()]: Depends of
    father App.
    Usually offers Client-server interface.
●
    A service can work both ways with:
    onStartComand() & onBind()
Android Development
     Framework API: Contents Providers

●
    A Content Provider is an App component that
    stores and retrieves data and makes it accessible
    to all App.
●
    The data can be stored using Android's file
    storage or SQLite databases.
●
    Each Content Provider exposes a public URI.
    Ex: android.provider.Contacts.Phones.CONTENT_URI

●
    If you want to make own data public, you can:
      1. Create your own content provider.
      2. Add the data to an existing provider.
Android Development
         Framework API: Broadcast Receivers

●
    Most common: Notifications to user. It can be:
    1. Toast Notifications → SMS that pops up on screen.
                    Context context = getApplicationContext();
                    CharSequence text = "Hello toast!";
                    int duration = Toast.LENGTH_SHORT;
                    Toast toast = Toast.makeText(context, text,
                    duration);
                    toast.show();




    2. Status Bar Notifications → Adds an icon to
    the system's status bar with optional SMS.


    3. Dialog Notification
Android Development
        Framework API: AndroidManifest.xml File
●
     Every App must have this file in its root directory.
●
     The file contains components description of App.
●
     These declarations let the Android system know:
             ●
                 Components that can be used (GPS,...)
             ●
                 Under what conditions they can be launched
             ●
                 Permissions of the App. (interact with others)
             ●
                 Libraries of API (Google Maps)
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.android.snake">
        <application android:label="Snake on a Phone">
          <activity android:name="Snake"
            android:screenOrientation="portrait"
            android:configChanges="keyboardHidden|orientation">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest>
Android Development
                   Framework API
●
    SDK publicly available
       ●
           http://developer.android.com/sdk/
Android development
●
    After downloading the SDK tools, we also
    need the toolchain for debugging and
    loading code to targets, and the specific
    API for each Android release
       ●
           On linux (after extracting the SDK)
               ●
                   run tools/android
               ●
                   Install Platform-tools, SDK platform for
                     the desired Android version, code
                     samples and documentation
Android development
●
    Eclipse has a plugin specifically designed
    for Android development
       ●
           Eclipse-ADT
       ●
           http://developer.android.com
                  /sdk/eclipse-adt.html
       ●
           Repo a https://dl-ssl.google.com/android/eclipse/
●
    Since Android itself is open source, an
    NDK also exists for native development
       ●
           Development at the VM-level, outside
            the Java API, using C and C++
A simple example
1) Create a new virtual device target,
running some Android version
2) Create a new test project in Eclipse
from one of the SDK samples
3) Run it!
   ●
       It will automatically be loaded on the
         Virtual Device or on the plugged in
         physical device
   ●
       Device must run the Android version the
        sample code is developed for!
END
Do you have any questions?
1 de 17

Recomendados

Jenkins IntroductionJenkins Introduction
Jenkins IntroductionPavan Gupta
1.2K vistas26 diapositivas
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentationJonathan Holloway
13.8K vistas20 diapositivas
Android Basic Concept Android Basic Concept
Android Basic Concept University of Potsdam
2.6K vistas27 diapositivas
Android pptAndroid ppt
Android pptPrasadbharatiyudu
100.4K vistas24 diapositivas

Más contenido relacionado

La actualidad más candente

android architectureandroid architecture
android architectureAashita Gupta
22.4K vistas32 diapositivas
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To JenkinsKnoldus Inc.
23.1K vistas15 diapositivas
Android pptAndroid ppt
Android pptPooja Garg
36.8K vistas20 diapositivas
Jenkins presentationJenkins presentation
Jenkins presentationValentin Buryakov
1.4K vistas19 diapositivas

La actualidad más candente(20)

Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan25.1K vistas
android architectureandroid architecture
android architecture
Aashita Gupta22.4K vistas
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
Knoldus Inc.23.1K vistas
Android pptAndroid ppt
Android ppt
Pooja Garg36.8K vistas
Jenkins presentationJenkins presentation
Jenkins presentation
Valentin Buryakov1.4K vistas
DevOps: Age Of CI/CDDevOps: Age Of CI/CD
DevOps: Age Of CI/CD
MoogleLabs default129 vistas
Automotive androidAutomotive android
Automotive android
Godfrey Nolan2.8K vistas
Android pptAndroid ppt
Android ppt
Tarun Bamba5.8K vistas
Appium: Automation for Mobile AppsAppium: Automation for Mobile Apps
Appium: Automation for Mobile Apps
Sauce Labs27.8K vistas
Introduction to androidIntroduction to android
Introduction to android
zeelpatel05048.5K vistas
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
Hoang Le997 vistas
Jenkins OverviewJenkins Overview
Jenkins Overview
Ahmed M. Gomaa10.4K vistas
CICD with JenkinsCICD with Jenkins
CICD with Jenkins
Vietnam Open Infrastructure User Group1.4K vistas
Pulumi. Modern Infrastructure as Code.Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.
Yurii Bychenok683 vistas
Jenkins tutorialJenkins tutorial
Jenkins tutorial
HarikaReddy115465 vistas
An introduction to terraformAn introduction to terraform
An introduction to terraform
Julien Pivotto12.7K vistas
Basic android-pptBasic android-ppt
Basic android-ppt
Srijib Roy20.7K vistas
Jenkins CIJenkins CI
Jenkins CI
Viyaan Jhiingade1.1K vistas

Similar a Android Development in a Nutshell

Android studioAndroid studio
Android studioAndri Yabu
563 vistas34 diapositivas
Begining Android DevelopmentBegining Android Development
Begining Android DevelopmentHayi Nukman
1.5K vistas32 diapositivas

Similar a Android Development in a Nutshell(20)

Android studioAndroid studio
Android studio
Andri Yabu563 vistas
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
Kasun Dananjaya Delgolla1.2K vistas
Begining Android DevelopmentBegining Android Development
Begining Android Development
Hayi Nukman1.5K vistas
Seminar on android app developmentSeminar on android app development
Seminar on android app development
AbhishekKumar4779106 vistas
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
MIT Autonomous Aurangabad226 vistas
Android application developmentAndroid application development
Android application development
slidesuren1.8K vistas
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
weerabahu1.3K vistas
Android dev o_authAndroid dev o_auth
Android dev o_auth
fantasy zheng375 vistas
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
Ted Chien3K vistas
Android dev o_authAndroid dev o_auth
Android dev o_auth
lzongren625 vistas
Android ProgrammingAndroid Programming
Android Programming
Pasi Manninen5.2K vistas
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
Hussain Behestee455 vistas
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
Michael Angelo Rivera563 vistas
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1
Kainda Kiniel Daka674 vistas
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
Omolara Adejuwon598 vistas
Android ppt Android ppt
Android ppt
blogger at indiandswad307.3K vistas
Android ApplicationsAndroid Applications
Android Applications
Nazeer Hussain University211 vistas

Último(20)

Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum114 vistas
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh31 vistas
Green Leaf Consulting: Capabilities DeckGreen Leaf Consulting: Capabilities Deck
Green Leaf Consulting: Capabilities Deck
GreenLeafConsulting147 vistas
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web Developers
Maximiliano Firtman143 vistas
ThroughputThroughput
Throughput
Moisés Armani Ramírez25 vistas
MemVerge: Memory Viewer SoftwareMemVerge: Memory Viewer Software
MemVerge: Memory Viewer Software
CXL Forum106 vistas

Android Development in a Nutshell

  • 1. Android development (in a nutshell) ● ● Guillem Mayol ● Aleix Solé EETAC - DXAT
  • 2. Overview ● What is Android ● Android Development ● App Fundamentals ● Framework API ● Framework API: Activities ● Framework API: Tasks ● Framework API: Services ● Framework API: Content Providers ● Framework API: Broadcast Receivers ● Framework API: AndroidManifest.xml ● A simple example
  • 3. What is Android ● „Android is a software stack for mobile devices that includes an operating system, middleware and key applications.“ ● Based on the Linux Kernel, open source libraries, an open source VM to abstract the phone features (Dalvik) and the programmable app framework ● All code is Apache v2 licensed
  • 5. Android Development App Fundamentals ● Apps are written in Java. → .apk files ● Each App has their Linux user ID. → permissions ● Each process has its own VM → isolation ● An App has only access to necessary components. → Security & Sharing
  • 6. Android Development Framework API ● An App can be composed by the next components: ● Activities : Single screen with user interface. Ex: Mail App → Its composed by several activities (List of mails, new message, …) ● Services : A component that runs in the backgroud. Ex: Listening music while the device is locked. ● Content Providers : Manages a shared set of App data. Ex: User's contact info. → ContactsContract.Data ● Broadcast Receivers : Allow to share announcements
  • 7. Android Development Framework API : Activities ● Activity States - Resumed (running) - Paused (another activity is visible on top of this one) *can be killed by System in low mem. Situation. - Stopped (in the backgroud) ● Activity Lifetime -Entire Lifetime OnCreate() to OnDestroy() -Visible Lifetime OnStart() to OnStop() -Foregroud Lifetime OnResume() to OnPause()
  • 8. Android Development Framework API : Tasks ● When an activity is launched, the previous ones are saved to BackStack. ● An activity can start activities that exist in other Apps. → A task is a collection of activities that users can interact with.
  • 9. Android Development Framework API : Services ● A Service is an App component running in the background and doesn't provide a user interface. ● A service can take two forms: - Started [startService()]: Indepently of father App (can run indefinitely). Usually a single operation. (Upload file) - Bound [bindService()]: Depends of father App. Usually offers Client-server interface. ● A service can work both ways with: onStartComand() & onBind()
  • 10. Android Development Framework API: Contents Providers ● A Content Provider is an App component that stores and retrieves data and makes it accessible to all App. ● The data can be stored using Android's file storage or SQLite databases. ● Each Content Provider exposes a public URI. Ex: android.provider.Contacts.Phones.CONTENT_URI ● If you want to make own data public, you can: 1. Create your own content provider. 2. Add the data to an existing provider.
  • 11. Android Development Framework API: Broadcast Receivers ● Most common: Notifications to user. It can be: 1. Toast Notifications → SMS that pops up on screen. Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show(); 2. Status Bar Notifications → Adds an icon to the system's status bar with optional SMS. 3. Dialog Notification
  • 12. Android Development Framework API: AndroidManifest.xml File ● Every App must have this file in its root directory. ● The file contains components description of App. ● These declarations let the Android system know: ● Components that can be used (GPS,...) ● Under what conditions they can be launched ● Permissions of the App. (interact with others) ● Libraries of API (Google Maps) <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.snake"> <application android:label="Snake on a Phone"> <activity android:name="Snake" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
  • 13. Android Development Framework API ● SDK publicly available ● http://developer.android.com/sdk/
  • 14. Android development ● After downloading the SDK tools, we also need the toolchain for debugging and loading code to targets, and the specific API for each Android release ● On linux (after extracting the SDK) ● run tools/android ● Install Platform-tools, SDK platform for the desired Android version, code samples and documentation
  • 15. Android development ● Eclipse has a plugin specifically designed for Android development ● Eclipse-ADT ● http://developer.android.com /sdk/eclipse-adt.html ● Repo a https://dl-ssl.google.com/android/eclipse/ ● Since Android itself is open source, an NDK also exists for native development ● Development at the VM-level, outside the Java API, using C and C++
  • 16. A simple example 1) Create a new virtual device target, running some Android version 2) Create a new test project in Eclipse from one of the SDK samples 3) Run it! ● It will automatically be loaded on the Virtual Device or on the plugged in physical device ● Device must run the Android version the sample code is developed for!
  • 17. END Do you have any questions?