Difference between revisions of "MAP524/DPS924 Lecture 10"

From CDOT Wiki
Jump to: navigation, search
(Created page with '= Services = We're only going to look at a small subset of this topic: Intent Services. = Broadcast receivers = = Reading incoming SMS = = Sending email =')
 
(Services)
Line 2: Line 2:
  
 
We're only going to look at a small subset of this topic: Intent Services.
 
We're only going to look at a small subset of this topic: Intent Services.
 +
 +
* We'll create an Intent Service as described [https://developer.android.com/training/run-background-service/create-service.html here].
 +
* Then our activity (which has to be in the same project as the service) will call one function of the service with a parameter or two.
 +
* Once the service is done its work - it will send a response back via an Broadcast Intent
 +
** Which means we'll need to register to receive those in our activity. We'll create an IntentFilter and a BroadcastReceiver in Java and register them with LocalBroadcastManager.getInstance(this).registerReceiver().
  
 
= Broadcast receivers =
 
= Broadcast receivers =

Revision as of 23:34, 9 August 2015

Services

We're only going to look at a small subset of this topic: Intent Services.

  • We'll create an Intent Service as described here.
  • Then our activity (which has to be in the same project as the service) will call one function of the service with a parameter or two.
  • Once the service is done its work - it will send a response back via an Broadcast Intent
    • Which means we'll need to register to receive those in our activity. We'll create an IntentFilter and a BroadcastReceiver in Java and register them with LocalBroadcastManager.getInstance(this).registerReceiver().

Broadcast receivers

Reading incoming SMS

Sending email