本文整理汇总了Java中cn.bmob.v3.exception.BmobException类的典型用法代码示例。如果您正苦于以下问题:Java BmobException类的具体用法?Java BmobException怎么用?Java BmobException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BmobException类属于cn.bmob.v3.exception包,在下文中一共展示了BmobException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerData
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
/**
* 注册
*/
private void registerData() {
final String name = etusername.getText().toString();
final String password = etpassword.getText().toString();
final String email = etemail.getText().toString();
BmobUser bu = new BmobUser();
bu.setUsername(name);
bu.setPassword(password);
bu.setEmail(email);
bu.signUp(new SaveListener<BmobUser>() {
@Override
public void done(BmobUser bmobUser, BmobException e) {
if(e==null){
Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
RegisterActivity.this.finish();
}else{
Toast.makeText(RegisterActivity.this, "注册失败", Toast.LENGTH_SHORT).show();
}}
});
}
示例2: lxwLogin
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void lxwLogin(String email, String password)
{
MyUser user = new MyUser();
user.setEmail(email);
user.setPassword(password);
BmobUser.loginByAccount(getActivity(), email, password, new LogInListener<MyUser>() {
@Override
public void done(MyUser myUser, BmobException e)
{
if (myUser != null)
{
//Toast.makeText(getActivity(), "用户登录成功", Toast.LENGTH_SHORT).show();
bindUserIdAndDriverice(myUser);
}
else
{
mProgressView.setVisibility(View.GONE);
//mLoginFormView.setVisibility(View.VISIBLE);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage("登录失败,可能是邮箱或者密码错误!").create().show();
//Log.e(TAG, "---login_error----" + e);
}
}
});
}
示例3: addUserHasSign
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
public void addUserHasSign(final UserHasSigned userHasSigned) {
userHasSigned.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
if (e == null) {
Log.i(TAG, "userHasSigned.save: success");
DatabaseAdapter db = new DatabaseAdapter(context);
userHasSigned.setObjectId(s);
db.addUser_User(userHasSigned, myHandler);
Log.i(TAG, "addUser_User: Success!");
} else {
Log.e(TAG, "userHasSigned.save: failed" + e);
Message message = new Message();
message.arg1 = FinalUtil.DETECT_FAILED_IO_EXCEPTION;
myHandler.sendMessage(message);
}
}
});
}
示例4: deleteUserFace
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
public void deleteUserFace(final String object, final String faceToken, final String faceUrl){
UserHasSigned userHasSigned = new UserHasSigned(context);
userHasSigned.setObjectId(object);
userHasSigned.remove(faceToken);
userHasSigned.remove(faceUrl);
userHasSigned.update(new UpdateListener() {
@Override
public void done(BmobException e) {
if(e==null){
DatabaseAdapter db = new DatabaseAdapter(context);
db.deleteUserFace_User(object,faceToken,faceUrl,myHandler);
}else{
Log.e(TAG, "deleteUserFace: ", e);
Message message = Message.obtain();
message.arg1 = FinalUtil.REMOVE_FACE_BMOB_EXCEPTION;
myHandler.sendMessage(message);
}
}
});
}
示例5: deleteUser
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
public void deleteUser(final String objectId){
UserHasSigned userHasSigned = new UserHasSigned(context);
userHasSigned.setObjectId(objectId);
userHasSigned.delete(new UpdateListener() {
@Override
public void done(BmobException e) {
if(e==null){
DatabaseAdapter db = new DatabaseAdapter(context);
db.deleteUser_User(objectId,myHandler);
}else{
Log.e(TAG, "userHasSigned.delete: ", e);
Message message = Message.obtain();
message.arg1 = FinalUtil.REMOVE_USER_BMOB_EXCEPTION;
myHandler.sendMessage(message);
}
}
});
}
示例6: updateImageFile
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void updateImageFile(File imageFile) {
final BmobFile file = new BmobFile(imageFile);
file.uploadblock(new UploadFileListener() {
@Override
public void done(BmobException e) {
if (e == null) {
Log.i(TAG, "file.uploadblock:success ");
createFaceSet(file.getFileUrl());
} else {
Log.e(TAG, "file.uploadblock:failed ", e);
Message message = new Message();
message.arg1 = FinalUtil.UPDATE_PICTURE_EXCEPTION;
myhandler.sendMessage(message);
}
}
@Override
public void onProgress(Integer value) {
super.onProgress(value);
Log.i(TAG, "onProgress: " + value);
}
});
}
示例7: startSearchUser
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void startSearchUser(final String username, final String password) {
BmobQuery<UserLogin> query = new BmobQuery<>();
query.addWhereEqualTo("username", username);
query.setLimit(1);
query.findObjects(new FindListener<UserLogin>() {
@Override
public void done(List<UserLogin> list, BmobException e) {
if (e == null && !list.isEmpty()) {
startLogin(list.get(0));
} else if (e == null) {
startRegister(username, password);
} else {
showNormalDia("温馨提示", "登录失败!请检查网络连接");
Log.e(TAG, "query.findObjects: ", e);
}
}
});
}
示例8: saveDatial
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void saveDatial() {
mData.setMyUser(mMyUser);
mData.setCarNub(mTvCarnub.getText().toString());
mData.setDesc(mEtBikeDamage.getText().toString());
mData.setCarPic(bmobFile);
mData.setType(mAdapter.getType());
mData.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
if (e == null) {
ToastUtils.show(BikeDamageReportActivity.this, "提交成功");
finish();
} else {
Logger.d(e);
ToastUtils.show(BikeDamageReportActivity.this, "提交失败");
}
mBtQuery.setClickable(true);
if (mDialog.isShowing())
mDialog.dismiss();
}
});
}
示例9: sendJsonMessage
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
/**
* 推送消息
*
* @param installId 对方用户设备ID
* @param message 可推送的消息 JSONObject
* @param listener 回调
*/
private void sendJsonMessage(String installId, final JSONObject message, final OnSendPushMessageListener listener) {
sendJsonMessage(installId, message, new PushListener() {
@Override
public void onSuccess() {
LogUtil.e("推送消息成功");
listener.onSuccess();
}
@Override
public void onFailure(int i, String s) {
LogUtil.e("推送消息失败" + s + i);
listener.onFailed(new BmobException(s));
}
}
);
}
示例10: requesData
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void requesData() {
mDialog.show();
if (mQuery == null) {
mQuery = new BmobQuery<>("MyCouponsData");
mQuery.setLimit(10);
mQuery.addWhereEqualTo("mMyUser", MyApplication.getInstance().getUser().getObjectId());
mQuery.order("-updatedAt");
}
mQuery.findObjects(new FindListener<MyCouponsData>() {
@Override
public void done(List<MyCouponsData> list, BmobException e) {
if (e == null) {
mData = list;
showCoupons();
} else {
ToastUtils.show(MyCouponsActivity.this, "暂时没有优惠信息");
Logger.d(e);
}
dismissMyDialog();
}
});
}
示例11: registe
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
public void registe(final String name, final String password, final String phone, final String email) {
ThreadUtils.runOnSubthread(new Runnable() {
@Override
public void run() {
final UserInfo info = new UserInfo();
info.setUsername(name);
info.setPassword(password);
info.setEmail(email);
info.setPhoneNumber(phone);
info.save(new SaveListener<String>() {
@Override
public void done(String s, BmobException e) {
if (e == null) {
//注册成功
iRegisterView.registerSucc();
} else {
//注册失败
iRegisterView.registerFail(e.getMessage());
}
}
});
}
});
}
示例12: checkNameExist
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
public void checkNameExist(final String name, final String password, final String phone, final String email) {
if (emptyChecked(name, password, phone)) {
ThreadUtils.runOnSubthread(new Runnable() {
@Override
public void run() {
BmobQuery<UserInfo> bmobQuery = new BmobQuery<>();
bmobQuery.addWhereEqualTo("username", name);
bmobQuery.findObjects(new FindListener<UserInfo>() {
@Override
public void done(List<UserInfo> list, BmobException e) {
if (list.size() > 0) {
iRegisterView.nameExist();
} else {
registe(name, password, phone, email);
}
}
});
}
});
}
}
示例13: toQuery
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void toQuery() {
if (bmobFile == null) {
ToastUtils.show(this, "请上传订单截图");
return;
}
if (TextUtils.isEmpty(mEtOrder.getText().toString())) {
ToastUtils.show(this, "请填写订单号");
return;
}
mDialog.show();
bmobFile.upload(new UploadFileListener() {
@Override
public void done(BmobException e) {
if (e == null) {
uploadData();
} else {
ToastUtils.show(DepositRefundIssueActivity.this, "上传失败");
}
DismissDialog();
}
});
}
示例14: getLikesData
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
private void getLikesData() {
BmobQuery<MyUser> query = new BmobQuery<>();
Post post = new Post();
post.setObjectId(mPost.getObjectId());
query.addWhereRelatedTo("likes", new BmobPointer(post));
query.findObjects(new FindListener<MyUser>() {
@Override
public void done(List<MyUser> list, BmobException e) {
if (e == null) {
if (list.isEmpty()) {
mPostDetailLikesRecycler.setVisibility(View.GONE);
mLikesNo.setVisibility(View.VISIBLE);
mLikesNo.setText(R.string.likes_no);
} else {
mPostDetailLikesRecycler.setVisibility(View.VISIBLE);
mLikesNo.setVisibility(View.GONE);
mLikesAdapter.setLikesUserData(list);
mLikesAdapter.notifyDataSetChanged();
}
} else {
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
});
}
示例15: connect
import cn.bmob.v3.exception.BmobException; //导入依赖的package包/类
public static void connect(final User user, final BmobEvent.onConnectListener listener) {
User curr = BmobUser.getCurrentUser(User.class);
if (!TextUtils.isEmpty(curr.getObjectId())) {
BmobIM.connect(user.getObjectId(), new ConnectListener() {
@Override
public void done(String s, BmobException e) {
if (null == e) {
if (BmobIM.getInstance().getCurrentStatus().getCode() != ConnectionStatus.CONNECTED.getCode()) {
listener.connectFailed("haven't connect server");
return;
}
listener.connectSuccessful(user);
} else {
listener.connectFailed(e.getMessage());
}
}
});
}
}