SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
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?

Weitere ähnliche Inhalte

Was ist angesagt?

Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introductionWilliam Liang
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android applicationChirag Thaker
 
ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?Tetsuyuki Kobayashi
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Android Synopsis
Android SynopsisAndroid Synopsis
Android SynopsisNiraj Rahi
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating SystemBilal Mirza
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming SeminarNhat Nguyen
 
Android Multimedia Player Project Presentation
Android Multimedia Player Project PresentationAndroid Multimedia Player Project Presentation
Android Multimedia Player Project PresentationRashmi Gupta
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia FrameworkOpersys inc.
 
Android Internship report presentation
Android Internship report presentationAndroid Internship report presentation
Android Internship report presentationvinayh.vaghamshi _
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deploymenttechbed
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools OverviewMike Wolfson
 

Was ist angesagt? (20)

Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Android mp3 player
Android mp3 playerAndroid mp3 player
Android mp3 player
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android application
 
ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?ADB(Android Debug Bridge): How it works?
ADB(Android Debug Bridge): How it works?
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Android Synopsis
Android SynopsisAndroid Synopsis
Android Synopsis
 
Improve Android System Component Performance
Improve Android System Component PerformanceImprove Android System Component Performance
Improve Android System Component Performance
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming Seminar
 
Android Multimedia Player Project Presentation
Android Multimedia Player Project PresentationAndroid Multimedia Player Project Presentation
Android Multimedia Player Project Presentation
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Android Internship report presentation
Android Internship report presentationAndroid Internship report presentation
Android Internship report presentation
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deployment
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools Overview
 

Ähnlich wie Android Development in a Nutshell

Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
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
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answerskavinilavuG
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewAhsanul Karim
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android DevelopmentHayi Nukman
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app developmentAbhishekKumar4779
 
Android application development
Android application developmentAndroid application development
Android application developmentslidesuren
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfweerabahu
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A NutshellTed Chien
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
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
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
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
 

Ähnlich wie Android Development in a Nutshell (20)

Android studio
Android studioAndroid studio
Android studio
 
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
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
Begining Android Development
Begining Android DevelopmentBegining Android Development
Begining Android Development
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Seminar on android app development
Seminar on android app developmentSeminar on android app development
Seminar on android app development
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
Android application development
Android application developmentAndroid application development
Android application development
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Introduction to Android Development Part 1
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Android ppt
Android ppt Android ppt
Android ppt
 

Kürzlich hochgeladen

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Kürzlich hochgeladen (20)

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

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?