• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BmobUserManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cn.bmob.im.BmobUserManager的典型用法代码示例。如果您正苦于以下问题:Java BmobUserManager类的具体用法?Java BmobUserManager怎么用?Java BmobUserManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BmobUserManager类属于cn.bmob.im包,在下文中一共展示了BmobUserManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addFriendAfterAgree

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
private void addFriendAfterAgree(JSONObject jo, final String json) {
    final String username = BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TARGETUSERNAME);
    final String nick= BmobJsonUtil.getString(jo,BmobConstant.PUSH_KEY_TARGETNICK);
    final String toId=BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TOID);
    //收到对方的同意请求之后,就得添加对方为好友--已默认添加同意方为好友,并保存到本地好友数据库
    BmobUserManager.getInstance(context).addContactAfterAgree(username, new FindListener<BmobChatUser>() {
        @Override
        public void onSuccess(List<BmobChatUser> list) {
            if(application.isMessageAllowed){
                showOtherNotify(nick, toId, nick + "同意添加你为好友", true);
            }
            //创建一个临时验证会话--用于在会话界面形成初始会话
            BmobMsg.createAndSaveRecentAfterAgree(context, json);
            BBApplication.getInstance().addContactList(list);
        }

        @Override
        public void onError(int i, String s) {

        }
    });

}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:24,代码来源:MyMessageReceiver.java


示例2: onCreate

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    x.Ext.init(this);
    x.Ext.setDebug(true);
    initBmob();
    mInstance=this;
    isCommentAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_COMMENT_ALLOWED,true);
    isVoiceAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_VOICE_ALLOWED, true);
    isVibrateAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_VIBRATE_ALLOWED,true);
    isMessageAllowed=PrefUtils.getBoolean(this, ConsUtils.IS_MESSAGE_ALLOWED,true);
    BmobUserManager.getInstance(this).queryCurrentContactList(new FindListener<BmobChatUser>() {
        @Override
        public void onSuccess(List<BmobChatUser> list) {
            setContactList(list);
        }

        @Override
        public void onError(int i, String s) {
            setContactList(new ArrayList<BmobChatUser>());
        }
    });
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:24,代码来源:BBApplication.java


示例3: MessageChatAdapter

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public MessageChatAdapter(Context context,List<BmobMsg> msgList) {
	super(context, msgList);
	currentObjectId = BmobUserManager.getInstance(context).getCurrentUserObjectId();
	
	options = new DisplayImageOptions.Builder()
	.showImageForEmptyUri(R.drawable.ic_launcher)
	.showImageOnFail(R.drawable.ic_launcher)
	.resetViewBeforeLoading(true)
	.cacheOnDisc(true)
	.cacheInMemory(true)
	.imageScaleType(ImageScaleType.EXACTLY)
	.bitmapConfig(Bitmap.Config.RGB_565)
	.considerExifParams(true)
	.displayer(new FadeInBitmapDisplayer(300))
	.build();
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:17,代码来源:MessageChatAdapter.java


示例4: onReceive

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
	// TODO Auto-generated method stub
	String json = intent.getStringExtra("msg");
	BmobLog.i("收到的message = " + json);

	userManager = BmobUserManager.getInstance(context);
	currentUser = userManager.getCurrentUser();
	boolean isNetConnected = CommonUtils.isNetworkAvailable(context);
	if (isNetConnected) {
		parseMessage(context, json);
	} else {
		for (int i = 0; i < ehList.size(); i++)
			ehList.get(i).onNetChange(isNetConnected);
	}
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:17,代码来源:MyMessageReceiver.java


示例5: RecordPlayClickListener

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public RecordPlayClickListener(Context context, BmobMsg msg, ImageView voice) {
	this.iv_voice = voice;
	this.message = msg;
	this.context = context;
	currentMsg = msg;
	currentPlayListener = this;
	currentObjectId = BmobUserManager.getInstance(context)
			.getCurrentUserObjectId();
	playMananger = BmobPlayManager.getInstance(context);
	playMananger.setOnPlayChangeListener(new OnPlayChangeListener() {

		@Override
		public void onPlayStop() {
			// TODO Auto-generated method stub
			currentPlayListener.stopRecordAnimation();
		}

		@Override
		public void onPlayStart() {
			// TODO Auto-generated method stub
			currentPlayListener.startRecordAnimation();
		}
	});
}
 
开发者ID:nEdAy,项目名称:XPPLE_IM,代码行数:25,代码来源:RecordPlayClickListener.java


示例6: MessageChatAdapter

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public MessageChatAdapter(Context context,List<BmobMsg> msgList) {
	// TODO Auto-generated constructor stub
	super(context, msgList);
	currentObjectId = BmobUserManager.getInstance(context).getCurrentUserObjectId();
	
	options = new DisplayImageOptions.Builder()
	.showImageForEmptyUri(R.drawable.ic_launcher)
	.showImageOnFail(R.drawable.ic_launcher)
	.resetViewBeforeLoading(true)
	.cacheOnDisc(true)
	.cacheInMemory(true)
	.imageScaleType(ImageScaleType.EXACTLY)
	.bitmapConfig(Bitmap.Config.RGB_565)
	.considerExifParams(true)
	.displayer(new FadeInBitmapDisplayer(300))
	.build();
}
 
开发者ID:HuTianQi,项目名称:QQ,代码行数:18,代码来源:MessageChatAdapter.java


示例7: onCreate

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		userManager = BmobUserManager.getInstance(this);
		manager = BmobChatManager.getInstance(this);
		mApplication = CustomApplication.getInstance();
		DisplayMetrics metric = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(metric);
		mScreenWidth = metric.widthPixels;
		mScreenHeight = metric.heightPixels;
		
		mRequestQueue = mApplication.getRequestQueue();
//		this.tag = setTag();
		
	}
 
