2013-04-10 83 views
0

我剛剛升級到SDK 1.7.7,我的應用程序無法再訪問本地數據存儲。我谷歌了一下,發現這通常發生在升級SDK時。SDK升級後的Google App Engine本地數據存儲

我似乎無法找到任何解決方案,可以讓我保留我現有的數據。我已經在我的數據存儲中建立了大量我不想重新創建的測試數據。有沒有辦法將本地數據存儲區中的數據從一個SDK版本轉換/遷移到另一個版本?

回答

1

我使用的步驟是:

1)使remote_api的連接https://developers.google.com/appengine/articles/remote_api

static RemoteApiOptions options; 
    options = new RemoteApiOptions().server("localhost", 8888).credentials("", ""); // password doesn't matter 

    RemoteApiInstaller installer = new RemoteApiInstaller(); 
    installer.install(options); 

2)取我的數據(這是我與客體,但它d是你通常如何做的)

  UserDAO udao = new UserDAO(false); 
      Query<UserOFY> qu = udao.ofy().query(UserOFY.class); 

3)堅持我的數據到硬盤

  FileOutputStream fileOut = new FileOutputStream(LOCAL_AE_BACKUPS_USER + "/" + USERS_FROM_LOCAL_BACKUP + "_" + u.getNickName()); 
      ObjectOutputStream out = new ObjectOutputStream(fileOut); 
      out.writeObject(u); 
      out.close(); 

然後我就做升級後的版本相反。

1)看我的硬盤驅動器

2)對持續的數據作出的本地數據存儲

3的連接)的數據持久化到本地數據存儲的新版本

相關問題