Android Services. Services
|
|
|
- Elisabeth Cooper
- 10 years ago
- Views:
Transcription
1 Android Notes are based on: Android Developers Android Android A Service is an application component that runs in the background, not interacting with the user, for an indefinite period of time. Note that services, like other application objects, run in the main thread of their hosting process. This means that, if your service is going to do any CPU intensive (such as MP3 playback) or blocking (such as networking) operations, it should spawn its own thread in which to do that work. Each service class must have a corresponding <service> declaration in its package's AndroidManifest.xml. can be started with Context.startService() and Context.bindService(). 2
2 22. Android Android Multiple calls to Context.startService() do not nest (though they do result in multiple corresponding calls to the onstart() method of the Service class), so no matter how many times it is started a service will be stopped once Context.stopService() or stopself() is called. A service can be started and allowed to run until someone stops it or it stops itself. Only one stopservice() call is needed to stop the service, no matter how many times startservice() was called Android Service Life Cycle Like an activity, a service has lifecycle methods that you can implement to monitor changes in its state. But they are fewer than the activity methods only three and they are public, not protected: 1. void oncreate () 2. void onstart (Intent intent) 3. void ondestroy () oncreate onstart ondestroy 4
3 22. Android Service Life Cycle The entire lifetime of a service happens between the time oncreate() is called and the time ondestroy() returns. Like an activity, a service does its initial setup in oncreate(), and releases all remaining resources in ondestroy(). For example, a music playback service could create the thread where the music will be played in oncreate(), and then stop the thread in ondestroy() Android Broadcast Receiver Lifecycle A Broadcast Receiver is an application class that listens for Intents that are broadcast, rather than being sent to a single target application/activity. The system delivers a broadcast Intent to all interested broadcast receivers, which handle the Intent sequentially. 6
4 22. Android Registering a Broadcast Receiver You can either dynamically register an instance of this class with Context.registerReceiver() or statically publish an implementation through the <receiver> tag in your AndroidManifest.xml Android Broadcast Receiver Lifecycle A broadcast receiver has a single callback method: void onreceive (Context curcontext, Intent broadcastmsg) 1. When a broadcast message arrives for the receiver, Android calls its onreceive() method and passes it the Intent object containing the message. 2. The broadcast receiver is considered to be active only while it is executing this method. 3. When onreceive() returns, it is inactive. 8
5 22. Android, BroadcastReceivers and the AdroidManifest The manifest of applications using Android must include: 1. A <service> entry for each service used in the application. 2. If the application defines a BroadcastReceiver as an independent class, it must include a <receiver> clause identifying the component. In addition an <intent-filter> entry is needed to declare the actual filter the service and the receiver use. See example Android, BroadcastReceivers and the AdroidManifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="bim224.demos" android:versioncode="1" android:versionname="1.0.0"> <uses-sdk android:minsdkversion="4"></uses-sdk> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name= 1 <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <service android:name=".myservice2" /> <receiver android:name=".mybroadcastreceiver"> <intent-filter> <action android:name = "bim224.action.goservice2" /> </intent-filter> </receiver> </application> </manifest> 10
6 22. Android Types of Broadcasts There are two major classes of broadcasts that can be received: 1. Normal broadcasts (sent with Context.sendBroadcast) are completely asynchronous. All receivers of the broadcast are run in an undefined order, often at the same time. 2. Ordered broadcasts (sent with Context.sendOrderedBroadcast) are delivered to one receiver at a time. As each receiver executes in turn, it can propagate a result to the next receiver, or it can completely abort the broadcast so that it won't be passed to other receivers. The order receivers run in can be controlled with the android:priority attribute of the matching intent-filter; receivers with the same priority will be run in an arbitrary order Android Useful Methods The Driver Assume main activity MyService2Driver wants to interact with a service called MyService2. The main activity is responsible for the following tasks: 1. Start the service called MyService2. Intent intentmyservice = new Intent(this, MyService2.class); Service myservice = startservice(intentmyservice); 2. filter and register local receiver IntentFilter mainfilter = new IntentFilter("bim224.action.GOSERVICE2"); BroadcastReceiver receiver = new MyMainLocalReceiver(); registerreceiver(receiver, mainfilter); 3. Implement local receiver and override its main method public void onreceive(context localcontext, Intent callerintent) 12
7 22. Android Useful Methods The Service Assume main activity MyService2Driver wants to interact with a service called MyService2. The Service uses its onstart method to do the following: 1. Create an Intent with the appropriate broadcast filter (any number of receivers could match it). Intent myfilteredresponse = new Intent("bim224.action.GOSERVICE2"); myservicedata receiver(s) Object msg = some user data goes here; myfilteredresponse.putextra("myservicedata", msg); 3. Release the intent to all receivers matching the filter sendbroadcast(myfilteredresponse); Android Useful Methods The Driver (again) Assume main activity MyService2Driver wants to interact with a service called MyService2. The main activity is responsible for cleanly terminating the service. Do the following 1. Assume intentmyservice is the original Intent used to start the service. Calling the termination of the service is accomplished by the method stopservice(new Intent(intentMyService) ); ondestroy method to assure that all of its running threads are terminated and the receiver is unregistered. unregisterreceiver(receiver); 14
8 22. Android Example 1. A very Simple Service The main application starts a service. The service prints lines on the DDMS LogCat until the main activity stops the service. No IPC occurs in the example. // a simple service is started & stopped package bim224.demos; import android.app.activity; import android.content.componentname; import android.content.intent; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.*; public class ServiceDriver1 extends Activity { TextView txtmsg; Button btnstopservice; ComponentName service; Intent intentmyservice; Android Example 1. cont. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); txtmsg = (TextView) findviewbyid(r.id.txtmsg); intentmyservice = new Intent(this, MyService1.class); service = startservice(intentmyservice); btnstopservice = (Button) findviewbyid(r.id.btnstopservice); btnstopservice.setonclicklistener(new OnClickListener() { public void onclick(view v) { try { stopservice((intentmyservice) ); txtmsg.settext("after stoping Service: \n" + service.getclassname()); catch (Exception e) { Toast.makeText(getApplicationContext(), e.getmessage(), 1).show(); ); 16
9 22. Android Example 1. cont. //non CPU intensive service running the main task in its main thread package bim224.demos; import android.app.service; import android.content.intent; import android.os.ibinder; import android.util.log; public class MyService1 extends Service { public IBinder onbind(intent arg0) { return null; public void oncreate() { super.oncreate(); Log.i ("<<MyService1-onCreate>>", "I am alive-1!"); public void onstart(intent intent, int startid) { super.onstart(intent, startid); Log.i ("<<MyService1-onStart>>", "I did something very quickly"); public void ondestroy() { super.ondestroy(); Log.i ("<<MyService1-onDestroy>>", "I am dead-1"); //MyService Android Example 1. cont. According to the Log 1. Main Activity is started (no displayed yet) 2. Service is started (oncreate, onstart) 3. Main Activity UI is displayed 4. User stops Service 18
10 22. Android Example 1. cont. Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="cis493.demos" android:versioncode="1" android:versionname="1.0"> <application <activity android:name=".servicedriver1" <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <service android:name=".myservice1"> </service> </application> <uses-sdk android:minsdkversion="4" /> </manifest> Android Example 1. cont. Layout <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android=" > <EditText android:layout_width="fill_parent" android:layout_height="120px" android:textsize="18sp" android:layout_x="0px" android:layout_y="57px" > </EditText> <Button android:layout_width="151px" android:layout_height="wrap_content" android:text=" Stop Service" android:layout_x="43px" android:layout_y="200px" > </Button> </AbsoluteLayout> 20
11 22. Android Example2. Realistic Activity-Service Interaction 1. The main activity starts the service and registers a receiver. 2. The service is slow, therefore it runs in a parallel thread its time consuming task. 3. When done with a computing cycle, the service adds a message to an intent. 4. The intent is broadcasted using the filter: bim224.action.goservice2. 5. A BroadcastReceiver (defined inside the main Activity) uses the previous filter and catches the message (displays the contents on the main UI ). 6. At some point the main activity stops the service and finishes executing Android Example 2. Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/widget32" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android=" > <EditText android:id="@+id/txtmsg" android:layout_width="fill_parent" android:layout_height="120px" android:textsize="12sp" > </EditText> <Button android:id="@+id/btnstopservice" android:layout_width="151px" android:layout_height="wrap_content" android:text="stop Service" > </Button> </LinearLayout> 22
12 22. Android Example 2. Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="bim224.demos" android:versioncode="1" android:versionname="1.0.0"> <uses-sdk android:minsdkversion="4"></uses-sdk> <application <activity android:name=".myservicedriver2" <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <service android:name=".myservice2"> </service> </application> </manifest> Android Example 2. Main Activity // Application logic and its BroadcastReceiver in the same class package bim224.demos; import java.util.date; import android.app.activity; import android.content.broadcastreceiver; import android.content.componentname; import android.content.context; import android.content.intent; import android.content.intentfilter; import android.os.bundle; import android.os.systemclock; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.*; public class MyServiceDriver2 extends Activity { TextView txtmsg; Button btnstopservice; ComponentName service; Intent intentmyservice; BroadcastReceiver receiver; 24
13 22. Android Example 2. Main Activity public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); txtmsg = (TextView) findviewbyid(r.id.txtmsg); intentmyservice = new Intent(this, MyService3.class); service = startservice(intentmyservice); start txtmsg.settext("myservice2 started - (see DDMS Log)"); btnstopservice = (Button) findviewbyid(r.id.btnstopservice); btnstopservice.setonclicklistener(new OnClickListener() { public void onclick(view v) { try { stopservice(new Intent(intentMyService) ); stop txtmsg.settext("after stopping service: \n"+ service.getclassname()); catch (Exception e) { e.printstacktrace(); ); Android Example 2. Main Activity // register & define filter for local listener IntentFilter mainfilter = new IntentFilter("bim224.action.GOSERVICE2"); receiver = new MyMainLocalReceiver(); registerreceiver(receiver, mainfilter); //oncreate register //////////////////////////////////////////////////////////////////////// protected void ondestroy() { super.ondestroy(); try { stopservice(intentmyservice); unregister unregisterreceiver(receiver); catch (Exception e) { Log.e ("MAIN2-DESTROY>>>", e.getmessage() ); Log.e ("MAIN2-DESTROY>>>", "Bye" ); //ondestroy 26
14 22. Android Example 2. Main Activity ////////////////////////////////////////////////////////////////////// // local (embedded) RECEIVER public class MyMainLocalReceiver extends BroadcastReceiver { public void onreceive(context localcontext, Intent callerintent) { Get String servicedata = callerintent.getstringextra("servicedata"); data Log.e ("MAIN>>>", servicedata + " -receiving data " + SystemClock.elapsedRealtime() ); String now = "\n" + servicedata + " --- " + new Date().toLocaleString(); txtmsg.append(now); //MyMainLocalReceiver //MyServiceDriver Android Example 2. The Service // Service3 uses a thread to run slow operation package bim224.demos; import android.app.service; import android.content.intent; import android.os.ibinder; import android.util.log; public class MyService2 extends Service { boolean isrunning = true; public IBinder onbind(intent arg0) { return null; public void oncreate() { super.oncreate(); 28
15 22. Android Example 2. The Service public void onstart(intent intent, int startid) { super.onstart(intent, startid); Log.e ("<<MyService2-onStart>>", "I am alive-2!"); // we place the slow work of the service in its own thread // so the caller is not hung up waiting for us Thread triggerservice = new Thread ( new Runnable(){ long startingtime = System.currentTimeMillis(); long tics = 0; public void run() { for(int i=0; (i< 120) & isrunning; i++) { //at most 10 minutes try { //fake that you are very busy here tics = System.currentTimeMillis() - startingtime; Set filter Intent myfilteredresponse = new Intent("bim224.action.GOSERVICE2"); String msg = i + " value: " + tics; myfilteredresponse.putextra("servicedata", msg); broadcasting sendbroadcast(myfilteredresponse); Thread.sleep(5000); //five seconds catch (Exception e) { e.printstacktrace(); //for //run ); triggerservice.start(); //onstart Android Example 2. The Service public void ondestroy() { super.ondestroy(); Log.e ("<<MyService2-onDestroy>>", "I am dead-2"); isrunning = false; //ondestroy Stop thread //MyService3 30
16 Android - Location Location Example Obtain Location from GPS. In this example we request GPS services and display latitude and longitude values on the UI. Additionally we deliver an SMS with this information. Notes 1. Observe the GPS chip is not a synchronous device that will immediately respond to a give me a GPS reading 1. In order to engineer a good solution that takes into account the potential delays in obtaining location data we place the UI in the main activity and the request for location call in a background service. 2. Remember the service runs in the same process space as the main activity, therefore for the sake of responsiveness we must place the logic for location data request in a separate parallel thread. 3. A thread (unlike an Activity) needs the presence of a Looper control to manage IPC message sending. This implies and additional Looper.prepare and Looper.loop methods surrounding the locationupdate method. 23
17 Android - Location Location Example Obtain Location from GPS 24
18 Android - Location Location Example Obtain Location from GPS Use the DDMS > Emulator Control panel to enter test data reflecting Latitude and Longitude. Select emulator transmit the data. A text message will be sent to a second emulator (5556) 25
19 Android - Location Location Example Obtain Location from GPS. Layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/widget32" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android=" > <EditText android:id="@+id/txtmsg" android:layout_width="fill_parent" android:layout_height="120px" android:textsize="12sp" > </EditText> <Button android:id="@+id/btnstopservice" android:layout_width="151px" android:layout_height="wrap_content" android:text="stop Service" > </Button> </LinearLayout> 26
20 Android - Location Location Example Obtain Location from GPS. Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="bim224.mappinggps" android:versioncode="1" android:versionname="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" > <activity android:name=".mygps" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <service android:name=".mygpsservice"> </service> </application> <uses-sdk android:minsdkversion="2" /> <uses-permission android:name="android.permission.send_sms" /> <uses-permission android:name="android.permission.access_fine_location" /> </manifest> 27
21 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS // Request GPS location, show lat & long, deliver a text-message // Application logic and its BroadcastReceiver in the same class package bim224.mappinggps; import android.app.activity; import android.os.bundle; import android.content.broadcastreceiver; import android.content.componentname; import android.content.context; import android.content.intent; import android.content.intentfilter; import android.telephony.gsm.smsmanager; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.*; 28
22 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS public class MyGPS extends Activity { Button btnstopservice; TextView txtmsg; Intent intentmyservice; ComponentName service; BroadcastReceiver receiver; String GPS_FILTER = "bim224.action.gps_location"; 29
23 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); txtmsg = (TextView) findviewbyid(r.id.txtmsg); // initiate the service intentmyservice = new Intent(this, MyGpsService.class); service = startservice(intentmyservice); txtmsg.settext("mygpsservice started - (see DDMS Log)"); // register & define filter for local listener IntentFilter mainfilter = new IntentFilter(GPS_FILTER); receiver = new MyMainLocalReceiver(); registerreceiver(receiver, mainfilter); 30
24 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS btnstopservice = (Button) findviewbyid(r.id.btnstopservice); btnstopservice.setonclicklistener(new OnClickListener() { public void onclick(view v) { try { stopservice(new Intent(intentMyService) ); ); txtmsg.settext("after stoping Service: \n" + service.getclassname()); btnstopservice.settext("finished"); btnstopservice.setclickable(false); catch (Exception e) { Log.e("MYGPS", e.getmessage() ); //oncreate 31
25 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS //////////////////////////////////////////////////////////////////////// protected void ondestroy() { super.ondestroy(); try { stopservice(intentmyservice); unregisterreceiver(receiver); catch (Exception e) { Log.e ("MAIN-DESTROY>>>", e.getmessage() ); Log.e ("MAIN-DESTROY>>>", "Adios" ); // ondestroy 32
26 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS ////////////////////////////////////////////////////////////////////// // local RECEIVER private class MyMainLocalReceiver extends BroadcastReceiver { public void onreceive(context localcontext, Intent callerintent) { double latitude = callerintent.getdoubleextra("latitude",-1); double longitude = callerintent.getdoubleextra("longitude",-1); Log.e ("MAIN>>>", Double.toString(latitude)); Log.e ("MAIN>>>", Double.toString(longitude)); String msg = " lat: " + Double.toString(latitude) + " " + " lon: " + Double.toString(longitude); txtmsg.append("\n" + msg); //testing the SMS-texting feature texting(msg); //MyMainLocalReceiver 33
27 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGPS ////////////////////////////////////////////////////////////// // sending a TEXT MESSAGE private void texting(string msg){ try { SmsManager smsmgr = SmsManager.getDefault(); // Parameter of sendtextmessage are: // destinationaddress, senderaddress, // text, sentintent, deliveryintent) // smsmgr.sendtextmessage("5556", " ", "Please meet me at: " + msg, null, null); catch (Exception e) { Toast.makeText(this, "texting\n" + e.getmessage(), 1).show(); // texting //MyGPS 34
28 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGpsService // This is the GPS service. Requests location updates // in a parallel thread. sends broadcast using filter. package bim224.mappinggps; import android.app.service; import android.content.context; import android.content.intent; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.os.ibinder; import android.os.looper; import android.util.log; import android.widget.toast; public class MyGpsService extends Service { String GPS_FILTER = "bim224.action.gps_location"; Thread triggerservice; LocationManager lm; GPSListener mylocationlistener; boolean isrunning = true; 35
29 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGpsService public IBinder onbind(intent arg0) { return null; public void oncreate() { super.oncreate(); public void onstart(intent intent, int startid) { super.onstart(intent, startid); Log.e("<<MyGpsService-onStart>>", "I am alive-gps!"); // we place the slow work of the service in its own thread so the // response we send our caller who run a "startservice(...)" method // gets a quick OK from us. 36
30 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGpsServive triggerservice = new Thread(new Runnable() { public void run() { try { Looper.prepare(); // try to get your GPS location using the LOCATION.SERVIVE provider lm = (LocationManager) getsystemservice(context.location_service); // This listener will catch and disseminate location updates mylocationlistener = new GPSListener(); long mintime = 10000; // frequency update: 10 seconds float mindistance = 50; // frequency update: 50 meter lm.requestlocationupdates( //request GPS updates LocationManager.GPS_PROVIDER, mintime, mindistance, mylocationlistener); Looper.loop(); catch (Exception e) { Log.e("MYGPS", e.getmessage() ); // run ); triggerservice.start(); // onstart 37
31 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGpsServive ///////////////////////////////////////////////////////////////////////// // location listener becomes aware of the GPS data and sends a broadcast private class GPSListener implements LocationListener { public void onlocationchanged(location location) { //capture location data sent by current provider double latitude = location.getlatitude(); double longitude = location.getlongitude(); //assemble data bundle to be broadcasted Intent myfilteredresponse = new Intent(GPS_FILTER); myfilteredresponse.putextra("latitude", latitude); myfilteredresponse.putextra("longitude", longitude); Log.e(">>GPS_Service<<", "Lat:" + latitude + " lon:" + longitude); //send the location data out sendbroadcast(myfilteredresponse); 38
32 Android - Location Location Example Obtain Location from GPS. Main Activity: MyGpsServive public void onproviderdisabled(string provider) { public void onproviderenabled(string provider) { public void onstatuschanged(string provider, int status, Bundle extras) { ;//GPSListener class // MyService3 interface 39
33 22. Android Questions 31
App Development for Smart Devices. Lec #4: Services and Broadcast Receivers Try It Out
App Development for Smart Devices CS 495/595 - Fall 2013 Lec #4: Services and Broadcast Receivers Try It Out Tamer Nadeem Dept. of Computer Science Try It Out Example 1 (in this slides) Example 2 (in this
Android Services. Android. Victor Matos
Lesson 22 Android Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html Portions of this page are reproduced from work created and shared
Android For Java Developers. Marko Gargenta Marakana
Android For Java Developers Marko Gargenta Marakana Agenda Android History Android and Java Android SDK Hello World! Main Building Blocks Debugging Summary History 2005 Google buys Android, Inc. Work on
Android Introduction. Hello World. @2010 Mihail L. Sichitiu 1
Android Introduction Hello World @2010 Mihail L. Sichitiu 1 Goal Create a very simple application Run it on a real device Run it on the emulator Examine its structure @2010 Mihail L. Sichitiu 2 Google
Now that we have the Android SDK, Eclipse and Phones all ready to go we can jump into actual Android development.
Android Development 101 Now that we have the Android SDK, Eclipse and Phones all ready to go we can jump into actual Android development. Activity In Android, each application (and perhaps each screen
4. The Android System
4. The Android System 4. The Android System System-on-Chip Emulator Overview of the Android System Stack Anatomy of an Android Application 73 / 303 4. The Android System Help Yourself Android Java Development
Android Persistency: Files
15 Android Persistency: Files Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright 2008-2009 CommonsWare, LLC. ISBN: 978-0-9816780-0-9 & Android Developers http://developer.android.com/index.html
Tutorial #1. Android Application Development Advanced Hello World App
Tutorial #1 Android Application Development Advanced Hello World App 1. Create a new Android Project 1. Open Eclipse 2. Click the menu File -> New -> Other. 3. Expand the Android folder and select Android
Mobile Application Development
Mobile Application Development (Android & ios) Tutorial Emirates Skills 2015 3/26/2015 1 What is Android? An open source Linux-based operating system intended for mobile computing platforms Includes a
Operating System Support for Inter-Application Monitoring in Android
Operating System Support for Inter-Application Monitoring in Android Daniel M. Jackowitz Spring 2013 Submitted in partial fulfillment of the requirements of the Master of Science in Software Engineering
Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作
Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作 Android Application Development 賴 槿 峰 (Chin-Feng Lai) Assistant Professor, institute of CSIE, National Ilan University Nov. 10 th 2011 2011 MMN Lab. All Rights Reserved
Developing Android Apps: Part 1
: Part 1 [email protected] www.dre.vanderbilt.edu/~schmidt Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee, USA CS 282 Principles of Operating Systems II Systems
App Development for Android. Prabhaker Matet
App Development for Android Prabhaker Matet Development Tools (Android) Java Java is the same. But, not all libs are included. Unused: Swing, AWT, SWT, lcdui Eclipse www.eclipse.org/ ADT Plugin for Eclipse
BEGIN ANDROID JOURNEY IN HOURS
BEGIN ANDROID JOURNEY IN HOURS CS425 / CSE 424 / ECE 428 [Fall 2009] Sept. 14, 2009 Ying Huang REFERENCE Online development guide http://developer.android.com/guide/index.html Book resource Professional
TomTom PRO 82xx PRO.connect developer guide
TomTom PRO 82xx PRO.connect developer guide Contents Introduction 3 Preconditions 4 Establishing a connection 5 Preparations on Windows... 5 Preparations on Linux... 5 Connecting your TomTom PRO 82xx device
Android Security Lab WS 2014/15 Lab 1: Android Application Programming
Saarland University Information Security & Cryptography Group Prof. Dr. Michael Backes saarland university computer science Android Security Lab WS 2014/15 M.Sc. Sven Bugiel Version 1.0 (October 6, 2014)
Les Broadcast Receivers...
Les Broadcast Receivers... http://developer.android.com/reference/android/content/broadcastreceiver.html Mécanisme qui, une fois «enregistré» dans le système, peut recevoir des Intents Christophe Logé
How To Develop Smart Android Notifications using Google Cloud Messaging Service
Software Engineering Competence Center TUTORIAL How To Develop Smart Android Notifications using Google Cloud Messaging Service Ahmed Mohamed Gamaleldin Senior R&D Engineer-SECC [email protected]
directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as
1 of 6 2011-03-01 12:16 AM yet another insignificant programming notes... HOME Android SDK 2.2 How to Install and Get Started Introduction Android is a mobile operating system developed by Google, which
ANDROID TUTORIAL. Simply Easy Learning by tutorialspoint.com. tutorialspoint.com
Android Tutorial ANDROID TUTORIAL by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Android Tutorial Android is an open source and Linux-based operating system for mobile devices such as smartphones
Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 2 Android Platform. Marco Picone - 2012
Android Development Lecture 2 Android Platform Università Degli Studi di Parma Lecture Summary 2 The Android Platform Dalvik Virtual Machine Application Sandbox Security and Permissions Traditional Programming
Chapter 2 Getting Started
Welcome to Android Chapter 2 Getting Started Android SDK contains: API Libraries Developer Tools Documentation Sample Code Best development environment is Eclipse with the Android Developer Tool (ADT)
SDK Quick Start Guide
SDK Quick Start Guide Table of Contents Requirements...3 Project Setup...3 Using the Low Level API...9 SCCoreFacade...9 SCEventListenerFacade...10 Examples...10 Call functionality...10 Messaging functionality...10
Tutorial: Setup for Android Development
Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Autumn 2015 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu
Android Application Model
Android Application Model Content - Activities - Intent - Tasks / Applications - Lifecycle - Processes and Thread - Services - Content Provider Dominik Gruntz IMVS [email protected] 1 Android Software
Using Sensors on the Android Platform. Andreas Terzis Android N00b
Using Sensors on the Android Platform Andreas Terzis Android N00b Hardware-oriented Features Feature Camera Sensor SensorManager SensorEventListener SensorEvent GeoMagneticField Description A class that
Android Java Live and In Action
Android Java Live and In Action Norman McEntire Founder, Servin Corp UCSD Extension Instructor [email protected] Copyright (c) 2013 Servin Corp 1 Opening Remarks Welcome! Thank you! My promise
MMI 2: Mobile Human- Computer Interaction Android
MMI 2: Mobile Human- Computer Interaction Android Prof. Dr. [email protected] Mobile Interaction Lab, LMU München Android Software Stack Applications Java SDK Activities Views Resources Animation
Based on Android 4.0. by Lars Vogel. Version 9.8. Copyright 2009, 2010, 2011, 2012 Lars Vogel. 20.02.2012 Home Tutorials Trainings Books Social
Android Development Tutorial Tutorial 2.6k Based on Android 4.0 Lars Vogel Version 9.8 by Lars Vogel Copyright 2009, 2010, 2011, 2012 Lars Vogel 20.02.2012 Home Tutorials Trainings Books Social Revision
Getting Started With Android
Getting Started With Android Author: Matthew Davis Date: 07/25/2010 Environment: Ubuntu 10.04 Lucid Lynx Eclipse 3.5.2 Android Development Tools(ADT) 0.9.7 HTC Incredible (Android 2.1) Preface This guide
Developing apps for Android OS: Develop an app for interfacing Arduino with Android OS for home automation
Developing apps for Android OS: Develop an app for interfacing Arduino with Android OS for home automation Author: Aron NEAGU Professor: Martin TIMMERMAN Table of contents 1. Introduction.2 2. Android
Android Development Introduction
Android Development Introduction Notes are based on: Unlocking Android by Frank Ableson, Charlie Collins, and Robi Sen. ISBN 978 1 933988 67 2 Manning Publications, 2009. & Android Developers http://developer.android.com/index.html
Introduction to Android SDK Jordi Linares
Introduction to Android SDK Introduction to Android SDK http://www.android.com Introduction to Android SDK Google -> OHA (Open Handset Alliance) The first truly open and comprehensive platform for mobile
CSE476 Mobile Application Development. Yard. Doç. Dr. Tacha Serif [email protected]. Department of Computer Engineering Yeditepe University
CSE476 Mobile Application Development Yard. Doç. Dr. Tacha Serif [email protected] Department of Computer Engineering Yeditepe University Fall 2015 Yeditepe University 2015 Outline Dalvik Debug
Android Development. Marc Mc Loughlin
Android Development Marc Mc Loughlin Android Development Android Developer Website:h:p://developer.android.com/ Dev Guide Reference Resources Video / Blog SeCng up the SDK h:p://developer.android.com/sdk/
Android-Entwicklung. Michael secure Stapelberg
Android-Entwicklung Michael secure Stapelberg Folien Disclaimer Überblick 1 Die Android-Plattform 2 Entwicklungsumgebung 3 4 Grundlagen Layout, Activity, Manifest, Listener, Intents Framework Adapter,
Android Fundamentals 1
Android Fundamentals 1 What is Android? Android is a lightweight OS aimed at mobile devices. It is essentially a software stack built on top of the Linux kernel. Libraries have been provided to make tasks
Location-Based Services Design and Implementation Using Android Platforms
Location-Based Services Design and Implementation Using Android Platforms Wen-Chen Hu Department of Computer Science University of North Dakota Grand Forks, ND 58202 [email protected] Hung-Jen Yang Department
Building an Android client. Rohit Nayak Talentica Software
Building an Android client Rohit Nayak Talentica Software Agenda iphone and the Mobile App Explosion How mobile apps differ Android philosophy Development Platform Core Android Concepts App Demo App Dissection
Android Programming. Android App. Høgskolen i Telemark Telemark University College. Cuong Nguyen, 2013.06.19
Høgskolen i Telemark Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Android Programming Cuong Nguyen, 2013.06.19 Android App Faculty of Technology,
Beginning Android Application Development
Beginning Android Application Development Introduction... xv Chapter 1 Getting Started with Android Programming......................... 1 Chapter 2 Activities and Intents...27 Chapter 3 Getting to Know
AdFalcon Android SDK 2.1.4 Developer's Guide. AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group
AdFalcon Android SDK 214 Developer's Guide AdFalcon Mobile Ad Network Product of Noqoush Mobile Media Group Table of Contents 1 Introduction 3 Supported Android version 3 2 Project Configurations 4 Step
Developing Android Applications: Case Study of Course Design
Accepted and presented at the: The 10th International Conference on Education and Information Systems, Technologies and Applications: EISTA 2012 July 17-20, 2012 Orlando, Florida, USA Developing Android
Android Programming Basics
2012 Marty Hall Android Programming Basics Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
Getting Started: Creating a Simple App
Getting Started: Creating a Simple App What You will Learn: Setting up your development environment Creating a simple app Personalizing your app Running your app on an emulator The goal of this hour is
Android Development Introduction
Android Development Introduction Notes are based on: Unlocking Android by Frank Ableson, Charlie Collins, and Robi Sen. ISBN 978-1-933988-67-2 Manning Publications, 2009. & Android Developers http://developer.android.com/index.html
Mocean Android SDK Developer Guide
Mocean Android SDK Developer Guide For Android SDK Version 3.2 136 Baxter St, New York, NY 10013 Page 1 Table of Contents Table of Contents... 2 Overview... 3 Section 1 Setup... 3 What changed in 3.2:...
ANDROID AS A PLATFORM FOR DATABASE APPLICATION DEVELOPMENT
Bachelor s Thesis (TUAS) Degree Program: Information Technology Specialization: Internet Technology 2013 Joseph Muli ANDROID AS A PLATFORM FOR DATABASE APPLICATION DEVELOPMENT CASE: WINHA MOBILE 1 BACHELOR
ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android
Why Android? ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android Dr Dimitris C. Dracopoulos A truly open, free development platform based on Linux and open source A component-based
Android Bootcamp. Elaborado (com adaptações) a partir dos tutoriais:
Android Bootcamp Elaborado (com adaptações) a partir dos tutoriais: http://developer.android.com/resources/tutorials/hello-world.html http://developer.android.com/resources/tutorials/views/index.html Bootcamp
Basics. Bruce Crawford Global Solutions Manager
Android Development Basics Bruce Crawford Global Solutions Manager Android Development Environment Setup Agenda Install Java JDK Install Android SDK Add Android SDK packages with Android SDK manager Install
Admin. Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources. Recap: TinyOS. Recap: J2ME Framework
Admin. Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources Homework 2 questions 10/9/2012 Y. Richard Yang 1 2 Recap: TinyOS Hardware components motivated design
PubMatic Android SDK. Developer Guide. For Android SDK Version 4.3.5
PubMatic Android SDK Developer Guide For Android SDK Version 4.3.5 Nov 25, 2015 1 2015 PubMatic Inc. All rights reserved. Copyright herein is expressly protected at common law, statute, and under various
TUTORIAL. BUILDING A SIMPLE MAPPING APPLICATION
Cleveland State University CIS493. Mobile Application Development Using Android TUTORIAL. BUILDING A SIMPLE MAPPING APPLICATION The goal of this tutorial is to create a simple mapping application that
TUTORIALS AND QUIZ ANDROID APPLICATION SANDEEP REDDY PAKKER. B. Tech in Aurora's Engineering College, 2013 A REPORT
TUTORIALS AND QUIZ ANDROID APPLICATION by SANDEEP REDDY PAKKER B. Tech in Aurora's Engineering College, 2013 A REPORT submitted in partial fulfillment of the requirements for the degree MASTER OF SCIENCE
Android Application Development: Hands- On. Dr. Jogesh K. Muppala [email protected]
Android Application Development: Hands- On Dr. Jogesh K. Muppala [email protected] Wi-Fi Access Wi-Fi Access Account Name: aadc201312 2 The Android Wave! 3 Hello, Android! Configure the Android SDK SDK
MAP524/DPS924 MOBILE APP DEVELOPMENT (ANDROID) MIDTERM TEST OCTOBER 2013 STUDENT NAME STUDENT NUMBER
MAP524/DPS924 MOBILE APP DEVELOPMENT (ANDROID) MIDTERM TEST OCTOBER 2013 STUDENT NAME STUDENT NUMBER Please answer all questions on the question sheet This is an open book/notes test. You are allowed to
AN11367. How to build a NFC Application on Android. Application note COMPANY PUBLIC. Rev. 1.1 16 September 2015 270211. Document information
Document information Info Content Keywords, android Abstract This application note is related to the implementation procedures of Android applications handling NFC data transfer with the RC663 Blueboard
How to develop your own app
How to develop your own app It s important that everything on the hardware side and also on the software side of our Android-to-serial converter should be as simple as possible. We have the advantage that
Android Concepts and Programming TUTORIAL 1
Android Concepts and Programming TUTORIAL 1 Kartik Sankaran [email protected] CS4222 Wireless and Sensor Networks [2 nd Semester 2013-14] 20 th January 2014 Agenda PART 1: Introduction to Android - Simple
Internal Services. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr. Rajiv Ramnath
Internal Services CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr. Rajiv Ramnath 1 Internal Services Communication: Email, SMS and telephony Audio and video:
Woubshet Behutiye ANDROID ECG APPLICATION DEVELOPMENT
Woubshet Behutiye ANDROID ECG APPLICATION DEVELOPMENT ANDROID ECG APPLICATION DEVELOPMENT Woubshet Behutiye Bachelor s Thesis Spring 2012 Business Information Technology Oulu University of Applied Sciences
Android Apps Development Boot Camp. Ming Chow Lecturer, Tufts University DAC 2011 Monday, June 6, 2011 [email protected]
Android Apps Development Boot Camp Ming Chow Lecturer, Tufts University DAC 2011 Monday, June 6, 2011 [email protected] Overview of Android Released in 2008 Over 50% market share Powers not only smartphones
andbook! Android Programming written by Nicolas Gramlich release.002 http://andbook.anddev.org with Tutorials from the anddev.org-community.
andbook! release.002 Android Programming with Tutorials from the anddev.org-community. Check for the latest version on http://andbook.anddev.org written by Nicolas Gramlich Content Foreword / How to read
Android Development Tutorial
3.2k Android Development Tutorial Free tutorial, donate to support Based on Android 4.2 Lars Vogel Version 11.2 Copyright 2009, 2010, 2011, 2012, 2013 Lars Vogel 20.01.2013 Revision History by Lars Vogel
Developing Sensor Applications on Intel Atom Processor-Based Android* Phones and Tablets
Developing Sensor Applications on Intel Atom Processor-Based Android* Phones and Tablets This guide provides application developers with an introduction to the Android Sensor framework and discusses how
ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)
ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Who am I? Lo Chi Wing, Peter Lecture 1: Introduction to Android Development Email: [email protected] Facebook: http://www.facebook.com/peterlo111
Saindo da zona de conforto resolvi aprender Android! by Daniel Baccin
Saindo da zona de conforto resolvi aprender Android! by Daniel Baccin Mas por que Android??? Documentação excelente Crescimento no número de apps Fonte: http://www.statista.com/statistics/266210/number-of-available-applications-in-the-google-play-store/
Obsoleted chapter from The Busy Coder's Guide to Advanced Android Development
CHAPTER 13 "" is Android's overall term for ways that Android can detect elements of the physical world around it, from magnetic flux to the movement of the device. Not all devices will have all possible
Building Your First App
uilding Your First App Android Developers http://developer.android.com/training/basics/firstapp/inde... Building Your First App Welcome to Android application development! This class teaches you how to
Arduino & Android. A How to on interfacing these two devices. Bryant Tram
Arduino & Android A How to on interfacing these two devices Bryant Tram Contents 1 Overview... 2 2 Other Readings... 2 1. Android Debug Bridge -... 2 2. MicroBridge... 2 3. YouTube tutorial video series
Android Environment SDK
Part 2-a Android Environment SDK Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html 1 2A. Android Environment: Eclipse & ADT The Android
Developing an Android App. CSC207 Fall 2014
Developing an Android App CSC207 Fall 2014 Overview Android is a mobile operating system first released in 2008. Currently developed by Google and the Open Handset Alliance. The OHA is a consortium of
Hacking your Droid ADITYA GUPTA
Hacking your Droid ADITYA GUPTA adityagupta1991 [at] gmail [dot] com facebook[dot]com/aditya1391 Twitter : @adi1391 INTRODUCTION After the recent developments in the smart phones, they are no longer used
An Android-based Instant Message Application
An Android-based Instant Message Application Qi Lai, Mao Zheng and Tom Gendreau Department of Computer Science University of Wisconsin - La Crosse La Crosse, WI 54601 [email protected] Abstract One of the
HERE SDK for Android. Developer's Guide. Online Version 2.1
HERE SDK for Android Developer's Guide Online Version 2.1 Contents 2 Contents Legal Notices.4 Document Information 5 Service Support. 6 Chapter1:Overview 7 What is the HERE SDK for Android?..8 Feature
06 Team Project: Android Development Crash Course; Project Introduction
M. Kranz, P. Lindemann, A. Riener 340.301 UE Principles of Interaction, 2014S 06 Team Project: Android Development Crash Course; Project Introduction April 11, 2014 Priv.-Doz. Dipl.-Ing. Dr. Andreas Riener
Android Environment SDK
Part 2-a Android Environment SDK Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html 1 Android Environment: Eclipse & ADT The Android
Presenting Android Development in the CS Curriculum
Presenting Android Development in the CS Curriculum Mao Zheng Hao Fan Department of Computer Science International School of Software University of Wisconsin-La Crosse Wuhan University La Crosse WI, 54601
Advantages. manage port forwarding, set breakpoints, and view thread and process information directly
Part 2 a Android Environment SDK Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html 1 Android Environment: Eclipse & ADT The Android
Tutorial for developing the Snake Game in Android: What is Android?
Tutorial for developing the Snake Game in Android: What is Android? Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides
Localization and Resources
2012 Marty Hall Localization and Resources Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
App Development for Smart Devices. Lec #5: Android Sensors
App Development for Smart Devices CS 495/595 - Fall 2012 Lec #5: Android Sensors Tamer Nadeem Dept. of Computer Science Objective Working in Background Sensor Manager Examples Sensor Types Page 2 What
By sending messages into a queue, we can time these messages to exit the cue and call specific functions.
Mobile App Tutorial Deploying a Handler and Runnable for Timed Events Creating a Counter Description: Given that Android Java is event driven, any action or function call within an Activity Class must
