Loading data into app

5 views
Skip to first unread message

smartocci

unread,
Dec 22, 2009, 11:55:46 PM12/22/09
to rhomobile
Is it possible for me to load data into the sq lite db before
distributing my app? I have a a few thousand records that have no
need of being synced that I'd like to load in advance to avoid the
long sync times on initial app load.

evgeny vovchenko

unread,
Dec 23, 2009, 2:12:38 AM12/23/09
to rhom...@googlegroups.com
What rhodes version do you use?

--

You received this message because you are subscribed to the Google Groups
"rhomobile" group.
To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to
rhomobile+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rhomobile?hl=en.


smartocci

unread,
Dec 23, 2009, 6:53:39 PM12/23/09
to rhomobile
I'm on 1.4 now, I found a post about using
Rho::RhoUtils.load_offline_data(['object_values']) and that is working
for me now, is there any other method I should be aware of?

On Dec 23, 2:12 am, "evgeny vovchenko" <evgenyvovche...@gmail.com>
wrote:

evgeny vovchenko

unread,
Dec 24, 2009, 1:48:17 AM12/24/09
to rhom...@googlegroups.com
Hello,
Now it is manual process for iPhone, Android or WM:
1. Run simulator, login, make full sync and logout
2. Find db folder of simulator(rho\db) and copy syncdb.sqlite and
syncdb.sqlite.version to rhodes/res/build-tools/db
3. The next time you bundle your app this db will be on client.

The problem here is that when you sync on client, server will send this data
again(because client_id is changed).
If you don't want to sync this source on the client and just use prepared
data: modify config.rb after step 2( set empty url )
Rho::RhoConfig::add_source("Customer", {"url"=>"", "priority"=>1})

This approach will work faster on client, since in case of big db inserts
take some time.

Let me know does it work for you.

Regards,
Evgeny.

smartocci

unread,
Dec 30, 2009, 5:10:20 PM12/30/09
to rhomobile
Using Rho::RhoUtils.load_offline_data(['object_values']) is not
working as it takes forever on the client....

I do want my records to stay in sync, but I need to have them
preloaded. How can I copy the sqlite and not have the chaged
client_id? Can I update the client_id in the db when the app boots?

On Dec 24, 1:48 am, "evgeny vovchenko" <evgenyvovche...@gmail.com>

> On Dec 23, 2:12šam, "evgeny vovchenko" <evgenyvovche...@gmail.com>


> wrote:
> > What rhodes version do you use?
>
> > -----Original Message-----
> > From: rhom...@googlegroups.com [mailto:rhom...@googlegroups.com]
> > On
>
> > Behalf Of smartocci
> > Sent: Wednesday, December 23, 2009 7:56 AM
> > To: rhomobile
> > Subject: [rhomobile] Loading data into app
>
> > Is it possible for me to load data into the sq lite db before

> > distributing my app? šI have a a few thousand records that have no

Reply all
Reply to author
Forward
0 new messages