本文整理汇总了Java中com.easemob.util.PathUtil类的典型用法代码示例。如果您正苦于以下问题:Java PathUtil类的具体用法?Java PathUtil怎么用?Java PathUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathUtil类属于com.easemob.util包,在下文中一共展示了PathUtil类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getImagePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
public static String getImagePath(String remoteUrl)
{
String imageName= remoteUrl.substring(remoteUrl.lastIndexOf("/") + 1, remoteUrl.length());
String path =PathUtil.getInstance().getImagePath()+"/"+ imageName;
EMLog.d("msg", "image path:" + path);
return path;
}
开发者ID:macyuan,项目名称:TAG,代码行数:9,代码来源:ImageUtils.java
示例2: selectPicFromCamera
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 照相获取图片
*/
public void selectPicFromCamera() {
if (!CommonUtils.isExitsSdcard()) {
Toast.makeText(getApplicationContext(), "SD卡不存在,不能拍照", 0).show();
return;
}
// cameraFile = new File(PathUtil.getInstance().getImagePath(), DemoApplication.getInstance().getUserName()
cameraFile = new File(PathUtil.getInstance().getImagePath(), DemoApplication.getInstance().getUser()
+ System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
REQUEST_CODE_CAMERA);
}
开发者ID:macyuan,项目名称:TAG,代码行数:17,代码来源:ChatActivity.java
示例3: selectPicFromCamera
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 照相获取图片
*/
public void selectPicFromCamera() {
if (!CommonUtils.isExitsSdcard()) {
Toast.makeText(getActivity(), "SD卡不存在,不能拍照", 0).show();
return;
}
// cameraFile = new File(PathUtil.getInstance().getImagePath(), DemoApplication.getInstance().getUserName()
cameraFile = new File(PathUtil.getInstance().getImagePath(), DemoApplication.getInstance().getUser()
+ System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
USERPIC_REQUEST_CODE_CAMERA);
}
开发者ID:macyuan,项目名称:TAG,代码行数:18,代码来源:SettingsFragmentC_0815.java
示例4: selectPicFromCamera
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 照相获取图片
*/
protected void selectPicFromCamera() {
if (!EaseCommonUtils.isExitsSdcard()) {
Toast.makeText(getActivity(), R.string.sd_card_does_not_exist,Toast.LENGTH_SHORT).show();
return;
}
cameraFile = new File(PathUtil.getInstance().getImagePath(), EMChatManager.getInstance().getCurrentUser()
+ System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();
startActivityForResult(
new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
REQUEST_CODE_CAMERA);
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:17,代码来源:EaseChatFragment.java
示例5: getLocalFilePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 通过远程URL,确定下本地下载后的localurl
* @param remoteUrl
* @return
*/
public String getLocalFilePath(String remoteUrl){
String localPath;
if (remoteUrl.contains("/")){
localPath = PathUtil.getInstance().getImagePath().getAbsolutePath() + "/"
+ remoteUrl.substring(remoteUrl.lastIndexOf("/") + 1);
}else{
localPath = PathUtil.getInstance().getImagePath().getAbsolutePath() + "/" + remoteUrl;
}
return localPath;
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:16,代码来源:EaseShowBigImageActivity.java
示例6: getLocalFilePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
public String getLocalFilePath(String remoteUrl){
String localPath;
if (remoteUrl.contains("/")) {
localPath = PathUtil.getInstance().getVideoPath().getAbsolutePath()
+ "/" + remoteUrl.substring(remoteUrl.lastIndexOf("/") + 1)
+ ".mp4";
} else {
localPath = PathUtil.getInstance().getVideoPath().getAbsolutePath()
+ "/" + remoteUrl + ".mp4";
}
return localPath;
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:13,代码来源:EaseShowVideoActivity.java
示例7: selectPicFromCamera
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 照相获取图片
*/
protected void selectPicFromCamera() {
if (!EaseCommonUtils.isExitsSdcard()) {
Toast.makeText(getActivity(), R.string.sd_card_does_not_exist, 0).show();
return;
}
cameraFile = new File(PathUtil.getInstance().getImagePath(), EMChatManager.getInstance().getCurrentUser()
+ System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();
startActivityForResult(
new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
REQUEST_CODE_CAMERA);
}
开发者ID:easemob,项目名称:easeui,代码行数:17,代码来源:EaseChatFragment.java
示例8: selectPicFromCamera
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 照相获取图片
*/
public void selectPicFromCamera() {
if (!CommonUtils.isExitsSdcard()) {
String st = getResources().getString(R.string.sd_card_does_not_exist);
Toast.makeText(getApplicationContext(), st, 0).show();
return;
}
cameraFile = new File(PathUtil.getInstance().getImagePath(), MyApplication.getInstance().getUserName()
+ System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
REQUEST_CODE_CAMERA);
}
开发者ID:Owater,项目名称:school_shop,代码行数:17,代码来源:ChatActivity.java
示例9: selectPicFromCamera
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 照相获取图片
*/
public void selectPicFromCamera() {
if (!CommonUtils.isExitsSdcard()) {
String st = getResources().getString(R.string.sd_card_does_not_exist);
GreenToast.makeText(getApplicationContext(), st, 0).show();
return;
}
cameraFile = new File(PathUtil.getInstance().getImagePath(), MainApplication.getInstance().getUserName()
+ System.currentTimeMillis() + ".jpg");
cameraFile.getParentFile().mkdirs();
startActivityForResult(
new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile)),
REQUEST_CODE_CAMERA);
}
开发者ID:chenjunqian,项目名称:here,代码行数:18,代码来源:ChatActivity.java
示例10: getImagePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
public static String getImagePath(String remoteUrl) {
String imageName = remoteUrl.substring(remoteUrl.lastIndexOf("/") + 1, remoteUrl.length());
String path = PathUtil.getInstance().getImagePath() + "/" + imageName;
EMLog.d("msg", "image path:" + path);
return path;
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:8,代码来源:EaseImageUtils.java
示例11: getLocalFilePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 通过远程URL,确定下本地下载后的localurl
* @param remoteUrl
* @return
*/
public String getLocalFilePath(String remoteUrl) {
String localPath;
if (remoteUrl.contains("/")) {
localPath = PathUtil.getInstance().getImagePath().getAbsolutePath() + "/"
+ remoteUrl.substring(remoteUrl.lastIndexOf("/") + 1);
} else {
localPath = PathUtil.getInstance().getImagePath().getAbsolutePath() + "/" + remoteUrl;
}
return localPath;
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:16,代码来源:EaseShowBigImageActivity.java
示例12: getLocalFilePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
public String getLocalFilePath(String remoteUrl) {
String localPath;
if (remoteUrl.contains("/")) {
localPath = PathUtil.getInstance().getVideoPath().getAbsolutePath()
+ "/" + remoteUrl.substring(remoteUrl.lastIndexOf("/") + 1)
+ ".mp4";
} else {
localPath = PathUtil.getInstance().getVideoPath().getAbsolutePath()
+ "/" + remoteUrl + ".mp4";
}
return localPath;
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:13,代码来源:EaseShowVideoActivity.java
示例13: getThumbnailImagePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
public static String getThumbnailImagePath(String thumbRemoteUrl) {
String thumbImageName= thumbRemoteUrl.substring(thumbRemoteUrl.lastIndexOf("/") + 1, thumbRemoteUrl.length());
String path =PathUtil.getInstance().getImagePath()+"/"+ "th"+thumbImageName;
EMLog.d("msg", "thum image path:" + path);
return path;
}
开发者ID:macyuan,项目名称:TAG,代码行数:7,代码来源:ImageUtils.java
示例14: change_headurl
import com.easemob.util.PathUtil; //导入依赖的package包/类
/**
* 更改头像
*/
public void change_headurl() {
/*//如果挂在SDcard
if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
//在SDcard文件TestSyncListView下创建文件
IMAGE_FILE_LOCATION = Environment.getExternalStorageDirectory()+Constant.CACHE_DIR_IMAGE+"/temp.jpg";
imageUri = Uri.parse(IMAGE_FILE_LOCATION);
//File cutFile = new File(Constant.CACHE_DIR_IMAGE,"temp.jpg");
//cutFile.getParentFile().mkdirs();
File dir = new File(IMAGE_FILE_LOCATION);
if (!dir.exists()) {
try {
//在指定的文件夹中创建文件
dir.createNewFile();
} catch (Exception e) {
//println(e);
}
}
}else{
Toast.makeText(getActivity(), "SD卡不存在,不能更改头像", 0).show();
return;
}*/
/*创建缓存图片文件-要用于照相和本地图片选择缓存*/
if (!CommonUtils.isExitsSdcard()) {
Toast.makeText(Setting.this, "SD卡不存在,不能更改头像", Toast.LENGTH_SHORT).show();
return;
}
cameraFile = new File(PathUtil.getInstance().getImagePath(), DemoApplication.getInstance().getUser()
+ System.currentTimeMillis() + ".jpg");
if (cameraFile == null && !cameraFile.exists()) {//如果文件存在就不在创建
cameraFile.getParentFile().mkdirs();
}
AlertDialog.Builder builder = new AlertDialog.Builder(Setting.this);
String[] strarr = {"选择拍照", "选择本地相册"};
builder.setItems(strarr, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
// TODO 自动生成的方法存根
if (arg1 == 0) {//选择拍照
selectPicFromCamera();
} else {//选择本地相册
selectPicFromLocal();
}
}
});
builder.show();
}
开发者ID:macyuan,项目名称:TAG,代码行数:51,代码来源:Setting.java
示例15: onActivityResult
import com.easemob.util.PathUtil; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_CONTEXT_MENU) {
switch (resultCode) {
case ContextMenuActivity.RESULT_CODE_COPY: // 复制消息
clipboard.setText(((TextMessageBody) contextMenuMessage.getBody()).getMessage());
break;
case ContextMenuActivity.RESULT_CODE_DELETE: // 删除消息
conversation.removeMessage(contextMenuMessage.getMsgId());
messageList.refresh();
break;
case ContextMenuActivity.RESULT_CODE_FORWARD: // 转发消息
Intent intent = new Intent(getActivity(), ForwardMessageActivity.class);
intent.putExtra("forward_msg_id", contextMenuMessage.getMsgId());
startActivity(intent);
break;
default:
break;
}
}
if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case REQUEST_CODE_SELECT_VIDEO: //发送选中的视频
if (data != null) {
int duration = data.getIntExtra("dur", 0);
String videoPath = data.getStringExtra("path");
File file = new File(PathUtil.getInstance().getImagePath(), "thvideo" + System.currentTimeMillis());
try {
FileOutputStream fos = new FileOutputStream(file);
Bitmap ThumbBitmap = ThumbnailUtils.createVideoThumbnail(videoPath, 3);
ThumbBitmap.compress(CompressFormat.JPEG, 100, fos);
fos.close();
sendVideoMessage(videoPath, file.getAbsolutePath(), duration);
} catch (Exception e) {
e.printStackTrace();
}
}
break;
case REQUEST_CODE_SELECT_FILE: //发送选中的文件
if (data != null) {
Uri uri = data.getData();
if (uri != null) {
sendFileByUri(uri);
}
}
break;
default:
break;
}
}
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:58,代码来源:ChatFragment.java
示例16: getThumbnailImagePath
import com.easemob.util.PathUtil; //导入依赖的package包/类
public static String getThumbnailImagePath(String thumbRemoteUrl) {
String thumbImageName = thumbRemoteUrl.substring(thumbRemoteUrl.lastIndexOf("/") + 1, thumbRemoteUrl.length());
String path = PathUtil.getInstance().getImagePath() + "/" + "th" + thumbImageName;
EMLog.d("msg", "thum image path:" + path);
return path;
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:7,代码来源:EaseImageUtils.java
注:本文中的com.easemob.util.PathUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论