当前位置: 首页>>代码示例>>Java>>正文


Java UploadFileListener类代码示例

本文整理汇总了Java中cn.bmob.v3.listener.UploadFileListener的典型用法代码示例。如果您正苦于以下问题:Java UploadFileListener类的具体用法?Java UploadFileListener怎么用?Java UploadFileListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UploadFileListener类属于cn.bmob.v3.listener包,在下文中一共展示了UploadFileListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: uploaderAvertor

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void uploaderAvertor(String file)
  {
      File path = new File(file);
//  Log.e(TAG, "=====uploade_avertor___success===>" + path.getAbsolutePath());
      final BmobFile bmobFile = new BmobFile(path);
      bmobFile.upload(this, new UploadFileListener() {
		@Override
		public void onSuccess()
		{
			user.setAuvter(bmobFile);
			//   Log.e(TAG, "=====uploade_avertor___success===>" + bmobFile.getUrl());
			updateProfile();
		}

		@Override
		public void onFailure(int i, String s)
		{

			// Log.e(TAG, "=====uploade_avertor___onfailure===>" + s);
		}
	});
  }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:23,代码来源:UserProfileActivity.java

示例2: updateImageFile

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的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);
		}
	});

}
 
开发者ID:tony-Shx,项目名称:Swface,代码行数:25,代码来源:AddFaceActivity.java

示例3: upLoadAvatar

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void upLoadAvatar() {
        File file = new File(cropFileUri.getPath());
        bf = new BmobFile(file);
        bf.uploadblock(new UploadFileListener() {
            @Override
            public void done(BmobException e) {
                if (e == null) {
                    showToast("上传成功!");

//                    先加载本地的图片

                    loadImage(bf.getUrl(), ivPhoto);

                } else {
                    showToast("上传失败!"+e.getErrorCode()+e.getMessage());
                }
            }
        });


    }
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:22,代码来源:PublishAActivity.java

