SlideShare a Scribd company logo
Android
     Framework and Application
            Overview

                   By: Ashish Agrawal
Android Overview                    19/12/12   1
Agenda
    Mobile Application Development (MAD)
    Introduction to Android platform
    Platform architecture
    Application building blocks
    Lets Debug
    Development tools.




Android Overview                            19/12/12   2
Introduction to Android
    Open software platform for mobile development
    A complete stack – OS, Middleware, Applications
    Powered by Linux operating system
    Fast application development in Java
    Open source under the Apache 2 license




Android Overview                                19/12/12   3
Android Overview   19/12/12   4
Application Framework
 • API interface
 • Activity manager – manages application
   life cycle.




Android Overview                      19/12/12   5
Applications
  • Built in and user apps
  • Can replace built in apps




Android Overview                  19/12/12   6
Application Lifecycle
    Application run in their own processes (VM, PID)
    Processes are started and stopped as needed to run
        an application's components
    Processes may be killed to reclaim resources




Android Overview                                 19/12/12
                                                            7
Application Building Blocks
    Activity
    Fragments
    Intents
    Service (Working in the background)
    Content Providers
    Broadcast receivers
    Action bar

Android Overview                           19/12/12   8
Activities
    Typically correspond to one UI screen
    Run in the process of the .APK which installed them
    But, they can:
         Be faceless
         Be in a floating window
         Return a value




Android Overview                                   19/12/12   9
Android Overview   19/12/12
                              10
Fragments
Fragment represents a behavior or a portion of user interface in an Activity.
You can combine multiple fragments in a single activity to build a multi-pane
UI and reuse a fragment in multiple activities.




 Android Overview                                            19/12/12     11
Fragments




Android Overview               19/12/12   12
Intents
    An intent is an abstract description of an operation to be performed.
    Launch an activity
    Explicit
        Ex: Intent intent = new Intent(MyActivity.this, MyOtherActivity.class)
    Implicit : Android selects the best
        Ex: Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(“tel:

                           555-2368”));
    startActivity()
    Extra parameter Ex: intent.putExtra(name, property);


Android Overview                                                   19/12/12
                                                                                 13
Intent Filter
    Register Activities, Services, and Broadcast Receivers as
        being capable of performing an action on a particular
        kind of data.
    Components that respond to broadcast ‘Intents’
    Way to respond to external notification or alarms
    Apps can invent and broadcast their own Intent




Android Overview                                      19/12/12
                                                                 14
Services
    Faceless components that run in the background
    No GUI, higher priority than inactive Activities
    Usage:  responding to events, polling for data, updating
        Content Providers.  However, all in the main thread
    E.g. music player, network download etc…
        Intent service = new Intent(context,
        WordService.class);

        context.startService(service);

Android Overview                                      19/12/12
                                                                 15
Using the Service

  Start the service
      Intent serviceIntent = new Intent();

      serviceIntent.setAction

      ("com.wissen.testApp.service.MY_SERVICE");

       startService(serviceIntent);




Android Overview                               19/12/12
                                                          16
Bind the service
  ServiceConnection conn = new ServiceConnection() {
               @Override
               public void onServiceConnected(ComponentName
  name, IBinder service) {
               }
               @Override
               public void
  onServiceDisconnected(ComponentName arg0) {
               }
       }
  bindService(new
  Intent("com.testApp.service.MY_SERVICE"), conn,
  Context.BIND_AUTO_CREATE);
  }
Android Overview                                    19/12/12
                                                             17
Async Task

   Asycn task enables easy and proper use of UI
   thread. This class allows to perform background
   operations and publish results on the main thread.




Android Overview                             19/12/12
                                                        18
Async Task (Example)
   private class DownloadFilesTask extends AsyncTask<URL, Integer, Long> {
      protected Long doInBackground(URL... urls) {
       int count = urls.length;
         long totalSize = 0;
         for (int i = 0; i < count; i++) {
            totalSize += Downloader.downloadFile(urls[i]);
            publishProgress((int) ((i / (float) count) * 100));
         }
         return totalSize;
      }

      protected void onProgressUpdate(Integer... progress) {
        setProgressPercent(progress[0]);
      }

        protected void onPostExecute(Long result) {
           showDialog("Downloaded " + result + " bytes");
        }
Android Overview
    }
                                                                19/12/12
                                                                             19
ContentProviders
    Enables sharing of data across applications
         E.g. address book, photo gallery
    Provides uniform APIs for:
         querying
         delete, update and insert.
    Content is represented by URI and MIME type




