9 Replies Latest reply on May 7, 2014 11:17 PM by Mark Nongkhlaw

    Retain data on WP8 after deploy

    Bart Fukkink

      Good day,

       

      I noticed that the SQLlite database gets deleted every time we run the rake run:wp8:device command. Is there a way to not delete this database? Because we have a "setup process" when we start a clean application and testing gets quite lengthy if we have to do this all the time.

       

      Bart

        • Re: Retain data on WP8 after deploy

          Have you tried running instead rake device:wp8:production?

           

          USER03390, maybe you can provide more details on the difference between the commands and if there is a way to preserve DB data across app deployments.

            • Re: Retain data on WP8 after deploy
              Bart Fukkink

              So instead of just running it, I would create a new installation file and deploy that with the Application Deployment tool? I have not tried that yet, since the command rake run:wp8:device was just a lot faster without the external tools, but i`ll give this a try.

               

              And I am still very interested in why this happens, so still looking forward to a reply from Evgeny Vovchenko.

               

              Thanks for the reply Michael.

               

              Bart

                • Re: Retain data on WP8 after deploy

                  Correct. I'm not sure that it will fix the issue but I'd like to make sure.

                    • Re: Retain data on WP8 after deploy
                      Bart Fukkink

                      Michael,

                       

                      I`ve been busy for a few days, but I finally had a chance to test your answer.

                      Sadly this does not work. After I deploy the application with the Application Deployment tool, the data still gets removed from my device.

                       

                      Thanks for the suggestion tho, if you have any other ideas that might work, i`ll be sure to give them a try.

                       

                      Bart

                        • Re: Retain data on WP8 after deploy
                          Rob Richard

                          Ah, you're running into the same issue that I am (Issues with on_migrate_source).  Supposedly, the "on_migrate_source" should allow you to manage this, but I have yet to see it work.  This is a pain, because I have configuration information that my users have to re-enter each time an update is released from Google Play Store and Apple iStore.

                            • Re: Retain data on WP8 after deploy
                              Bart Fukkink

                              Hey Rob,

                               

                              Thanks for the response. I had a quick read through your post, but I dont think this is the same issue. The problems we are facing are purely on Windows Phone 8. The application that we made and released on iOS, Android and Windows Mobile (not through any app stores mind you) did not show this problem. But I think its a nice case to test, since we just very recently made the upgrade step to RhoMobile Suite 4.1.1.

                               

                              So here is what I did:

                              1. Install our most recently released version of the app on a HTC One (M7) with Android 4.4.

                              2. Start the application and get all the required data synced up (Note: we do NOT use RhoConnect or anything, we made our own Synchronisation implementation).

                              3. Close the application

                              4. Open our Git Repository and create a setup file of our current development situation using the commandline tools: rake device:andriod:production.

                              5. Copy the created file to the device and install it.

                              6. The Device saw it as an update to the currently installed app.

                              7. Run the application. The application has retained all data that I had synced up in step 2.

                               

                              The only things I didnt test is a database change. But since we try to limit those as much as possible, I dont have a chance to test that out at the moment.

                               

                              So to a conclusion: I don't think we are looking at the same problem here Rob. The problems we are facing is only on Windows Phone 8.

                               

                              Bart

                                • Re: Retain data on WP8 after deploy
                                  Mark Nongkhlaw

                                  Hi Bart,

                                   

                                  I'm interested to know whether in between Steps 4 and 5, if you were to uninstall the previous version of the app and then install the just-created APK, would the data be retained?

                                   

                                  I'll try and test out re-installing a simple app for WP which I made to check out whether it retains the data a little later, and let you know.

                                   

                                  In the meantime, can you tell me whether you did anything special to make the device see the new app as an update to the existing app - version change, perhaps or nothing?

                                    • Re: Retain data on WP8 after deploy
                                      Bart Fukkink

                                      Hey Mark,

                                       

                                      I did NOT uninstall the app between steps 4 and 5. If you where to do this, the operating system will remove the data folder that belongs to the application. In this folder is the database the RhoMobile application uses, thus that would be removed aswell. This way the application will install completely fresh.

                                       

                                      Every "release" we do of our application, we make sure that the application name in the build.yml is the same. If you then also use the version attribute in the build.yml you can up that every release to make it see as an update.

                                       

                                      Thats at least how it works for us.

                                       

                                      Bart

                                        • Re: Retain data on WP8 after deploy
                                          Mark Nongkhlaw

                                          Hi Bart,

                                           

                                          I finally got to test it out. The previous app was built with Rhodes 3.3.2 (yep, old Rhostudio, not Rho Suite) in a Windows7 PC. I did not uninstall it from device (WP8 Phone). I upped the version in my build.yml. Then rebuilt it with RMS2.05 using the same PC. Command used : rake device:wp:production. It built the XAP. Then I uploaded it to Windows Phone Dev Center. No problem with parsing there. Then I published it as a beta for private distribution to myself. Got an email on my phone with a link to the app. On clicking it, it prompted for an update. I went ahead, updated, launched the app.

                                           

                                          Lo and behold : Previous data is intact.

                                           

                                          More info : No RhoElements, no JS, only pure Ruby code

                                           

                                          So I conclude that either the support for WP8 in RMS4.x, although much hyped, has in fact deteriorated, or there's some problem with the JS APIs (if you're using them) or ??? .... only the Moto guys can enlighten us on this.