如何存储一些特定的数据,在Android的某些特殊分析用户 [英] how to store some particular data for some particular parse user in android

查看:133
本文介绍了如何存储一些特定的数据,在Android的某些特殊分析用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我想存储一些特定的数据为特定的解析用户,我想从中获取数据。我应该创建一个使用的用户还是其他什么东西的唯一ID的一类数据浏览器?谁能帮助我?先谢谢了。

In my application i want to store some specific data for a particular parse user and I want to fetch data from it. Should I create a class in data browser using the unique id of user or something else? Can anyone help me? Thanks in advance.

推荐答案

您必须使用关系。首先,创建一个新的列(而不是在用户的类)和类型的关系,该关系是用户类。 比方说,你要添加一个新的职位。使用这样的:

You have to use relations. First, create a new column (not in your user's class) and the type is a relation, the relation is to the user class. Lets say you want to add a new post. Use this:

ParseObject post = ...;

ParseUser user = ParseUser.getCurrentUser();
ParseRelation relation = user.getRelation("posts");
relation.add(yourString);
user.saveInBackground();

code源代码

告诉我,我将编辑这个,如果你不明白。

Tell me and I will edit this if you don't understand.

这篇关于如何存储一些特定的数据,在Android的某些特殊分析用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