Cloud
InteractionDesign
Android
CLOUD
Backing Up Data
Backing Up Data
The user expects his data will be restored even after reset[!]
Lightweight Solution
• Register for the Android Backup Service
<meta-­‐data  android:name="com.google.android.backup.api_key"
android:value="ABcDe1FGHij2KlmN3oPQRs4TUvW5xYZ"   />
• Configure the Manifest
<application  android:label="MyApp"
android:backupAgent="TheBackupAgent">
...
<meta-­‐data  android:name="com.google.android.backup.api_key"
android:value="ABcDe1FGHij2KlmN3oPQRs4TUvW5xYZ"   />
...
</application>
Lightweight Solution
• Write the Backup Agent
import   android.app.backup.BackupAgentHelper;
import  android.app.backup.FileBackupHelper;
public  class  TheBackupAgent extends   BackupAgentHelper {
//  The  name  of  the  SharedPreferences file
static   final  String  HIGH_SCORES_FILENAME   =  "scores";
//  A  key  to  uniquely   identify   the  set  of  backup  data
static   final  String  FILES_BACKUP_KEY   =  "myfiles";
//  Allocate   a  helper   and  add  it  to  the  backup  agent
@Override
void  onCreate()   {
FileBackupHelper helper  =  new  FileBackupHelper(this,   HIGH_SCORES_FILENAME);
addHelper(FILES_BACKUP_KEY,   helper);
}
}
Lightweight Solution
• Request Backup!
BackupManager bm =  new  BackupManager(this);
bm.dataChanged();
• Request Restore!
BackupManager bm =  new  BackupManager(this);
bm.requestRestore();
Digging Deep into
the Cloud
PARSE
https://parse.com/products/android
Parse
Parse
Setting Up Parse
https://parse.com/apps/quickstart#parse_data/mobile/android/native/new
Parse
Parse
ParseObject testObject =  new  ParseObject("TestObject");
testObject.put("foo",   "bar");
testObject.saveInBackground();
Parse
Parse
ParseObject testObject =  new  ParseObject("TestObject");
testObject.put("foo",   "bar");
testObject.saveInBackground();
Parse
Pushing Notification
with Parse
Example.
Notifications [Cross-Platform]
Notifications [Cross-Platform]
Notifications [Cross-Platform]
//  Push  to  a  channel  from  an  Android  client
ParsePush push  =  new  ParsePush();
push.setChannel("galaxy_nexus_news");
push.setMessage("The  new  Galaxy  Nexus  has  been  released!");
push.sendInBackground();
Notifications [Cross-Platform]
//  Push  to  a  channel  from  an  Android  client
ParsePush push  =  new  ParsePush();
push.setChannel("galaxy_nexus_news");
push.setMessage("The  new  Galaxy  Nexus  has  been  released!");
push.sendInBackground();
//  Push  to  a  channel  from  an  iOS  client
PFPush *push  =  [[PFPush alloc]  init];
[push  setChannel:@"ipad_news"];
[push  setMessage:@"The  new  iPad  has  been  released!"];
[push  sendPushInBackground];
Notifications [Cross-Platform]
//  Push  to  a  channel  from  an  Android  client
ParsePush push  =  new  ParsePush();
push.setChannel("galaxy_nexus_news");
push.setMessage("The  new  Galaxy  Nexus  has  been  released!");
push.sendInBackground();
//  Push  to  a  channel  from  an  iOS  client
PFPush *push  =  [[PFPush alloc]  init];
[push  setChannel:@"ipad_news"];
[push  setMessage:@"The  new  iPad  has  been  released!"];
[push  sendPushInBackground];
//  Push  to  a  channel  from  JavaScript  or  Cloud  Code
Parse.Push.send({
channels:  [  "ipad_news"  ],
data:  {
alert:  "The  new  iPad  has  been  released!"
}
},{});
A/B Testing
with Parse
Analytics
The most important thing.
Analytics
More than your app code.
Analytics
with Parse
Straight out of the box your application will track app opens,
push opens, API requests, device type, and REST verbs. You
don't have to do anything extra to measure some of the most
important metrics."
"
Analytics
Analytics
Analytics
Analytics
Analytics
Analytics
Map<String,  String>  dimensions  =  new  HashMap<String,  String>();
dimensions.put("priceRange",  "1000-­‐1500");
dimensions.put("customerType",  "renter");
dimensions.put("age",  "22-­‐25");
//  Send  the  dimensions  to  Parse  along  with  the  'search'  event
ParseAnalytics.trackEvent("search",  dimensions);
For Android, visit
https://parse.com/docs/android/guide
Unity3D
with Parse
Android L06 - Cloud / Parse
Android L06 - Cloud / Parse

Android L06 - Cloud / Parse