Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Playing with parse.com
1. Playing with parse.com
Building an app called Qoffee
Andrea De Gaetano
My Blog: http://pestohacks.blogspot.com
Twitter: @dega1999
the app: www.qoffee.it
Interests: #mobile #security #linux #robots #drones #parkour #ara
2. What is Parse?
Backend as a service
Bought in 2013 by Facebook
SDK for all the major client platforms:
android, ios, windows, unity3d, php,
iot… blablabla!
Useful to build multi-platform apps
Simplify APP development
“””Free”””(*)
Made with Go (previously ruby), C++,
Javascript
3. What is Qoffee?
My side project
An app that helps people to
find the best coffee in town
keep track of Coffee consumption
With Achievements
Test Parse.com is one of the reason behind this app
The app is available on Play Store and Amazon App Store
https://play.google.com/store/apps/details?
id=com.andrea.degaetano.coffelover
4. What we will see:
Platform Tools Overview
Getting started on Android
Build a Multiple-Login screen
Fetch Cloud Data from your Android App
Build API with Cloud Code
Schedule Tasks
6. Android: Getting Started
Create an account
Create an App on parse.com
Get App keys (in settings)
Download the template APP
Import the project in Android Studio
You need to create Facebook and Twitter App to use “social”
login
Template: https://github.com/ParsePlatform/ParseUI-Android
7. Social-Login Screen
Specify the following in res/values/strings.xml of each sample
project:
parse_app_id and parse_client_key
facebook_app_id
twitter_consumer_key and twitter_consumer_secret
Your users will be recorded in a “User” table on Cloud Data
New User creation is already implemented
Email password recovery is already implemented (customizable)
9. Connect with Parse Cloud
ParseObject is the class representing a single row in a table
in the cloud:
You can pass any supported cloud data type: number,
binary files, coordinates, string…
You can view the created data on your parse page
10. Connect with Parse Cloud
ParseQuery is the class to retrieve data from the cloud:
You can add constraint with where clause to ParseQuery like:
• whereGreaterThan(String key, Object value)
• whereExists(String key)
• whereStartsWith(String key, String prefix)
• whereWithinKilometers(String k, ParseGeoPoint p, double maxDistance)
• whereEqualTo(String key, Object value)
11. ListView —> ParseQueryAdapter
To display a list of objects you can:
build your own adapter and use ParseQuery
use the ParseQueryAdapter
ParseQueryAdapter paginate results by default
You can customize the layout
12. Cloud Code
All the advantages of the service side code:
expose API
simplify multiplatform support
change app behavior anytime
validate pre and post data creation:
BeforeSave(object): 3 secs timeout
AfterSave (object): 3 secs timeout
The language is Javascript: based on backbone.js
Function should finish in 15 seconds.
15. Cloud Code
ParseQuery typical function used:
first: retrieve the first object of a query
each: call a callback for each found record
find: list of objects that satisfies the query
…
Query are limited to a max of 1000 results (default is 100)
More requests you do —> More money you need!
16. Cloud Code
You use a terminal tool to upload new code: parse deploy
You can chain multiple operations with Promise
Hard to debug -> upload code, run and watch the results on the log
At least there’s a static analyzer checker
You can add external javascript library to your project:
underscore.js
sax.js
xmlreader.js
never work out of the box! :D
18. Schedule Task
The code is similar to cloud code, except for the functions
declaration
Necessary for long running task
The job functions require to return status.success o
status.error
You need to register the task with the platform
Debug —> Log