FASTER PROTOTYPING USING PARSE AND AZURE MOBILE SERVICES Goran Đonović July 15th 2015 FASTER PROTOTYPING USING PARSE AND AZURE MOBILE SERVICES Goran Đonović
About me Mobile app developer Connect with me on LinkedIn Follow @gdjonovic on twitter for some #androiddev posts Recent remote worker #developerslife Do or die kind of a guy
… and who are you?
What are going to talk about Prototyping Development from mobile perspektive Backend as a service platforms (Parse and Azure) (M)Bass most used features Pros & Cons The next steps Q&A
So... What is prototype? "A prototype is an incomplete version of software, built so users can experience some of the proposed features or properties"
Business requirements Vs. Business hypothesis
Requirements... I want it all, I want it all, and I want it now!
Hypothesis asdas
Tools for your toolbox
It's all about the base What is your base activity? Mobile Dev? Web Frontend Dev? Web Backend Dev? Game Dev? U no Dev?
Parse services overview
Azure Mobile Services Overview
Parse Vs. Azure
It is your choice
Getting started Create account and app Download SDK Download seed project Check app key and secret Initialize
User management user.signUpInBackground user.loginInBackground ParseUser.getCurrentUser (and fetch()) ParseUser.logout ParseUser.requestPasswordResetInBackground ParseAnonymusUtils (for anonymous users) ParseFacebookUtils ParseTwitterUtils ParseUser user = new ParseUser(); user.setUsername("my name"); user.setPassword("my pass"); user.setEmail("email@example.com"); //Adding users to roles ParseRole role = new ParseRole(roleName, roleACL); for (ParseUser user : usersToAddToRole) { role.getUsers().add(user) }
Data modeling 128K maximum size permitted Parse is using MongoDB Azure mobile services use Azure SQL DB (can change) Define tables via portal Creating columns dynamically 128K maximum size permitted Task scannedTask = new Task(); scannedTask.put("title","SomeTitle"); scannedTask.put("assigned_to", ParseUser.getCurrentUser()); scannedTask.put("fulfilled", false); scannedTask.saveInBackground
Data relations One-to-Many Many-to-Many One-to-One pointers and arrays parse relations, joint tables, arrays One-to-One ParseRelation<ParseObject> relation = book.getRelation("authors"); relation.add(authorOne);
Accessing the data ParseQuery<ParseObject> query = ParseQuery.getQuery("Task"); query.whereEqualTo("title", "SomeTitle"); query.findInBackground(new FindCallback<ParseObject>() { public void done(List<ParseObject> taskList, ParseException e) { if (e == null) { Log.d("tasks", "Retrieved " + taskList.size() + " tasks"); } else { Log.d("tasks", "Error: " + e.getMessage()); } } });
Cloud code Parse.Cloud.beforeSave(Parse.User, function(request, response) { var user = request.object; if (!user.get("email")) { response.error("Every user must have an email address."); } else { response.success(); } });
Cloud code Parse.Cloud.beforeSave Parse.Cloud.afterSave Parse.Cloud.beforeDelete Parse.Cloud.afterDelete Parse.Cloud.define("SomeFunction", function(request, response) { . } [PFCloud callFunctionInBackground:@"SomeFunction" withParameters:@{ @"parameterKey": @"parameterValue"} block:^(NSArray *results, NSError *error) { if (!error) { // this is where you handle the results and change the UI. } }];
Analytics Map<String, String> dimensions = new HashMap<String, String>(); // Define ranges to bucket data points into meaningful segments dimensions.put("priceRange", "1000-1500"); // Did the user filter the query? dimensions.put("source", "craigslist"); // Do searches happen more often on weekdays or weekends? dimensions.put("dayType", "weekday"); // Send the dimensions to Parse along with the 'search' event ParseAnalytics.trackEvent("search", dimensions);
Push notifications push.gcm.send(results[0].handle, item.text, { success: function(response) { console.log('Push notification sent: ', response) }, error: function(error) { console.log('Error sending push notification: ', error); }
Portal demo If we have time?
Conclusion
Q&A
One more thing :) mobiledevelope.rs
My contact info M: djonovic.g@gmail.com T: @gdjonovic L: https://rs.linkedin.com/in/gdjonovic