290 likes | 310 Views
Learn how to prototype faster by leveraging Parse and Azure mobile services. Explore tools, data modeling techniques, and cloud code to streamline development from a mobile perspective. Understand the pros and cons of using (M)BaaS platforms and discover the next steps in your app development journey. Join us for a comprehensive session on backend-as-a-service platforms and enhance your prototyping skills.
E N D
July15th 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
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"
Vs. Business hypothesis Business requirements
Requirements... I want it all, I want it all, and I want it now!
Hypothesis asdas
It's all about the base What is your base activity? Mobile Dev? Web Frontend Dev? Web Backend Dev? Game Dev? U no Dev?
Getting started • Create account and app • Download SDK • Download seed project • Check app key and secret • Initialize
User management 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)} user.signUpInBackground user.loginInBackground ParseUser.getCurrentUser (and fetch()) ParseUser.logout ParseUser.requestPasswordResetInBackground ParseAnonymusUtils (for anonymous users) ParseFacebookUtils ParseTwitterUtils
Data modeling Task scannedTask = new Task(); scannedTask.put("title","SomeTitle"); scannedTask.put("assigned_to", ParseUser.getCurrentUser()); scannedTask.put("fulfilled", false); scannedTask.saveInBackground • Parse is using MongoDB • Azure mobile services use Azure SQL DB (can change) • Define tables via portal • Creating columns dynamically • 128K maximum size permitted
Data relations One-to-Many pointers and arrays Many-to-Many 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>() {publicvoiddone(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 [PFCloud callFunctionInBackground:@"SomeFunction" withParameters:@{ @"parameterKey": @"parameterValue"} block:^(NSArray *results, NSError *error) { if (!error) { // this is where you handle the results and change the UI. }}]; Parse.Cloud.beforeSave Parse.Cloud.afterSave Parse.Cloud.beforeDelete Parse.Cloud.afterDelete Parse.Cloud.define("SomeFunction", function(request, response) { . . . }
Analytics Map<String, String> dimensions = new HashMap<String, String>();// Define ranges to bucket data points into meaningful segmentsdimensions.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' eventParseAnalytics.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?
One more thing :) mobiledevelope.rs
My contact info M: djonovic.g@gmail.com T: @gdjonovic L: https://rs.linkedin.com/in/gdjonovic