本文整理汇总了Java中cn.bmob.v3.datatype.BmobFile类的典型用法代码示例。如果您正苦于以下问题:Java BmobFile类的具体用法?Java BmobFile怎么用?Java BmobFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BmobFile类属于cn.bmob.v3.datatype包,在下文中一共展示了BmobFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: uploaderAvertor
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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);
}
});
}
示例2: updateImageFile
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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);
}
});
}
示例3: upLoadAvatar
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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());
}
}
});
}
示例4: initData
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
@Override
public void initData() {
mCurrentUser = BmobUser.getCurrentUser(User.class);
BmobFile userPhotoFile = mCurrentUser.getUserPhoto();
String nick = mCurrentUser.getNick();
String objectId = mCurrentUser.getObjectId();
if (!TextUtils.isEmpty(nick)) {
mTvName.setText(nick);
}
if (!TextUtils.isEmpty(objectId)) {
mTvID.setText("飞鸽号:" + objectId);
}
if (userPhotoFile == null) {
mCivUserPhoto.setImageResource(R.drawable.ic_default);
} else {
Picasso.with(getContext()).load(userPhotoFile.getFileUrl()).into(mCivUserPhoto);
}
}
示例5: upLoadAudio
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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);
}
});
}
示例6: uploadPic
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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, "上传失败");
}
});
}
示例7: upLoadFile
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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);
}
});
}
示例8: loadData
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
private void loadData(User user) {
if (user != null) {
mNickText.setText(user.getNick());
mSignatureText.setText(user.getSignature());
mAccountText.setText(user.getUsername());
BmobFile avatarFile = user.getAvatarImg();
if (avatarFile != null) {
ImageLoader.getInstance().displayImage(user.getAvatar(), mAvatarImg, ImageLoadOptions.getOptions());
} else {
mAvatarImg.setImageResource(R.drawable.default_head_cry);
}
if (from.equals("other")) {
if (BmobDB.create(this).isBlackUser(user.getUsername())) {
mAddBlackBtn.setVisibility(View.GONE);
} else {
mAddBlackBtn.setVisibility(View.VISIBLE);
}
}
}
}
示例9: updateImageFile
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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;
}
});
}
示例10: setUserInfo
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
@Subscriber(tag = EventBusTags.SET_USER_INFO)
public void setUserInfo(User user) {
mTvName.setText(User.getCurrentUser().getUsername());
if (user.getIcon() != null){
BmobFile file = user.getIcon();
appComponent.imageLoader().loadImage(getActivity(), ImageConfigImpl
.builder()
.url(file.getFileUrl())
.imageView(mCivFace)
.dontAnimate(true)
.placeholder(R.drawable.ic_noface)
.errorPic(R.drawable.ic_noface)
.build());
}
}
示例11: Article
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
public Article(String title, String content, BmobFile photo, Integer likeNum, Integer commentNum, String upTime, BmobRelation like, BmobRelation collect, ArrayList<String> likeIdList, ArrayList<String> collectIdList) {
this.title = title;
this.content = content;
this.photo = photo;
this.likeNum = likeNum;
this.commentNum = commentNum;
this.upTime = upTime;
this.like = like;
this.collect = collect;
this.likeIdList = likeIdList;
this.collectIdList = collectIdList;
}
示例12: User
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
public User(String nickName, String realName, BmobFile avatar, Boolean gender, String intro, String school, String position, String like, String birthday, Integer dynamicNum, Integer fanNum, BmobRelation focus, ArrayList<String> focusIds) {
this.nickName = nickName;
this.realName = realName;
this.avatar = avatar;
this.gender = gender;
this.intro = intro;
this.school = school;
this.position = position;
this.like = like;
this.birthday = birthday;
this.dynamicNum = dynamicNum;
this.fanNum = fanNum;
this.focus = focus;
this.focusIds = focusIds;
}
示例13: Rank
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
public Rank(BmobFile image, String title, User no1, User no2, User no3, User no4, User no5, User no6, User no7, User no8, User no9, User no10, Integer order) {
this.image = image;
this.title = title;
this.no1 = no1;
this.no2 = no2;
this.no3 = no3;
this.no4 = no4;
this.no5 = no5;
this.no6 = no6;
this.no7 = no7;
this.no8 = no8;
this.no9 = no9;
this.no10 = no10;
this.order = order;
}
示例14: uploadAvatar
import cn.bmob.v3.datatype.BmobFile; //导入依赖的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());
}
}
});
}
示例15: uploadImage
import cn.bmob.v3.datatype.BmobFile; //导入依赖的package包/类
private void uploadImage(int requestCode, int resultCode, Intent data) {
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);
Glide.with(BikeDamageReportActivity.this).load(imageItem.path).into(mIvPick);
// if (bmobFile == null)
bmobFile = new BmobFile(new File(imageItem.path));
bmobFile.setUrl(imageItem.path);
} else {
Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show();
}
}
}