Android Overview                                   19/12/12
                                                              20
Example
    private void displayRecords() {
         String columns[] = new String[] { People.NAME,
   People.NUMBER };
        Uri mContacts = People.CONTENT_URI;
        Cursor cur = managedQuery(mContacts, columns, null, null,
   null );
         if (cur.moveToFirst()) {
             String name = null;
             String phoneNo = null;
             do {
    name = cur.getString(cur.getColumnIndex(People.NAME));
               phoneNo =
   cur.getString(cur.getColumnIndex(People.NUMBER));
   } while (cur.moveToNext());
         }
      }

Android Overview                                         19/12/12
                                                                    21
Broadcast Receivers
 A broadcast receiver is a class which extends
  BroadcastReceiver and which is registered as a receiver in an
  Android Application via the AndroidManifest.xml file(or via
  code).
 <receiver android:name="MyPhoneReceiver">
    <intent-filter>
       <action

   android:name="android.intent.action.PHONE_STATE">
        </action>
     </intent-filter>
   </receiver>
Android Overview                                  19/12/12
                                                             22
Broadcast Receivers
 public class MyBroadcastReceiver extends BroadcastReceiver
   {
     @Override
     public void onReceive(Context context, Intent intent) {
        Toast.makeText(context,
   ”BR.”,Toast.LENGTH_LONG).show();
     }
   }




Android Overview                                   19/12/12
                                                               23
ActionBar




Android Overview               19/12/12
                                          24
ActionBar
 Home Icon area: The icon on the top left-hand side of the action
  bar is sometimes called the “Home” icon.
 Title area: The Title area displays the title for the action bar.
 Tabs area: The Tabs area is where the action bar paints the list
  of tabs specified. The content of this area is variable.
 Action Icon area: Following the Tabs area, the Action Icon area
  shows some of the option menu items as icons.
 Menu Icon area: The last area is the Menu area. It is a single
  standard menu icon.



Android Overview                                     19/12/12
                                                                25
