[英]How to get a Google Cloud Datastore entity in Android without App Engine?
[英]How to update/modify an existing entity (stored as JSON object on google app engine) through android app
我創建了一個Android應用,該應用將某些信息存儲在Google App Engine上。 現在,我只能使用HTTP Post向GAE添加信息。 但是,如果我想通過Android應用程序更新實體中值的屬性,該如何在服務器上更新值? 我不知道該怎么做。 (如果不清楚,請讓我發布更多信息)。
我想你的意思是數據存儲區不是Google App Engine,而是使用自動創建的端點,如果真是這樣,那么可以使用自動創建的updateobject方法。 參見以下示例。 這也是一個自動創建的端點。
如果我弄錯了,請進一步解釋該問題,並可能包括部分代碼
@ApiMethod(name =“ updateUser”,path =“ updateUser”)
public User updateUser(User user) {
PersistenceManager mgr = getPersistenceManager();
try {
if (!containsUser(user)) {
throw new EntityNotFoundException("Object does not exist");
}
mgr.makePersistent(user);
} finally {
mgr.close();
}
return user;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.