如何存储一些特定的数据,在Android的某些特殊分析用户特殊、数据、用户、Android

2023-09-04 03:59:32 作者:西风泪

在我的应用程序,我想存储一些特定的数据为特定的解析用户,我想从中获取数据。我应该创建一个使用的用户还是其他什么东西的唯一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.