Pregunta

How do you migrate the data from your database with Property bag model to the application you build in Rho-mobile.

To illustrate this let I have an application in which I have a model Products and three attributes Name,Brand and SDK. I have inserted a number of values into the Products model while it was in development phase and running on emulator.But after building the application I don't see the data which I had inserted while running on the device.

¿Fue útil?

Solución

There are several caveats when trying to pre-populate information into the database of the app (such as file size in older Android versions and such), but if you are determined, this is the link to the documentation of how to do it:
http://docs.rhomobile.com/faq#how-to-pre-populate-client-database

Otros consejos

Incase the docs move again, I'll copy it here:


How to pre-populate client database

Run application on target emulator, insert objects to database(locally or get data from server) Copy all files from ‘db’ folder on emulator to ‘/platform\shared\db\res\db’. Here is how to find ‘db’ emulator folder:

  • iPhone: look inside log to find paths with guid – this is where application store files on emulator. Or run search by ‘syncdbuser.sqlite’ from disk root
  • Android: difficult since emulator is virtual machine and files stored inside emulator. Use adb command line to find path to application package
  • Windows Mobile: open device explorer from ActiveSync or ‘Mobile Device center’, navigate to ‘Program Files//rho/db’
  • Blackberry: open on computer file system – ‘/components/simulator/sdcard/Rho//db Build application, now all db files are in the application package

From my own experience with Android, it's easiest to open the DDMS perspective in Eclipse while an instance of the app is running on an AVD. In the File Explorer tab, navigate to /data/data/your.packagename.app/rhodata/db, and you'll find the database files to copy to the target directory.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top