示例4: toQuery

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void toQuery() {
    if (mTvCarnub.getText().toString()=="扫描二维码或者手动输入") {
        ToastUtils.show(ReportViolationsActivity.this, "请输入单车编号");
        return;
    }
    if (TextUtils.isEmpty(mEtBikeDamage.getText().toString())) {
        ToastUtils.show(ReportViolationsActivity.this, "请输入描述信息");
        return;
    }
    mDialog.show();
    mDialog.show();
    bmobFile.upload(new UploadFileListener() {
        @Override
        public void done(BmobException e) {
            if (e == null) {
                saveDatial();
            } else {
                Logger.d(e);
                ToastUtils.show(ReportViolationsActivity.this, "图片上传失败");
            }
            if (mDialog.isShowing())
                mDialog.dismiss();
        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:26,代码来源:ReportViolationsActivity.java

示例5: toQuery

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的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();
        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:23,代码来源:DepositRefundIssueActivity.java

示例6: upLoadAudio

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
/**
 * 上传录音
 */
private void upLoadAudio() {
	File f = new File(recorderPath);
	if (!f.exists()) {
		T.show(context, "文件出错");
	}
	L.i("录音文件路径" + recorderPath);
	final BmobFile bf = new BmobFile(f);
	loading.setVisibility(0);
	bf.uploadblock(context, new UploadFileListener() {
		@Override
		public void onSuccess() {
			audioUrl = bf.getFileUrl(context);
			loading.setVisibility(View.GONE);
			L.e("录音上传成功:" + audioUrl);
		}

		@Override
		public void onFailure(int arg0, String arg1) {
			// loading.setVisibility(View.GONE);
			L.e("录音上传失败" + arg0 + arg1);
		}
	});
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:27,代码来源:AlertActivity.java

示例7: uploadPic

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
/**
 * 上传图片更新网络信息
 *
 * @param f
 */
private void uploadPic(File f) {
    loader.displayImage("file://" + f.getAbsolutePath(), iv_photo, option_pic);
    final BmobFile bf = new BmobFile(f);
    bf.uploadblock(context, new UploadFileListener() {
        @Override
        public void onSuccess() {
            currentUser.setAvatar(bf.getFileUrl(getApplicationContext()));
            loader.displayImage(bf.getFileUrl(getApplicationContext()), iv_photo, option_pic);
        }

        @Override
        public void onFailure(int arg0, String arg1) {
            T.show(context, "上传失败");
        }
    });
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:22,代码来源:EditMyInfoActivity.java

示例8: upLoadFile

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
/**
 * 上传一个文件
 *
 * @param context
 * @param f
 * @param upLoadListener
 */
public static void upLoadFile(final Context context, File f, final UpLoadListener upLoadListener) {
    final BmobFile bf = new BmobFile(f);
    bf.uploadblock(context, new UploadFileListener() {
        @Override
        public void onSuccess() {
            L.d("上传文件成功" + bf.getFileUrl(context));
            upLoadListener.onSuccess(bf.getFileUrl(context));
        }

        @Override
        public void onFailure(int arg0, String arg1) {
            L.d("上传文件失败" + arg0 + arg1);
            upLoadListener.onFailure(arg0, arg1);
        }
    });
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:24,代码来源:TaskUtil.java

示例9: updateImageFile

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void updateImageFile(File imageFile, final UserHasSigned userHasSigned, final DatabaseAdapter db) {
	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 ");
				userHasSigned.setFace_url1(file.getFileUrl());
				Log.i(TAG, "file.uploadblock:if ");
				dialog.setMessage("上传图片成功!");
				dialog.show();
				new Thread(new Runnable() {
					@Override
					public void run() {
						BmobDataHelper bmobDataHelper = new BmobDataHelper(RegisterFaceActivity.this, myhandler);
						bmobDataHelper.addUserHasSign(userHasSigned);
					}
				}).start();
			} else {
				Log.e(TAG, "file.uploadblock:failed ", e);
				Message message = new Message();
				message.arg1 = FinalUtil.DETECT_FAILED_IO_EXCEPTION;
				myhandler.sendMessage(message);
			}
		}

		@Override
		public void onProgress(Integer value) {
			super.onProgress(value);
			Log.i(TAG, "onProgress: " + value);
			fileUploadProgress = value;
		}
	});

}
 
开发者ID:tony-Shx,项目名称:Swface,代码行数:36,代码来源:RegisterFaceActivity.java

示例10: uploadAvatar

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void uploadAvatar(File file) {
    BmobFile bmobFile = new BmobFile(file);
    bmobFile.uploadblock(new UploadFileListener() {
        @Override
        public void done(BmobException e) {
            if (e == null) {
                Toast.makeText(UserActivity.this, "头像保存成功",
                        Toast.LENGTH_SHORT).show();
            } else {
                LogUtil.e(e.toString());
            }
        }
    });
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:15,代码来源:UserActivity.java

示例11: toQuery

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void toQuery() {
    mBtQuery.setClickable(false);
    if (mTvCarnub.getText().toString()=="扫描二维码或者手动输入") {
        ToastUtils.show(BikeDamageReportActivity.this, "请输入单车编号");
        return;
    }
    if (TextUtils.isEmpty(mEtBikeDamage.getText().toString())) {
        ToastUtils.show(BikeDamageReportActivity.this, "请输入描述信息");
        return;
    }
    mDialog.show();
    bmobFile.upload(new UploadFileListener() {
        @Override
        public void done(BmobException e) {
            if (e == null) {
               saveDatial();
            } else {
                Logger.d(e);
                mBtQuery.setClickable(true);
                ToastUtils.show(BikeDamageReportActivity.this, "图片上传失败");
            }
            if (mDialog.isShowing())
                mDialog.dismiss();

        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:28,代码来源:BikeDamageReportActivity.java

示例12: uploadImage

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
private void uploadImage(int requestCode, int resultCode, Intent data) {
    Log.d("uploadImage", "uploadImage: " + requestCode);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == REQS_IMAGE_PICKER) {
            ArrayList<ImageItem> images = null;
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            ImageItem imageItem = images.get(0);
            final BmobFile bmobFile = new BmobFile(new File(imageItem.path));
            bmobFile.upload(new UploadFileListener() {
                @Override
                public void done(BmobException e) {
                    if (e == null) {
                        MyUser NMyUser = new MyUser();
                        NMyUser.setPicUser(bmobFile);
                        mMyUser.setPicUser(bmobFile);
                        MyApplication.getInstance().upDataUser(mMyUser, NMyUser);
                        Glide.with(UserDetailActivity.this).load(bmobFile.getUrl()).into(mTvHead.getRigtImageView());
                    } else {
                        ToastUtils.show(UserDetailActivity.this, "上传失败");
                    }
                }
            });

        } else {
            Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show();
        }
    }
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:29,代码来源:UserDetailActivity.java

示例13: uploadHeader

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
@NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE)
protected void uploadHeader(final Uri saveUri) {
    final BmobFile bmobFile = new BmobFile(new File(URI.create(saveUri.toString())));
    mHeaderView.setImageURI(saveUri);
    bmobFile.uploadblock(MainActivity.this, new UploadFileListener() {

        @Override
        public void onSuccess() {
            // TODO Auto-generated method stub
            //bmobFile.getUrl()---返回的上传文件的地址(不带域名)
            //bmobFile.getFileUrl(context)--返回的上传文件的完整地址(带域名)
            Logs.e("fileUrl:" + bmobFile.getFileUrl(MainActivity.this));
            PineApplication.mCurrentUser.setAvatar(bmobFile.getFileUrl(MainActivity.this));
            mAccountService.updateServerUser(MainActivity.this, PineApplication.mCurrentUser);
        }

        @Override
        public void onProgress(Integer value) {
            // TODO Auto-generated method stub
            // 返回的上传进度(百分比)
            Logs.e("Progress: " + value + "%");
        }

        @Override
        public void onFailure(int code, String msg) {
            // TODO Auto-generated method stub
            Logs.e("上传文件失败:" + msg);

        }
    });
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:32,代码来源:MainActivity.java

示例14: call

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
@Override
public Boolean call() throws Exception {

    if(!TextUtils.isEmpty(mFilePath)){
        mFile = new File(mFilePath);
    }
    if(null==mFile||!mFile.exists()){
        throw new FileNotFoundException();
    }

    final BmobFile bmobFile = new BmobFile(mFile);
    bmobFile.uploadblock(PineApplication.mContext, new UploadFileListener() {
        @Override
        public void onSuccess() {
            Logs.e("bmobFile upload onSuccess: " + bmobFile.getFileUrl(PineApplication.mContext));
            FileUploader.this.mUploadListener.onSuccess(mFile,bmobFile.getFileUrl(PineApplication.mContext));
        }

        @Override
        public void onFailure(int i, String s) {
            Logs.e("bmobFile upload onFailure: " + s);
            FileUploader.this.mUploadListener.onFailure(i,s);
        }
    });

    return true;
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:28,代码来源:FileUploader.java

示例15: onActivityResult

import cn.bmob.v3.listener.UploadFileListener; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    L.d(requestCode + "," + resultCode + "," + data);
    if (resultCode == RESULT_OK) {
        List<String> images = data.getStringArrayListExtra(AlbumActivity.INTENT_SELECTED_PICTURE);
        if (images == null || images.size() <= 0) {
            return;
        }
        File f = new File(images.get(0));
        L.e("照片路径:" + f.getAbsolutePath());
        if (f.exists()) {
            final BmobFile bf = new BmobFile(f);
            bf.uploadblock(context, new UploadFileListener() {
                @Override
                public void onSuccess() {
                    list.add(bf.getFileUrl(getApplicationContext()));
                    adapter.notifyDataSetChanged();
                    updateAlbum();
                }
                @Override
                public void onFailure(int arg0, String arg1) {
                    T.show(context, "上传失败");
                }
            });
        }
    }
    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:29,代码来源:MyPhotoActivity.java


注:本文中的cn.bmob.v3.listener.UploadFileListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。