BaasBox - Your mobile backend made easy
-
Upload
commit-university -
Category
Engineering
-
view
468 -
download
4
Transcript of BaasBox - Your mobile backend made easy
![Page 1: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/1.jpg)
Andrea Tortorella [email protected]+39 06 62 27 54 18eliantor
![Page 2: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/2.jpg)
Appsarecomplex
![Page 3: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/3.jpg)
Greatappdesign
![Page 4: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/4.jpg)
Appsareconnected
![Page 5: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/5.jpg)
NoonecaresAboutYour
Backend!
![Page 6: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/6.jpg)
…YETWITHOUTYOURAPP
ISJUSTATOY
![Page 7: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/7.jpg)
PutsomeBaasBoxInyourengine
![Page 8: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/8.jpg)
DEMOTIME
![Page 9: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/9.jpg)
![Page 10: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/10.jpg)
AndroidSDK
• SimplifyBaasBox integration• IntegratewithAndroidapis• Favornativebestpractices
![Page 11: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/11.jpg)
ASHORTGUIDETOTHEAPI
![Page 12: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/12.jpg)
Loginpublic void login(String username,String password) {
BaasUser user = BaasUser.withUserName(username).setPassword(password);
user.login(new BaasHandler<BaasUser>() {@Overridepublic void handle(BaasResult<BaasUser> baasResult) {
if (baasResult.isSuccess()) {//user successfully logged in
}}});
}
![Page 13: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/13.jpg)
Getsomedatapublic void loadDocuments (String collection) {
BaasQuery.Criteria filter = BaasQuery.builder().where("where condition").pagination(0, 3).orderBy("field desc").criteria();
BaasDocument.fetchAll(collection, filter,new BaasHandler<List<BaasDocument>>() {
@Overridepublic void handle(BaasResult<List<BaasDocument>>
baasResult) {//work with the data
}});
}
![Page 14: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/14.jpg)
WorkingwithdocumentsBaasDocument doc = BaasDocument.create("collection");doc.put("key","value");doc.put("key2", JsonArray.of("val1", 2, true));
BaasACL acl = BaasACL.builder().users(Grant.READ, "username1", "username2").roles(Grant.UPDATE, Role.REGISTERED).build();
doc.save(acl,...);
![Page 15: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/15.jpg)
UploadfilesBaasFile file = BaasFile.create();// BaasFile.create(new JsonObject().put("key","metadata"));
byte[] inMemory = ...;file.upload(inMemory,...);
InputStream stream = ...;file.upload(stream,...);
File fileOnDisk = ...;file.upload(fileOnDisk,...);
![Page 16: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/16.jpg)
DownloadfilesBaasFile.fetchStream("id", new BaasHandler<BaasFile>() {
@Overridepublic void handle(BaasResult<BaasFile> baasResult) {
if (baasResult.isSuccess()){BaasFile value = baasResult.value();byte[] fileContent = value.getData();JsonObject serverMeta = value.getMetadata();JsonObject userData =value.getAttachedData();
}}
});
![Page 17: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/17.jpg)
SimpleimagehandlingBaasBox.builder(context)
.addPlugin(GlidePlugin.PLUGIN)
.init();
Glide.with(context).load(file).into(view);
*Effortlessintegrationwithcommonandroidimageloaders
![Page 18: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/18.jpg)
LinkssupportBaasLink.create("relationship","id","target-id",...);
BaasObject source = BaasLink.withId("id").in();
BaasObject target = BaasLink.withId("id").out();
BaasLink.fetchAll(BaasQuery.Criteria.ANY,0,...);
![Page 19: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/19.jpg)
Collaboration/SocialBaasUser.withUserName("wannabe friend").follow(...);
BaasUser.withUserName("my worst enemy").unfollow(...);
BaasUser.current().followers(BaasQuery.builder()
.where("....")
.criteria(),...);
BaasUser.withUserName("a user").following(...);
Role.friendsOf("my friends role");
![Page 20: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/20.jpg)
ServerpushBaasCloudMessagingService ms = BaasBox.messagingService();
ms.newMessage().timeToLive(…).collapseKey(…).profiles(
BaasCloudMessagingService.DEFAULT_PROFILE,BaasCloudMessagingService.PROFILE2)
.extra(JsonObject.of("key","value",
"key2",true)).send(...);
![Page 21: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/21.jpg)
Lowlevelaccess// direct yet simplified restful accessRequestToken token = BaasBox.rest()
.async(httpMethod,"endpoint”,…);
BaasResult<JsonObject> res = BaasBox.rest().sync(httpMethod, "endpoint”,...);
// concurrency and lifecycle control// suspend remote callstoken.suspend();
// resume callstoken.resume(new BaasHandler<JSONObject>() {
@Overridepublic void handle(BaasResult<JSONObject> baasResult) {
//...}
});
![Page 22: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/22.jpg)
G-Ratehttp://www.androidev.it/commit/
![Page 23: BaasBox - Your mobile backend made easy](https://reader034.fdocuments.in/reader034/viewer/2022042723/58ef12bf1a28ab834b8b4635/html5/thumbnails/23.jpg)
Thank you