building android apps with parse
DESCRIPTION
Learn how to focus on creating a great user experience and forget complex infrastructure. Instantly add a powerful core, push notifications, and analytics to your app with Parse. We will take a deep dive at Parse's native SDKs for Android and see how to build an app that scales to millions of users.TRANSCRIPT
PHYSICAL SERVERSLOAD BALANCINGDATABASE BINDINGS
RESTful APIROUTING
MIDDLEWARE
APP SECURITY
APP BUSINESS LOGIC
NETWORKING
CACHING
DATA MODELS
USER SESSIONSSOCIAL
PUSH NOTIFICATIONSFILESUI BINDINGS
PHYSICAL SERVERSLOAD BALANCINGDATABASE BINDINGS
RESTful APIROUTING
MIDDLEWARE
APP SECURITY
APP BUSINESS LOGIC
NETWORKING
CACHING
DATA MODELS
USER SESSIONSSOCIAL
PUSH NOTIFICATIONSFILESUI BINDINGS
YOUR APP
Your data in the cloud
Title
Time
TrackKey Value
title “Getting Started with Parse
track “Track 1”
time September 5, 2013 12:45 PM +0700
Talk
Parse Data
talk.saveInBackground();
talk.put(“title”, “Getting Started with Parse”);!talk.put(“track”, “Track 1”);!talk.put(“time”, talkDate); // Date
ParseObject talk = new ParseObject(”Talk”);
Key Value
title “Getting Started with Parse
track “Track 1”
time September 5, 2013 12:45 PM +0700
Talk
Creating and Saving an Object
ParseQuery<ParseObject> query = ParseQuery.getQuery(”Talk”);
query.findInBackground(new FindCallback<ParseObject>(){! public void done(List<ParseObject> talkList, ParseException e) {!
if (e == null) {! // We have a list of all the Basic track talks! } else {! // Something went wrong; check the ParseException! }! }
}
// Find only the talks that are in the Basic track!query.whereEqualTo(”track”,”basic”);
Getting a List of Objects
byte[] data = myPhotoObject.toByteArray();ParseFile image = new ParseFile(”Parse-2.jpg”, data);!image.saveInBackground();
ParseObject picture = new ParseObject(”Picture”);!picture.put(“title”, “Red Hot Chili Peppers concert”);!picture.put(“image”, image);!picture.saveInBackground();
Saving Files
Easy User ManagementParse Social
•ParseUsers make it simple to:• Sign up
• Log in
• Manage user session with “currentUser”
• Create Roles in your app
• Improve app security with ACLs
• Integrate with Facebook and Twitter
ParseUser.logInInBackground( “janedoe”, ! “mypassword123”, new LogInCallback() {! public void done(ParseUser user, ParseException e) {! if (user != null) {! // The user is logged in! } else {! // Something went wrong; check the ParseException! }! }!});
Sign up
Log in
ParseUserParseUser user = new ParseUser();!user.setUsername(“janedoe”);!user.setPassword(“mypassword123”);!user.setEmail(“[email protected]”);!user.signUpInBackground();
ParseTwitterUtils.link(user, this, new SaveCallback() {! @Override! public void done(ParseException e) {! if (ParseTwitterUtils.isLinked(user)) {!
// The user added their Twitter account! }! }!};
Link to Social NetworksParseFacebookUtils.link(user, this, new SaveCallback() {! @Override! public void done(ParseException e) {! if (ParseFacebookUtils.isLinked(user)) {!
// The user added their Facebook account! }! }!};
•Background Jobs
•For long running jobs
•Can be scheduled
Run custom app code in the Parse CloudCloud Code
•Running Code when Objects are Saved or Deleted
•Cloud functions & custom webhooks
A Simple Background JobParse.Cloud.job(“userMigration”, function (request, status) {! // Set up to modify user data Parse.Cloud.useMasterKey();! // Query for all users! var query = new Parse.Query(Parse.User);! query.each(function(user) {! // Set and save the change! user.set(“plan”, request.params.plan);! return user.save(); }).then(function() {! // Set the job’s success status! status.success(“Migration completed successfully.”); }, function(error) { // Set the job’s error status status.error(“Uh oh, something went wrong.”); }); });
Integrate with virtually any third-party service
•Parse Image Module• Resize, crop, scale
• Change image format
•User Session Module• For server-side apps
• Manage user session across pages
Cloud Modules
•Send text messages, emails, or accept payments
•Connect to services with Parse.Cloud.httpRequest
ParseInstallation.getCurrentInstallation().saveInBackground();
• Pushes are sent to Installations
•1 device + 1 install of your app = 1 Installation
• Add relationships to objects of interest, e.g. current User
Push NotificationsInstallations
ParsePush push = new ParsePush();!push.setChannel(“Giants”);!push.setMessage(“The game starts in 5!”);!push.sendInBackground();
Push to a ChannelSubscribe users by interest or category
Find users who match particular criteriaPush to a Query
ParseQuery pushQuery = ParseInstallation.getQuery();!pushQuery.whereEqualTo(“isFacebookEmployee”, true);!!!ParsePush push = new ParsePush();!push.setQuery(pushQuery);!push.setMessage(“Good afternoon, Facebook!”);!push.sendInBackground();
Parse Analytics
Measure App Usage• API calls
• App open rates
• Push campaigns
• Custom events
Track Any Data Point In Real Time
event: "signedUp"!dimensions: {! gender: "f",! source: "web",! friendsUsingApp: "35",! wasReferred: "true"!}
• Note:
• Each event can have a maximum of 4 dimensions
•Dimensions must be strings
Dive Deeper: Custom Analytics•Save a free-form event with dimensions for segmenting results
!
Over 260,000 Apps Built!
0
50,000
100,000
150,000
300,000
2011 2012 2013 2014
200,000
250,000
2015
Apps
bui
lt on
Par
se
Parse Core Parse Push Parse Analytics
UNLIMITED up to 30 requests/sec
UNLIMITED up to 1,000,000 recipients
UNLIMITED data points