How to pre-populate client app in Android ?

Hi how can we pre-populate client application for accessing data offline at the time of first startup, in android.

Daniel López Lacalle
I guess what you need is to

I guess what you need is to add your code to connect to your remote service and store it in local db in "initialize" method of AppAplication class in application.rb.

There are other interesting methods you can overwrite like "on_ui_created" or "on_activate_app"

Take a look at: http://docs.rhomobile.com/rhodes/application#appapplication-class

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Akshat Paul
i was hoping some solution

i was hoping some solution for Android on the lines of http://docs.rhomobile.com/faq#how-to-pre-populate-client-database this.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel López Lacalle
Oh, I misunderstood the

Oh, I misunderstood the question. I though you meant to preload data from server on app startup to use it later.

For what you want I've been able to get to the db folder you need to copy from the emulator using "adb shell" then navigating to "/data/data/com.package.app/rhodata/db".

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexey Tikhvinsky
http://docs.rhomobile.com/faq

http://docs.rhomobile.com/faq#how-to-pre-populate-client-database - is right doc.

1. You need to build development version of your app with empty databases.

2. Run the app at any platform you want (even rhosimulator) and perform sync. This will prepopulate your data within the app.

3. Copy the databases as described in doc to your app sources

4. Build the app again (now it should include these prepopulated databases)

Is it clear currently?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Akshat Paul
thanks a lot, i just wanted

thanks a lot, i just wanted to confirm if i can pick the sqlite db file from rhosimulator coz avd in android is just not showing the db files.

Thanks will test this and update the results

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Hi This is not working i have

Hi

This is not working i have copied files in rhosimulator/db folder to rhodes-3.3.2\platform\shared\db\res\db but after i created the build and check the same on device it is not populating the records. What should we do ?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Akshat Paul
Hi AlexyIt is still not

Hi Alexy

It is still not working, this is a very high priority issue and is delaying our submission.

Plz help resolve this problem asap.

Thanks

Akshat Paul

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Val Palhories
Hi Akshat,Were you ever

Hi Akshat,

Were you ever successful in getting this to work? I'm having the same issues and can't seem to figure out how to get my pre-populated database to the device.

Thanks.

--- Val

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
Have you looked at:http:/
Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Daniel López Lacalle
Much better!

Much better!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Joerg Koch
Is there any news on this for

Is there any news on this for Android and iOS with Rhodes 5.1.1?

Thanks in advance!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments