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


Java AVUser.put方法代码示例

本文整理汇总了Java中com.avos.avoscloud.AVUser.put方法的典型用法代码示例。如果您正苦于以下问题:Java AVUser.put方法的具体用法?Java AVUser.put怎么用?Java AVUser.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.avos.avoscloud.AVUser的用法示例。


在下文中一共展示了AVUser.put方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillAvUser

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public static AVUser fillAvUser(User user,AVUser avUser){
    if (user == null || avUser == null)
        return null;
    Field[] fields = user.getClass().getDeclaredFields();
    for (int i = 0; i < fields.length; i++) {
        Field field = fields[i];
        field.setAccessible(true);
        try {
            if ("objectId".equals(field.getName())){
                 avUser.setObjectId((String) field.get(user));
            }else {
                avUser.put(field.getName(), field.get(user));
            }
        } catch (IllegalAccessException e) {
            NLog.e(TagUtil.makeTag(UserCacheHelper.class),e);
        }
    }
    return avUser;
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:20,代码来源:UserCacheHelper.java

示例2: fillFriendsData

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
private void fillFriendsData(List<AVUser> datas) {
	friends.clear();
	int total = datas.size();
	for (int i = 0; i < total; i++) {
		AVUser user = datas.get(i);
		AVUser sortUser = new AVUser();
		sortUser.put("avatar", user.getAVFile("avatar"));
		sortUser.setUsername(user.getUsername());
		sortUser.setObjectId(user.getObjectId());
		String username = sortUser.getUsername();
		if (username != null) {
			String pinyin = CharacterParser.getPingYin(user.getUsername());
			String sortString = pinyin.substring(0, 1).toUpperCase();
			if (sortString.matches("[A-Z]")) {
				Log.d("lan", sortString.toUpperCase());
			} else {
				Log.d("lan", "#");
			}
		} else {
			Log.d("lan", "#");
		}
		friends.add(sortUser);
	}
	Collections.sort(friends, pinyinComparator);
}
 
开发者ID:lanixzcj,项目名称:LoveTalkClient,代码行数:26,代码来源:ContactFragment.java

示例3: updateUserLocation

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public static void updateUserLocation() {
	PreferenceMap preferenceMap = PreferenceMap.getCurUserPrefDao(DemoApplication.context);
	AVGeoPoint lastLocation = preferenceMap.getLocation();
	if (lastLocation != null) {
		final AVUser user = AVUser.getCurrentUser();
		final AVGeoPoint location = user.getAVGeoPoint("location");
		if (location == null || !Utils.doubleEqual(location.getLatitude(), lastLocation.getLatitude())
				|| !Utils.doubleEqual(location.getLongitude(), lastLocation.getLongitude())) {
			user.put("location", lastLocation);
			user.saveInBackground(new SaveCallback() {
				@Override
				public void done(AVException e) {
					if (e != null) {
						e.printStackTrace();
					} else {
						Log.v("lan", "lastLocation save " + user.getAVGeoPoint("location"));
					}
				}
			});
		}
	}
}
 
开发者ID:lanixzcj,项目名称:LoveTalkClient,代码行数:23,代码来源:ChatUtils.java

示例4: saveUserToCloud

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public void saveUserToCloud(UserWrap datas){
    if (datas != null) {
        AVUser avUser = AVUser.getCurrentUser();
        if (avUser != null) {
            for (String key : datas.keySet()) {
                avUser.put(key, datas.get(key));
            }
            avUser.saveInBackground();
        }
    }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:12,代码来源:UserCacheHelper.java

示例5: register

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public void register(String userName,String password,String phoneNumber){
    AVUser avUser = new AVUser();
    avUser.setUsername(userName);
    avUser.setPassword(password);
    avUser.put("mobilePhoneNumber",phoneNumber);
    avUser.signUpInBackground(mRegisterCallback);
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:8,代码来源:LoginHelper.java

示例6: updateUserLocation

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public static void updateUserLocation() {
	PreferenceMap preferenceMap = PreferenceMap
			.getCurUserPrefDao(DemoApplication.context);
	AVGeoPoint lastLocation = preferenceMap.getLocation();
	String lastaddress = preferenceMap.getAddress();
	if (lastLocation != null) {
		final AVUser user = AVUser.getCurrentUser();
		final AVGeoPoint location = user.getAVGeoPoint("location");
		final String Address = user.getString("address");
		if (location == null
				|| !Utils.doubleEqual(location.getLatitude(),
				lastLocation.getLatitude())
				|| !Utils.doubleEqual(location.getLongitude(),
				lastLocation.getLongitude())) {
			user.put("location", lastLocation);
			user.put("address", lastaddress);
			user.saveInBackground(new SaveCallback() {
				@Override
				public void done(AVException e) {
					if (e != null) {
						e.printStackTrace();
					} else {
						log.v("lastLocation save "
								+ user.getAVGeoPoint("location"));
					}
				}
			});
		}
	}
}
 
开发者ID:lanixzcj,项目名称:LoveTalkClient,代码行数:31,代码来源:Utils.java

示例7: register

import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public static  void register(final String username,final String password,final String cityStr,final String githubStr,final Uri avatar_uri,final SaveCallback saveCallback) {
  final  AVUser user = new AVUser();


    String name = System.currentTimeMillis()+"";
    if (avatar_uri != null) {

        byte[] data = ImageUtils.readFile(mContext,avatar_uri);
        final AVFile file = new AVFile(name, data);

        file.saveInBackground(new SaveCallback() {
            @Override
            public void done(AVException e) {
                if (e != null) {
                    Log.d("wds",e.toString());

                } else {
                    if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(password)) {

                        user.setUsername(username);
                        user.setPassword(password);
                    }
                    user.put(UserDAO.LOCATION,cityStr);
                    user.put(UserDAO.GITHUB_URL,githubStr);
                    user.put(UserDAO.AVATAR_URL, file.getUrl());
                    user.saveInBackground(saveCallback);
                }
            }
        });
    }else {

        if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(password)) {

            user.setUsername(username);
            user.setPassword(password);

        }
        user.put(UserDAO.LOCATION,cityStr);
        user.put(UserDAO.GITHUB_URL,githubStr);
        user.saveInBackground(saveCallback);

    }



}
 
开发者ID:OldDriver007,项目名称:OldDriver-master,代码行数:47,代码来源:AVService.java


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