NKTableView, NKFile, NKNKFileDownloader

Ask questions and share your skills here

NKTableView, NKFile, NKNKFileDownloader

Postby mouts13 » Fri Jul 02, 2010 4:12 am

Hello, I have an idea but I do not know if it's possible to store a sqlite database on a server and every time you open the application it would be an update of this database is to download directly the web server. Once the database to download and binds tableview to the given database using itʼs table as datasource. With NKTableView, NKFile and NKNKFileDownloader ????
User avatar
mouts13
 
Posts: 93
Joined: Sun Feb 14, 2010 1:06 am

Re: NKTableView, NKFile, NKNKFileDownloader

Postby Big-O » Fri Jul 02, 2010 1:27 pm

I don't see why that wouldn't work, but depending on the size of the dataset you might be better off fetching it with ajax and json and just running an update on the database.
I am a small and fragile flower.

-- Big-O
User avatar
Big-O
NimbleKit Expert
 
Posts: 310
Joined: Thu Sep 24, 2009 4:02 am

Re: NKTableView, NKFile, NKNKFileDownloader

Postby mouts13 » Fri Jul 02, 2010 1:31 pm

Thank you for your quick response, but I do not see how you have an example project?
User avatar
mouts13
 
Posts: 93
Joined: Sun Feb 14, 2010 1:06 am

Re: NKTableView, NKFile, NKNKFileDownloader

Postby thedjmixman » Sat Jul 03, 2010 2:42 am

I have some code I can give you but there are a few different things you need to do, so I will list what I did & you can tell me what bits you need.

1. My JSON download is on my main page, so I use a button for the user to trigger it. That way the App doesnt take ages to load and you can offer a progress bar so they can see what is happening.

2. Send an Ajax request to your server for the JSON

3. eval() the JSON. You pretty much treat it as an array after that, even though it's not.

4. Empty any tables from the app's existing DB that you wish to re-populate with the JSON data

5. Work through each table, inserting each row in WHILE loop.

I have a progress bar and a label that updates when each table is completed. Once it is all done, i load up main2.html and then set the tabs & nav controller. That initial page is never viewed again until the app is re-launched.
User U1318808401
User avatar
thedjmixman
NimbleKit Expert
 
Posts: 60
Joined: Sun Jun 13, 2010 4:05 am
Location: Kent, UK

Re: NKTableView, NKFile, NKNKFileDownloader

Postby mouts13 » Sat Jul 03, 2010 2:52 am

Can you send me your code so that I look please.

is my email: mouts_123@hotmail.com
User avatar
mouts13
 
Posts: 93
Joined: Sun Feb 14, 2010 1:06 am

Re: NKTableView, NKFile, NKNKFileDownloader

Postby ian92484 » Sat Jul 03, 2010 7:08 am

I've actually been having the same issue of updating when the app is opened. I'd love to have a look at that example code too, if you wouldn't mind? imaegrisomnian@gmail.com. Thanks!
ian92484
 
Posts: 1
Joined: Fri Jun 25, 2010 11:49 pm

Re: NKTableView, NKFile, NKNKFileDownloader

Postby thedjmixman » Sat Jul 03, 2010 11:41 am

No problem, I'll send it over to you later.

For speeding up the App at launch, I tried a couple of method that were mentioned but they didnt work, so I just put the first part of my sequence in a function that is linked to an onclick event. With that, the 1st page only has to draw a small piece of text, the background image and the button before showing the that page on the screen.

After that, the rest of the app / code displays as it runs. This is my experience in the simulator anyway.
User U1318808401
User avatar
thedjmixman
NimbleKit Expert
 
Posts: 60
Joined: Sun Jun 13, 2010 4:05 am
Location: Kent, UK

Re: NKTableView, NKFile, NKNKFileDownloader

Postby mouts13 » Sat Jul 03, 2010 5:58 pm

I send you something because I have received nothing?

thedjmixman wrote:No problem, I'll send it over to you later.

For speeding up the App at launch, I tried a couple of method that were mentioned but they didnt work, so I just put the first part of my sequence in a function that is linked to an onclick event. With that, the 1st page only has to draw a small piece of text, the background image and the button before showing the that page on the screen.

After that, the rest of the app / code displays as it runs. This is my experience in the simulator anyway.
User avatar
mouts13
 
Posts: 93
Joined: Sun Feb 14, 2010 1:06 am

Re: NKTableView, NKFile, NKNKFileDownloader

Postby thedjmixman » Sat Jul 03, 2010 7:04 pm

I've been busy today, but I will get it over to you in a bit.
User U1318808401
User avatar
thedjmixman
NimbleKit Expert
 
Posts: 60
Joined: Sun Jun 13, 2010 4:05 am
Location: Kent, UK

Re: NKTableView, NKFile, NKNKFileDownloader

Postby mouts13 » Sat Jul 03, 2010 7:34 pm

ok thank you I wait
User avatar
mouts13
 
Posts: 93
Joined: Sun Feb 14, 2010 1:06 am

Next

Return to How To...

Who is online

Users browsing this forum: No registered users and 2 guests