本文整理汇总了Java中com.easemob.util.EMLog类的典型用法代码示例。如果您正苦于以下问题:Java EMLog类的具体用法?Java EMLog怎么用?Java EMLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EMLog类属于com.easemob.util包,在下文中一共展示了EMLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:macyuan,项目名称:TAG,代码行数:26,代码来源:RecorderVideoActivity.java
示例2: onNewMsg
import com.easemob.util.EMLog; //导入依赖的package包/类
/**
* 处理新收到的消息,然后发送通知
*
* 开发者可以重载此函数
* this function can be override
*
* @param message
*/
public synchronized void onNewMsg(EMMessage message) {
if(EMChatManager.getInstance().isSlientMessage(message)){
return;
}
EaseSettingsProvider settingsProvider = EaseUI.getInstance().getSettingsProvider();
if(!settingsProvider.isMsgNotifyAllowed(message)){
return;
}
// 判断app是否在后台
if (!EasyUtils.isAppRunningForeground(appContext)) {
EMLog.d(TAG, "app is running in backgroud");
sendNotification(message, false);
} else {
sendNotification(message, true);
}
viberateAndPlayTone(message);
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:29,代码来源:EaseNotifier.java
示例3: onNewMesg
import com.easemob.util.EMLog; //导入依赖的package包/类
public synchronized void onNewMesg(List<EMMessage> messages) {
if(EMChatManager.getInstance().isSlientMessage(messages.get(messages.size()-1))){
return;
}
EaseSettingsProvider settingsProvider = EaseUI.getInstance().getSettingsProvider();
if(!settingsProvider.isMsgNotifyAllowed(null)){
return;
}
// 判断app是否在后台
if (!EasyUtils.isAppRunningForeground(appContext)) {
EMLog.d(TAG, "app is running in backgroud");
sendNotification(messages, false);
} else {
sendNotification(messages, true);
}
viberateAndPlayTone(messages.get(messages.size()-1));
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:18,代码来源:EaseNotifier.java
示例4: stopRecoding
import com.easemob.util.EMLog; //导入依赖的package包/类
public int stopRecoding() {
if(recorder != null){
isRecording = false;
recorder.stop();
recorder.release();
recorder = null;
if(file == null || !file.exists() || !file.isFile()){
return EMError.INVALID_FILE;
}
if (file.length() == 0) {
file.delete();
return EMError.INVALID_FILE;
}
int seconds = (int) (new Date().getTime() - startTime) / 1000;
EMLog.d("voice", "voice recording finished. seconds:" + seconds + " file length:" + file.length());
return seconds;
}
return 0;
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:21,代码来源:EaseVoiceRecorder.java
示例5: getSections
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public Object[] getSections() {
positionOfSection = new SparseIntArray();
sectionOfPosition = new SparseIntArray();
int count = getCount();
list = new ArrayList<String>();
list.add(getContext().getString(R.string.search_header));
positionOfSection.put(0, 0);
sectionOfPosition.put(0, 0);
for (int i = 1; i < count; i++) {
String letter = getItem(i).getInitialLetter();
EMLog.d(TAG, "contactadapter getsection getHeader:" + letter + " name:" + getItem(i).getUsername());
int section = list.size() - 1;
if (list.get(section) != null && !list.get(section).equals(letter)) {
list.add(letter);
section++;
positionOfSection.put(section, i);
}
sectionOfPosition.put(i, section);
}
return list.toArray(new String[list.size()]);
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:24,代码来源:EaseContactAdapter.java
示例6: onBubbleClick
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
protected void onBubbleClick() {
VideoMessageBody videoBody = (VideoMessageBody) message.getBody();
EMLog.d(TAG, "video view is on click");
Intent intent = new Intent(context, EaseShowVideoActivity.class);
intent.putExtra("localpath", videoBody.getLocalUrl());
intent.putExtra("secret", videoBody.getSecret());
intent.putExtra("remotepath", videoBody.getRemoteUrl());
if (message != null && message.direct == EMMessage.Direct.RECEIVE && !message.isAcked
&& message.getChatType() != ChatType.GroupChat) {
message.isAcked = true;
try {
EMChatManager.getInstance().ackMessageRead(message.getFrom(), message.getMsgId());
} catch (Exception e) {
e.printStackTrace();
}
}
activity.startActivity(intent);
}
开发者ID:huijimuhe,项目名称:monolog-android,代码行数:20,代码来源:EaseChatRowVideo.java
示例7: onNewMsg
import com.easemob.util.EMLog; //导入依赖的package包/类
/**
* 处理新收到的消息,然后发送通知
* <p/>
* 开发者可以重载此函数
* this function can be override
*
* @param message
*/
public synchronized void onNewMsg(EMMessage message) {
if (EMChatManager.getInstance().isSlientMessage(message)) {
return;
}
// 判断app是否在后台
if (!EasyUtils.isAppRunningForeground(appContext)) {
EMLog.d(TAG, "app is running in backgroud");
sendNotification(message, false);
} else {
sendNotification(message, true);
}
viberateAndPlayTone(message);
}
开发者ID:tengbinlive,项目名称:info_demo,代码行数:25,代码来源:HXNotifier.java
示例8: onReceive
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
if(!DemoHelper.getInstance().isLoggedIn())
return;
//拨打方username
String from = intent.getStringExtra("from");
//call type
String type = intent.getStringExtra("type");
if("video".equals(type)){ //视频通话
context.startActivity(new Intent(context, VideoCallActivity.class).
putExtra("username", from).putExtra("isComingCall", true).
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}else{ //音频通话
context.startActivity(new Intent(context, VoiceCallActivity.class).
putExtra("username", from).putExtra("isComingCall", true).
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
EMLog.d("CallReceiver", "app received a incoming call");
}
开发者ID:easemob,项目名称:sdkdemoapp3.0_android,代码行数:20,代码来源:CallReceiver.java
示例9: 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;
}
开发者ID:easemob,项目名称:sdkdemoapp3.0_android,代码行数:22,代码来源:RecorderVideoActivity.java
示例10: 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();
}
}
开发者ID:easemob,项目名称:sdkdemoapp3.0_android,代码行数:19,代码来源:RecorderVideoActivity.java
示例11: onBubbleClick
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
protected void onBubbleClick() {
VideoMessageBody videoBody = (VideoMessageBody) message.getBody();
EMLog.d(TAG, "video view is on click");
Intent intent = new Intent(context, EaseShowVideoActivity.class);
intent.putExtra("localpath", videoBody.getLocalUrl());
intent.putExtra("secret", videoBody.getSecret());
intent.putExtra("remotepath", videoBody.getRemoteUrl());
if (message != null && message.direct == EMMessage.Direct.RECEIVE && !message.isAcked
&& message.getChatType() != ChatType.GroupChat) {
message.isAcked = true;
try {
EMChatManager.getInstance().ackMessageRead(message.getFrom(), message.getMsgId());
} catch (Exception e) {
e.printStackTrace();
}
}
activity.startActivity(intent);
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:20,代码来源:EaseChatRowVideo.java
示例12: onReceive
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
if (!DemoHelper.getInstance().isLoggedIn())
return;
//拨打方username
String from = intent.getStringExtra("from");
//call type
String type = intent.getStringExtra("type");
if ("video".equals(type)) { //视频通话
context.startActivity(new Intent(context, VideoCallActivity.class).
putExtra("username", from).putExtra("isComingCall", true).
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else { //音频通话
context.startActivity(new Intent(context, VoiceCallActivity.class).
putExtra("username", from).putExtra("isComingCall", true).
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
EMLog.d("CallReceiver", "app received a incoming call");
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:20,代码来源:CallReceiver.java
示例13: onSyncComplete
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public void onSyncComplete(final boolean success) {
EMLog.d(TAG, "on contact list sync success:" + success);
getActivity().runOnUiThread(new Runnable() {
public void run() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (success) {
loadingView.setVisibility(View.GONE);
refresh();
} else {
String s1 = getResources().getString(R.string.get_failed_please_check);
Toast.makeText(getActivity(), s1, 1).show();
loadingView.setVisibility(View.GONE);
}
}
});
}
});
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:24,代码来源:ContactListFragment.java
示例14: onBubbleClick
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
protected void onBubbleClick() {
VideoMessageBody videoBody = (VideoMessageBody) message.getBody();
EMLog.d(TAG, "video view is on click");
Intent intent = new Intent(context, EaseShowVideoActivity.class);
intent.putExtra("localpath", videoBody.getLocalUrl());
intent.putExtra("secret", videoBody.getSecret());
intent.putExtra("remotepath", videoBody.getRemoteUrl());
if (message != null && message.direct == EMMessage.Direct.RECEIVE && !message.isAcked
&& message.getChatType() == ChatType.Chat) {
message.isAcked = true;
try {
EMChatManager.getInstance().ackMessageRead(message.getFrom(), message.getMsgId());
} catch (Exception e) {
e.printStackTrace();
}
}
activity.startActivity(intent);
}
开发者ID:easemob,项目名称:easeui,代码行数:20,代码来源:EaseChatRowVideo.java
示例15: onReceive
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
if(!DemoHXSDKHelper.getInstance().isLogined())
return;
//拨打方username
String from = intent.getStringExtra("from");
//call type
// String type = intent.getStringExtra("type");
// if("video".equals(type)){ //视频通话
// context.startActivity(new Intent(context, VideoCallActivity.class).
// putExtra("username", from).putExtra("isComingCall", true).
// addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
// }else{ //音频通话
// context.startActivity(new Intent(context, VoiceCallActivity.class).
// putExtra("username", from).putExtra("isComingCall", true).
// addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
// }
EMLog.d("CallReceiver", "app received a incoming call");
}
开发者ID:Owater,项目名称:school_shop,代码行数:20,代码来源:CallReceiver.java
示例16: onNewMsg
import com.easemob.util.EMLog; //导入依赖的package包/类
/**
* 处理新收到的消息,然后发送通知
*
* 开发者可以重载此函数
* this function can be override
*
* @param message
*/
public synchronized void onNewMsg(final EMMessage message) {
if(EMChatManager.getInstance().isSlientMessage(message)){
return;
}
// 判断app是否在后台
if (!EasyUtils.isAppRunningForeground(appContext)) {
EMLog.d(TAG, "app is running in backgroud");
sendNotification(message, false);
} else {
sendNotification(message, true);
}
viberateAndPlayTone(message);
}
开发者ID:Owater,项目名称:school_shop,代码行数:25,代码来源:HXNotifier.java
示例17: onNewMesg
import com.easemob.util.EMLog; //导入依赖的package包/类
public synchronized void onNewMesg(List<EMMessage> messages) {
if (EMChatManager.getInstance().isSlientMessage(messages.get(messages.size() - 1))) {
return;
}
EaseSettingsProvider settingsProvider = EaseUI.getInstance().getSettingsProvider();
if (!settingsProvider.isMsgNotifyAllowed(null)) {
return;
}
// 判断app是否在后台
if (!EasyUtils.isAppRunningForeground(appContext)) {
EMLog.d(TAG, "app is running in backgroud");
sendNotification(messages, false);
} else {
sendNotification(messages, true);
}
viberateAndPlayTone(messages.get(messages.size() - 1));
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:18,代码来源:EaseNotifier.java
示例18: onReceive
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
if(!DemoHXSDKHelper.getInstance().isLogined())
return;
//拨打方username
String from = intent.getStringExtra("from");
//call type
String type = intent.getStringExtra("type");
if("video".equals(type)){ //视频通话
// context.startActivity(new Intent(context, VideoCallActivity.class).
// putExtra("username", from).putExtra("isComingCall", true).
// addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}else{ //音频通话
// context.startActivity(new Intent(context, VoiceCallActivity.class).
// putExtra("username", from).putExtra("isComingCall", true).
// addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
EMLog.d("CallReceiver", "app received a incoming call");
}
开发者ID:chenjunqian,项目名称:here,代码行数:20,代码来源:CallReceiver.java
示例19: getSections
import com.easemob.util.EMLog; //导入依赖的package包/类
@Override
public Object[] getSections() {
positionOfSection = new SparseIntArray();
sectionOfPosition = new SparseIntArray();
int count = getCount();
list = new ArrayList<String>();
list.add(getContext().getString(R.string.search_header));
positionOfSection.put(0, 0);
sectionOfPosition.put(0, 0);
for (int i = 1; i < count; i++) {
String letter = getItem(i).getHeader();
EMLog.d(TAG, "contactadapter getsection getHeader:" + letter + " name:" + getItem(i).getUsername());
int section = list.size() - 1;
if (list.get(section) != null && !list.get(section).equals(letter)) {
list.add(letter);
section++;
positionOfSection.put(section, i);
}
sectionOfPosition.put(i, section);
}
return list.toArray(new String[list.size()]);
}
开发者ID:chenjunqian,项目名称:here,代码行数:24,代码来源:ContactAdapter.java
示例20: stopRecoding
import com.easemob.util.EMLog; //导入依赖的package包/类
public int stopRecoding() {
if (recorder != null) {
isRecording = false;
recorder.stop();
recorder.release();
recorder = null;
if (file == null || !file.exists() || !file.isFile()) {
return EMError.INVALID_FILE;
}
if (file.length() == 0) {
file.delete();
return EMError.INVALID_FILE;
}
int seconds = (int) (new Date().getTime() - startTime) / 1000;
EMLog.d("voice", "voice recording finished. seconds:" + seconds + " file length:" + file.length());
return seconds;
}
return 0;
}
开发者ID:nggirl,项目名称:EaseChatDemo,代码行数:21,代码来源:EaseVoiceRecorder.java
注:本文中的com.easemob.util.EMLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论