Debugging

   •Reading and Writing Logs
        Log.d("MyActivity”, position);

   •adb logcat
   • Toast :
         Toast toast = Toast.makeText(context, text, duration);

         toast.show();

Android Overview                                     19/12/12
                                                                26
Debugging Cont.

   •Hierarchy Viewer
   •Connect your device or launch an emulator.
   •If you have not done so already, install the application
   you want to work with.
   •Run the application, and ensure that its UI is visible.
   •From a terminal, launch hierarchyviewer




Android Overview                                     19/12/12
                                                                27
Debugging Cont.

      adb shell dumpsys activity




Android Overview                     19/12/12
                                                28
Debugging Cont.
   Profiling for memory




Android Overview                     19/12/12
                                                29
Development Tools

       Eclipse

       developer.android.com




Android Overview                   19/12/12
                                              30
Thank You.




Android Overview                19/12/12
                                           31

More Related Content

Similar to Android overview

Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
easychen
 
Android developer interview questions with answers pdf
Android developer interview questions with answers pdfAndroid developer interview questions with answers pdf
Android developer interview questions with answers pdf
azlist247
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginnerAjailal Parackal
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
Jagdish Gediya
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
Abid Khan
 
Android studio
Android studioAndroid studio
Android studio
Andri Yabu
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
kavinilavuG
 
android.ppt
android.pptandroid.ppt
android.ppt
ShivamChaturvedi67
 
Lecture-3.ppt
Lecture-3.pptLecture-3.ppt
Lecture-3.ppt
ShivamChaturvedi67
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
Arun David Johnson R
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
dineshkumar periyasamy
 
Android the future
Android  the futureAndroid  the future
Android the future
Sanjeev Kumar Jaiswal
 
ハンズオン資料 電話を作ろう(v2.x用)
ハンズオン資料 電話を作ろう(v2.x用)ハンズオン資料 電話を作ろう(v2.x用)
ハンズオン資料 電話を作ろう(v2.x用)
Kenji Sakashita
 
All about android
All about androidAll about android
All about android
Inimitable Harish
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbai
vibrantuser
 
Getting Started with Android 1.5
Getting Started with Android 1.5Getting Started with Android 1.5
Getting Started with Android 1.5
Gaurav Kohli
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Best android classes in mumbai
Best android classes in mumbaiBest android classes in mumbai
Best android classes in mumbai
Vibrant Technologies & Computers
 

Similar to Android overview (20)

Android应用开发简介
Android应用开发简介Android应用开发简介
Android应用开发简介
 
Android developer interview questions with answers pdf
Android developer interview questions with answers pdfAndroid developer interview questions with answers pdf
Android developer interview questions with answers pdf
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android studio
Android studioAndroid studio
Android studio
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
android.ppt
android.pptandroid.ppt
android.ppt
 
Lecture-3.ppt
Lecture-3.pptLecture-3.ppt
Lecture-3.ppt
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android the future
Android  the futureAndroid  the future
Android the future
 
ハンズオン資料 電話を作ろう(v2.x用)
ハンズオン資料 電話を作ろう(v2.x用)ハンズオン資料 電話を作ろう(v2.x用)
ハンズオン資料 電話を作ろう(v2.x用)
 
All about android
All about androidAll about android
All about android
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbai
 
Getting Started with Android 1.5
Getting Started with Android 1.5Getting Started with Android 1.5
Getting Started with Android 1.5
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Best android classes in mumbai
Best android classes in mumbaiBest android classes in mumbai
Best android classes in mumbai
 

More from Ashish Agrawal

Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.
Ashish Agrawal
 
5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal
Ashish Agrawal
 
7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...
Ashish Agrawal
 
E paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescueE paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescue
Ashish Agrawal
 
Gcm and share point integration
Gcm and share point integrationGcm and share point integration
Gcm and share point integration
Ashish Agrawal
 
Agile QA process
Agile QA processAgile QA process
Agile QA process
Ashish Agrawal
 
Odata batch processing
Odata batch processingOdata batch processing
Odata batch processing
Ashish Agrawal
 
Side loading
Side loadingSide loading
Side loading
Ashish Agrawal
 
Client certificate validation in windows 8
Client certificate validation in windows 8Client certificate validation in windows 8
Client certificate validation in windows 8
Ashish Agrawal
 
Lync integration with metro app
Lync integration with metro appLync integration with metro app
Lync integration with metro app
Ashish Agrawal
 
E learning-for-all-devices
E learning-for-all-devicesE learning-for-all-devices
E learning-for-all-devices
Ashish Agrawal
 

More from Ashish Agrawal (11)

Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.
 
5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal
 
7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...
 
E paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescueE paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescue
 
Gcm and share point integration
Gcm and share point integrationGcm and share point integration
Gcm and share point integration
 
Agile QA process
Agile QA processAgile QA process
Agile QA process
 
Odata batch processing
Odata batch processingOdata batch processing
Odata batch processing
 
Side loading
Side loadingSide loading
Side loading
 
Client certificate validation in windows 8
Client certificate validation in windows 8Client certificate validation in windows 8
Client certificate validation in windows 8
 
Lync integration with metro app
Lync integration with metro appLync integration with metro app
Lync integration with metro app
 
E learning-for-all-devices
E learning-for-all-devicesE learning-for-all-devices
E learning-for-all-devices
 

Recently uploaded

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 

Android overview

  • 1. Android Framework and Application Overview By: Ashish Agrawal Android Overview 19/12/12 1
  • 2. Agenda  Mobile Application Development (MAD)  Introduction to Android platform  Platform architecture  Application building blocks  Lets Debug  Development tools. Android Overview 19/12/12 2
  • 3. Introduction to Android  Open software platform for mobile development  A complete stack – OS, Middleware, Applications  Powered by Linux operating system  Fast application development in Java  Open source under the Apache 2 license Android Overview 19/12/12 3
  • 4. Android Overview 19/12/12 4
  • 5. Application Framework • API interface • Activity manager – manages application life cycle. Android Overview 19/12/12 5
  • 6. Applications • Built in and user apps • Can replace built in apps Android Overview 19/12/12 6
  • 7. Application Lifecycle  Application run in their own processes (VM, PID)  Processes are started and stopped as needed to run an application's components  Processes may be killed to reclaim resources Android Overview 19/12/12 7
  • 8. Application Building Blocks  Activity  Fragments  Intents  Service (Working in the background)  Content Providers  Broadcast receivers  Action bar Android Overview 19/12/12 8
  • 9. Activities  Typically correspond to one UI screen  Run in the process of the .APK which installed them  But, they can:  Be faceless  Be in a floating window  Return a value Android Overview 19/12/12 9
  • 10. Android Overview 19/12/12 10
  • 11. Fragments Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. Android Overview 19/12/12 11
  • 13. Intents  An intent is an abstract description of an operation to be performed.  Launch an activity  Explicit Ex: Intent intent = new Intent(MyActivity.this, MyOtherActivity.class)  Implicit : Android selects the best Ex: Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(“tel: 555-2368”));  startActivity()  Extra parameter Ex: intent.putExtra(name, property); Android Overview 19/12/12 13
  • 14. Intent Filter  Register Activities, Services, and Broadcast Receivers as being capable of performing an action on a particular kind of data.  Components that respond to broadcast ‘Intents’  Way to respond to external notification or alarms  Apps can invent and broadcast their own Intent Android Overview 19/12/12 14
  • 15. Services  Faceless components that run in the background  No GUI, higher priority than inactive Activities  Usage:  responding to events, polling for data, updating Content Providers.  However, all in the main thread  E.g. music player, network download etc… Intent service = new Intent(context, WordService.class); context.startService(service); Android Overview 19/12/12 15
  • 16. Using the Service Start the service Intent serviceIntent = new Intent(); serviceIntent.setAction ("com.wissen.testApp.service.MY_SERVICE"); startService(serviceIntent); Android Overview 19/12/12 16
  • 17. Bind the service ServiceConnection conn = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { } @Override public void onServiceDisconnected(ComponentName arg0) { } } bindService(new Intent("com.testApp.service.MY_SERVICE"), conn, Context.BIND_AUTO_CREATE); } Android Overview 19/12/12 17
  • 18. Async Task Asycn task enables easy and proper use of UI thread. This class allows to perform background operations and publish results on the main thread. Android Overview 19/12/12 18
  • 19. Async Task (Example) private class DownloadFilesTask extends AsyncTask<URL, Integer, Long> { protected Long doInBackground(URL... urls) { int count = urls.length; long totalSize = 0; for (int i = 0; i < count; i++) { totalSize += Downloader.downloadFile(urls[i]); publishProgress((int) ((i / (float) count) * 100)); } return totalSize; } protected void onProgressUpdate(Integer... progress) { setProgressPercent(progress[0]); } protected void onPostExecute(Long result) { showDialog("Downloaded " + result + " bytes"); } Android Overview } 19/12/12 19
  • 20. ContentProviders  Enables sharing of data across applications  E.g. address book, photo gallery  Provides uniform APIs for:  querying  delete, update and insert.  Content is represented by URI and MIME type Android Overview 19/12/12 20
  • 21. Example private void displayRecords() { String columns[] = new String[] { People.NAME, People.NUMBER }; Uri mContacts = People.CONTENT_URI; Cursor cur = managedQuery(mContacts, columns, null, null, null ); if (cur.moveToFirst()) { String name = null; String phoneNo = null; do { name = cur.getString(cur.getColumnIndex(People.NAME)); phoneNo = cur.getString(cur.getColumnIndex(People.NUMBER)); } while (cur.moveToNext()); } } Android Overview 19/12/12 21
  • 22. Broadcast Receivers  A broadcast receiver is a class which extends BroadcastReceiver and which is registered as a receiver in an Android Application via the AndroidManifest.xml file(or via code).  <receiver android:name="MyPhoneReceiver"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE"> </action> </intent-filter> </receiver> Android Overview 19/12/12 22
  • 23. Broadcast Receivers  public class MyBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, ”BR.”,Toast.LENGTH_LONG).show(); } } Android Overview 19/12/12 23
  • 25. ActionBar  Home Icon area: The icon on the top left-hand side of the action bar is sometimes called the “Home” icon.  Title area: The Title area displays the title for the action bar.  Tabs area: The Tabs area is where the action bar paints the list of tabs specified. The content of this area is variable.  Action Icon area: Following the Tabs area, the Action Icon area shows some of the option menu items as icons.  Menu Icon area: The last area is the Menu area. It is a single standard menu icon. Android Overview 19/12/12 25
  • 26. Debugging •Reading and Writing Logs Log.d("MyActivity”, position); •adb logcat • Toast : Toast toast = Toast.makeText(context, text, duration); toast.show(); Android Overview 19/12/12 26
  • 27. Debugging Cont. •Hierarchy Viewer •Connect your device or launch an emulator. •If you have not done so already, install the application you want to work with. •Run the application, and ensure that its UI is visible. •From a terminal, launch hierarchyviewer Android Overview 19/12/12 27
  • 28. Debugging Cont. adb shell dumpsys activity Android Overview 19/12/12 28
  • 29. Debugging Cont. Profiling for memory Android Overview 19/12/12 29
  • 30. Development Tools Eclipse developer.android.com Android Overview 19/12/12 30

Editor's Notes

  1. Dalvik VM Dex files Compact and efficient than class files Limited memory and battery power Core Libraries Java 5 Std edition Collections, I/O etc…