数据服务
支持丰富的数据类型,灵活方便的增删改查,可视化的数据操作,安全的角色和ACL管理,多表关联处理,数据的批量处理,本地数据缓存,开发者们无需关注服务器后端,就可以实现多平台的同步开发。
提供APP官网、计划任务、地理位置、云端代码等扩展服务,确保您的个性化业务逻辑能够在云端更好的运转。
现在来介绍怎么使用IOS绑定版本的bmob sdk.
<framework>CoreLocation</framework> <framework>Security</framework> <framework>CoreGraphics</framework> <framework>MobileCoreServices</framework> <framework>CFNetwork</framework> <framework>CoreTelephony</framework> <framework>SystemConfiguration</framework> <framework>AVFoundation</framework> <framework>MediaPlayer</framework> <framework>BmobSDK</framework>
<libs> <lib>icucore</lib> <lib>sqlite3</lib> <lib>z.1.2.5</lib> </libs>
private void add() { // bmob Bmob.registerWithAppKey("34b7704a3b372576a732b7675abce9e8"); // Gdx.app.log("xxx", "showInterAd"); System.out.println("showInterAd"); final BmobObject gameScore = new BmobObject("GameScore"); gameScore.setObject(new NSString("小明"), "playerName"); gameScore.setObject(NSNumber.valueOf(100), "playerScore"); gameScore.setObject(NSNumber.valueOf(true), "cheatMode"); gameScore.saveInBackgroundWithResultBlock(new BmobBooleanResultBlock() { @Override public void invoke(boolean isSuccessful, NSError error) { if (isSuccessful) { System.out.println("success"); System.out.println(gameScore.getObjectId()); System.out.println(Bmob.getServerTimestamp()); query(); } else { System.out.println(error.getErrorCode() + error.getDomain()); } } }); System.out.println("showInterAd ---- end"); } private void query() { BmobQuery mBmobQuery = new BmobQuery("GameScore"); mBmobQuery.getObjectInBackgroundWithId("bad60c9b08", new BmobObjectResultBlock() { @Override public void invoke(BmobObject object, NSError error) { String name = object.objectForKey("playerName") .toString(); System.out.println("name = " + name); change(object); } }); } private void change(final BmobObject object) { BmobObject obj = BmobObject.objectWithoutDatatWithClassName( object.getClassName(), object.getObjectId()); obj.setObject(new NSString("改过的小明"), "playerName"); obj.updateInBackgroundWithResultBlock(new BmobBooleanResultBlock() { @Override public void invoke(boolean isSuccessful, NSError error) { // TODO Auto-generated method stub System.out.println("修改成功...."); delete(object); } }); } private void delete(BmobObject object) { object.deleteInBackgroundWithBlock(new BmobBooleanResultBlock() { @Override public void invoke(boolean isSuccessful, NSError error) { System.out.println("删除成功...."); } }); }
原文地址:http://blog.csdn.net/qq634416025/article/details/46120397