开发者ID:liuyanggithub,项目名称:Hi,代码行数:17,代码来源:BaseActivity.java


示例8: onReceive

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
	// TODO Auto-generated method stub
	String json = intent.getStringExtra("msg");
	BmobLog.i("�յ���message = " + json);
	
	userManager = BmobUserManager.getInstance(context);
	currentUser = userManager.getCurrentUser();
	boolean isNetConnected = CommonUtils.isNetworkAvailable(context);
	if(isNetConnected){
		parseMessage(context, json);
	}else{
		for (int i = 0; i < ehList.size(); i++)
			((EventListener) ehList.get(i)).onNetChange(isNetConnected);
	}
}
 
开发者ID:liuyanggithub,项目名称:Hi,代码行数:17,代码来源:MyMessageReceiver.java


示例9: RecordPlayClickListener

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public RecordPlayClickListener(Context context, BmobMsg msg, ImageView voice) {
	this.iv_voice = voice;
	this.message = msg;
	this.context = context;
	currentMsg = msg;
	currentPlayListener = this;
	currentObjectId = BmobUserManager.getInstance(context).getCurrentUserObjectId();
	playMananger = BmobPlayManager.getInstance(context);
	playMananger.setOnPlayChangeListener(new OnPlayChangeListener() {

		@Override
		public void onPlayStop() {
			// TODO Auto-generated method stub
			currentPlayListener.stopRecordAnimation();
		}

		@Override
		public void onPlayStart() {
			// TODO Auto-generated method stub
			currentPlayListener.startRecordAnimation();
		}
	});
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:24,代码来源:RecordPlayClickListener.java


示例10: delFriend

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
/**
 * 删除好友
 */
public static void delFriend(BmobUserManager userManager, String userId, final DeleteUserListener delUserListener) {
	L.i("delFriend", "删除好友的id是" + userId);
	userManager.deleteContact(userId, new UpdateListener() {
		@Override
		public void onSuccess() {
			L.i("删除成功");
			delUserListener.onSuccess();
		}

		@Override
		public void onFailure(int arg0, String arg1) {
			L.i("发送请求失败,请重新添加!" + arg0 + arg1);
			delUserListener.onError(arg0, arg1);
		}
	});
}
 
开发者ID:hanks-zyh,项目名称:Conquer,代码行数:20,代码来源:MsgUtils.java


示例11: RecordPlayClickListener

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public RecordPlayClickListener(Context context, BmobMsg msg, ImageView voice) {
    this.iv_voice = voice;
    this.message = msg;
    this.context = context;
    currentMsg = msg;
    currentPlayListener = this;
    currentObjectId = BmobUserManager.getInstance(context)
            .getCurrentUserObjectId();
    playMananger = BmobPlayManager.getInstance(context);
    playMananger.setOnPlayChangeListener(new OnPlayChangeListener() {

        @Override
        public void onPlayStop() {
            // TODO Auto-generated method stub
            currentPlayListener.stopRecordAnimation();
        }

        @Override
        public void onPlayStart() {
            // TODO Auto-generated method stub
            currentPlayListener.startRecordAnimation();
        }
    });
}
 
开发者ID:klob,项目名称:Diandi1.20,代码行数:25,代码来源:RecordPlayClickListener.java


示例12: NewRecordPlayClickListener

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public NewRecordPlayClickListener(Context context, BmobMsg msg,
                                  ImageView voice) {
    this.iv_voice = voice;
    this.message = msg;
    this.context = context;
    currentMsg = msg;
    currentPlayListener = this;
    currentObjectId = BmobUserManager.getInstance(context)
            .getCurrentUserObjectId();
    userManager = BmobUserManager.getInstance(context);
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:12,代码来源:NewRecordPlayClickListener.java


示例13: updateContactList

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public void updateContactList(){
    BmobUserManager.getInstance(this).queryCurrentContactList(new FindListener<BmobChatUser>() {
        @Override
        public void onSuccess(List<BmobChatUser> list) {
            setContactList(list);
        }

        @Override
        public void onError(int i, String s) {

        }
    });
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:14,代码来源:BBApplication.java


示例14: agreeRequest

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
private void agreeRequest(BmobInvitation invitation, final Button v, final TextView agreedAdd) {
    final ProgressDialog progress = new ProgressDialog(MessageActivity.this);
    progress.setMessage("正在添加...");
    progress.setCanceledOnTouchOutside(false);
    progress.show();
    try {
        //同意添加好友
        BmobUserManager.getInstance(MessageActivity.this).agreeAddContact(invitation, new UpdateListener() {

            @Override
            public void onSuccess() {
                // TODO Auto-generated method stub
                progress.dismiss();
                v.setVisibility(View.GONE);
                agreedAdd.setVisibility(View.VISIBLE);
                //保存到application中的ContactList(即保存在内存中)
                ToastUtils.make(MessageActivity.this,"添加好友成功");
                BBApplication.getInstance().updateContactList();
            }

            @Override
            public void onFailure(int arg0, final String arg1) {
                // TODO Auto-generated method stub
                progress.dismiss();
                ToastUtils.make(MessageActivity.this,"添加失败");
            }
        });
    } catch (final Exception e) {
        progress.dismiss();
        ToastUtils.make(MessageActivity.this, "添加失败"+e);
    }
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:33,代码来源:MessageActivity.java


示例15: onReceive

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
	String json = intent.getStringExtra("msg");
	BmobLog.i("�յ�����Ϣ��" + json);

	userManager = BmobUserManager.getInstance(context);
	currentUser = userManager.getCurrentUser();
	boolean isNetConnected = CommonUtils.isNetworkAvailable(context);
	if (isNetConnected) { // ����������
		parseMessage(context, json);
	} else {
		for (int i = 0; i < ehList.size(); i++)
			((EventListener) ehList.get(i)).onNetChange(isNetConnected);
	}
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:16,代码来源:MyMessageReceiver.java


示例16: NewRecordPlayClickListener

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public NewRecordPlayClickListener(Context context, BmobMsg msg,ImageView voice) {
	this.iv_voice = voice;
	this.message = msg;
	this.context = context;
	currentMsg = msg;
	currentPlayListener = this;
	currentObjectId = BmobUserManager.getInstance(context)
			.getCurrentUserObjectId();
	userManager = BmobUserManager.getInstance(context);
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:11,代码来源:NewRecordPlayClickListener.java


示例17: agressAdd

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
/**
 * ͬ����Ӻ���
 * @param btn_add
 * @param msg
 */
protected void agressAdd(final Button btn_add, BmobInvitation msg) {
	final ProgressDialog progress = new ProgressDialog(mContext);
	progress.setMessage("�������...");
	progress.setCanceledOnTouchOutside(false);
	progress.show();
	try {
		//ͬ����Ӻ���
		BmobUserManager.getInstance(mContext).agreeAddContact(msg, new UpdateListener() {
			
			@SuppressWarnings("deprecation")
			@Override
			public void onSuccess() {
				// TODO Auto-generated method stub
				progress.dismiss();
				btn_add.setText("��ͬ��");
				btn_add.setBackgroundDrawable(null);
				btn_add.setTextColor(mContext.getResources().getColor(R.color.base_color_text_black));
				btn_add.setEnabled(false);
				//���浽application�з���Ƚ�
				CustomApplication.getInstance().setContactList(CollectionUtils.list2map(BmobDB.create(mContext).getContactList()));	
			}
			
			@Override
			public void onFailure(int arg0, final String arg1) {
				progress.dismiss();
				showToast("���ʧ��: " +arg1);
			}
		});
	} catch (final Exception e) {
		progress.dismiss();
		showToast("���ʧ��: " +e.getMessage());
	}
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:39,代码来源:NewFriendAdapter.java


示例18: init

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
private void init() {
	mMediaPlayer = MediaPlayer.create(this, R.raw.notify);
	mNotificationManager = (NotificationManager) getSystemService(android.content.Context.NOTIFICATION_SERVICE);
	initImageLoader(getApplicationContext());
	// ���û���½�������ȴӺ������ݿ���ȡ������list�����ڴ���
	if (BmobUserManager.getInstance(getApplicationContext())
			.getCurrentUser() != null) {
		// ��ȡ���غ���user list���ڴ�,�����Ժ��ȡ����list
		contactList = CollectionUtils.list2map(BmobDB.create(
				getApplicationContext()).getContactList());
	}
	
	initBaidu();
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:15,代码来源:CustomApplication.java


示例19: getSpUtil

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
public synchronized SharePreferenceUtil getSpUtil() {
	if (mSpUtil == null) {
		String currentId = BmobUserManager.getInstance(
				getApplicationContext()).getCurrentUserObjectId();
		String sharedName = currentId + PREFERENCE_NAME;
		mSpUtil = new SharePreferenceUtil(this, sharedName);
	}
	return mSpUtil;
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:10,代码来源:CustomApplication.java


示例20: logout

import cn.bmob.im.BmobUserManager; //导入依赖的package包/类
/**
 * �˳���¼,��ջ�������
 */
public void logout() {
	BmobUserManager.getInstance(getApplicationContext()).logout();
	setContactList(null);
	// setLatitude(null);
	// setLongtitude(null);
}
 
开发者ID:JasonGaoH,项目名称:enjoychat,代码行数:10,代码来源:CustomApplication.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NoopResponse类代码示例发布时间:2022-05-23
下一篇:
Java Serialization类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap