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


Java BmobFile类代码示例

本文整理汇总了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);
		}
	});
  }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:23,代码来源:UserProfileActivity.java

示例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);
		}
	});

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

示例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());
                }
            }
        });


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

示例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);
    }

}
 
开发者ID:monsterLin,项目名称:Pigeon,代码行数:24,代码来源:PersonFragment.java

示例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);
		}
	});
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:27,代码来源:AlertActivity.java

示例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, "上传失败");
        }
    });
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:22,代码来源:EditMyInfoActivity.java

示例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);
        }
    });
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:24,代码来源:TaskUtil.java

示例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);
            }
        }
    }

}
 
开发者ID:klob,项目名称:Diandi1.20,代码行数:24,代码来源:ProfileActivity.java

示例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;
		}
	});

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

示例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());
    }
}
 
开发者ID:Zweihui,项目名称:Aurora,代码行数:16,代码来源:MineFragment.java

示例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;
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:13,代码来源:Article.java

示例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;
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:16,代码来源:User.java

示例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;
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:16,代码来源:Rank.java

示例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());
            }
        }
    });
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:15,代码来源:UserActivity.java

示例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();
        }
    }
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:16,代码来源:BikeDamageReportActivity.java


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