本文整理汇总了Java中com.easemob.util.EMLog.e方法的典型用法代码示例。如果您正苦于以下问题:Java EMLog.e方法的具体用法?Java EMLog.e怎么用?Java EMLog.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.easemob.util.EMLog
的用法示例。
在下文中一共展示了EMLog.e方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendVideo
import com.easemob.util.EMLog; //导入方法依赖的package包/类
public void sendVideo(View view) {
if (TextUtils.isEmpty(localPath)) {
EMLog.e("Recorder", "recorder fail please try again!");
return;
}
msc = new MediaScannerConnection(this,
new MediaScannerConnectionClient() {
@Override
public void onScanCompleted(String path, Uri uri) {
Log.d("log scanner completed");
msc.disconnect();
setResult(RESULT_OK, getIntent().putExtra("uri", uri));
finish();
}
@Override
public void onMediaScannerConnected() {
msc.scanFile(localPath, "video/*");
}
});
msc.connect();
}
示例2: initCamera
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@SuppressLint("NewApi")
private boolean initCamera() {
try {
if (frontCamera == 0) {
mCamera = Camera.open(CameraInfo.CAMERA_FACING_BACK);
} else {
mCamera = Camera.open(CameraInfo.CAMERA_FACING_FRONT);
}
Camera.Parameters camParams = mCamera.getParameters();
mCamera.lock();
mSurfaceHolder = mVideoView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mCamera.setDisplayOrientation(90);
} catch (RuntimeException ex) {
EMLog.e("video", "init Camera fail " + ex.getMessage());
return false;
}
return true;
}
示例3: stopRecording
import com.easemob.util.EMLog; //导入方法依赖的package包/类
public void stopRecording() {
if (mediaRecorder != null) {
mediaRecorder.setOnErrorListener(null);
mediaRecorder.setOnInfoListener(null);
try {
mediaRecorder.stop();
} catch (IllegalStateException e) {
EMLog.e("video", "stopRecording error:" + e.getMessage());
}
}
releaseRecorder();
if (mCamera != null) {
mCamera.stopPreview();
releaseCamera();
}
}
示例4: stopRecording
import com.easemob.util.EMLog; //导入方法依赖的package包/类
public void stopRecording() {
if (mediaRecorder != null) {
mediaRecorder.setOnErrorListener(null);
mediaRecorder.setOnInfoListener(null);
try {
mediaRecorder.stop();
} catch (IllegalStateException e) {
EMLog.e("video", "stopRecording error:" + e.getMessage());
}
}
releaseRecorder();
if (mCamera != null) {
mCamera.stopPreview();
releaseCamera();
}
}
示例5: surfaceCreated
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
if (mCamera == null){
if(!initCamera()){
showFailDialog();
return;
}
}
try {
mCamera.setPreviewDisplay(mSurfaceHolder);
mCamera.startPreview();
handleSurfaceChanged();
} catch (Exception e1) {
EMLog.e("video", "start preview fail " + e1.getMessage());
showFailDialog();
}
}
示例6: initCamera
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@SuppressLint("NewApi")
private boolean initCamera() {
try {
if (frontCamera == 0) {
mCamera = Camera.open(CameraInfo.CAMERA_FACING_BACK);
} else {
mCamera = Camera.open(CameraInfo.CAMERA_FACING_FRONT);
}
Parameters camParams = mCamera.getParameters();
mCamera.lock();
mSurfaceHolder = mVideoView.getHolder();
mSurfaceHolder.addCallback(this);
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mCamera.setDisplayOrientation(90);
} catch (RuntimeException ex) {
EMLog.e("video", "init Camera fail " + ex.getMessage());
return false;
}
return true;
}
示例7: surfaceCreated
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
if (mCamera == null) {
if (!initCamera()) {
showFailDialog();
return;
}
}
try {
mCamera.setPreviewDisplay(mSurfaceHolder);
mCamera.startPreview();
handleSurfaceChanged();
} catch (Exception e1) {
EMLog.e("video", "start preview fail " + e1.getMessage());
showFailDialog();
}
}
示例8: initpreview
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@SuppressLint("NewApi")
protected void initpreview() {
try {
if(Build.VERSION.SDK_INT>Build.VERSION_CODES.FROYO)
{
int numberOfCameras=Camera.getNumberOfCameras();
CameraInfo cameraInfo=new CameraInfo();
for (int i = 0; i < numberOfCameras; i++) {
Camera.getCameraInfo(i, cameraInfo);
if(cameraInfo.facing==cameraSelection)
{
defaultCameraId=i;
}
}
}
if(mCamera!=null)
{
mCamera.stopPreview();
}
mCamera = Camera.open(CameraInfo.CAMERA_FACING_BACK);
mCamera.setPreviewDisplay(surfaceHolder);
setCameraDisplayOrientation(this, CameraInfo.CAMERA_FACING_BACK,
mCamera);
mCamera.startPreview();
} catch (Exception e) {
EMLog.e("###", e.getMessage());
showFailDialog();
return;
}
}
示例9: onError
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@Override
public void onError(MediaRecorder mr, int what, int extra) {
EMLog.e("video", "recording onError:");
stopRecording();
Toast.makeText(this,
"Recording error has occurred. Stopping the recording",
Toast.LENGTH_SHORT).show();
}
示例10: showConflictDialog
import com.easemob.util.EMLog; //导入方法依赖的package包/类
/**
* 显示帐号在别处登录dialog
*/
private void showConflictDialog() {
isConflictDialogShow = true;
DemoHelper.getInstance().logout(false,null);
String st = getResources().getString(R.string.Logoff_notification);
if (!MainActivity.this.isFinishing()) {
// clear up global variables
try {
if (conflictBuilder == null)
conflictBuilder = new android.app.AlertDialog.Builder(MainActivity.this);
conflictBuilder.setTitle(st);
conflictBuilder.setMessage(R.string.connect_conflict);
conflictBuilder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
conflictBuilder = null;
finish();
startActivity(new Intent(MainActivity.this, LoginActivity.class));
}
});
conflictBuilder.setCancelable(false);
conflictBuilder.create().show();
isConflict = true;
} catch (Exception e) {
EMLog.e(TAG, "---------color conflictBuilder error" + e.getMessage());
}
}
}
示例11: hideTitleBar
import com.easemob.util.EMLog; //导入方法依赖的package包/类
/**
* 隐藏标题栏
*/
public void hideTitleBar(){
if(titleBar != null){
titleBar.setVisibility(View.GONE);
}else{
EMLog.e(TAG, "cant find titlebar");
}
}
示例12: showConflictDialog
import com.easemob.util.EMLog; //导入方法依赖的package包/类
/**
* 显示帐号在别处登录dialog
*/
private void showConflictDialog() {
isConflictDialogShow = true;
DemoHXSDKHelper.getInstance().logout(false,null);
String st = getResources().getString(R.string.Logoff_notification);
if (!EMChatMainActivity.this.isFinishing()) {
// clear up global variables
try {
if (conflictBuilder == null)
conflictBuilder = new android.app.AlertDialog.Builder(EMChatMainActivity.this);
conflictBuilder.setTitle(st);
conflictBuilder.setMessage(R.string.connect_conflict);
conflictBuilder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
conflictBuilder = null;
finish();
startActivity(new Intent(EMChatMainActivity.this, EMChatLoginActivity.class));
}
});
conflictBuilder.setCancelable(false);
conflictBuilder.create().show();
isConflict = true;
} catch (Exception e) {
EMLog.e(TAG, "---------color conflictBuilder error" + e.getMessage());
}
}
}
示例13: showAccountRemovedDialog
import com.easemob.util.EMLog; //导入方法依赖的package包/类
/**
* 帐号被移除的dialog
*/
private void showAccountRemovedDialog() {
isAccountRemovedDialogShow = true;
DemoHelper.getInstance().logout(true, null);
String st5 = getResources().getString(R.string.Remove_the_notification);
if (!MainActivity.this.isFinishing()) {
// clear up global variables
try {
if (accountRemovedBuilder == null)
accountRemovedBuilder = new android.app.AlertDialog.Builder(MainActivity.this);
accountRemovedBuilder.setTitle(st5);
accountRemovedBuilder.setMessage(R.string.em_user_remove);
accountRemovedBuilder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
accountRemovedBuilder = null;
finish();
startActivity(new Intent(MainActivity.this, LoginActivity.class));
}
});
accountRemovedBuilder.setCancelable(false);
accountRemovedBuilder.create().show();
isCurrentAccountRemoved = true;
} catch (Exception e) {
EMLog.e(TAG, "---------color userRemovedBuilder error" + e.getMessage());
}
}
}
示例14: onError
import com.easemob.util.EMLog; //导入方法依赖的package包/类
@Override
public void onError(MediaRecorder mr, int what, int extra) {
EMLog.e("video", "recording onError:");
stopRecording();
Toast.makeText(this,
"Recording error has occurred. Stopping the recording",
Toast.LENGTH_SHORT).show();
}
示例15: downloadImage
import com.easemob.util.EMLog; //导入方法依赖的package包/类
/**
* 下载图片
*
* @param remoteFilePath
*/
private void downloadImage(final String remoteFilePath, final Map<String, String> headers) {
String str1 = getResources().getString(R.string.Download_the_pictures);
pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setCanceledOnTouchOutside(false);
pd.setMessage(str1);
pd.show();
localFilePath = getLocalFilePath(remoteFilePath);
final EMCallBack callback = new EMCallBack() {
public void onSuccess() {
runOnUiThread(new Runnable() {
@Override
public void run() {
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int screenWidth = metrics.widthPixels;
int screenHeight = metrics.heightPixels;
bitmap = ImageUtils.decodeScaleImage(localFilePath, screenWidth, screenHeight);
if (bitmap == null) {
image.setImageResource(default_res);
} else {
image.setImageBitmap(bitmap);
EaseImageCache.getInstance().put(localFilePath, bitmap);
isDownloaded = true;
}
if (pd != null) {
pd.dismiss();
}
}
});
}
public void onError(int error, String msg) {
EMLog.e(TAG, "offline file transfer error:" + msg);
File file = new File(localFilePath);
if (file.exists()&&file.isFile()) {
file.delete();
}
runOnUiThread(new Runnable() {
@Override
public void run() {
pd.dismiss();
image.setImageResource(default_res);
}
});
}
public void onProgress(final int progress, String status) {
EMLog.d(TAG, "Progress: " + progress);
final String str2 = getResources().getString(R.string.Download_the_pictures_new);
runOnUiThread(new Runnable() {
@Override
public void run() {
pd.setMessage(str2 + progress + "%");
}
});
}
};
EMChatManager.getInstance().downloadFile(remoteFilePath, localFilePath, headers, callback);
}