CodeCanyon

To-Do App for Titanium

  • Has been a member for 1-2 years
  • Bought between 10 and 49 items
JenLopez says

Great work – purchase Saturday – how difficult to integrate cloud database? (cloud being a fancy word for regular/sever)

1 year ago
Author
Default-user rmwebs replied

Hi Jen,

It shouldn’t be too hard really. The only thing I would say is that you’ll want to look at a local cache. So basically you would have:

1. User opens app 2. App checks for an active data connection 3. If data connection exists, sync sqlite with remote server (this can be done with a simple JSON call or just a XHR request) 4. If a connection doesn’t exist, pull tasks from the sqlite database.

Of course the biggest issue will be getting the sync correct. You dont want to go and accidentally overwrite a bunch of entries. For this the best thing I can think of would be to store an md5 hash of the individual tasks, which gets compared against the server version. If they differ, it then looks at a timestamp to see which was the newest and syncs that one across.

I had a flick through the Titanium Q&A and found a few resources that you may be interested in reading:

http://developer.appcelerator.com/question/91951/syncing-with-website http://developer.appcelerator.com/question/108981/populate-local-sqlite-db-from-remote-mysql-one

The below blog post by a member of the Q&A area explains one way of doing mobile sync: http://blogs.usask.ca/the_bolt/archive/2011/01/titanium_tutorial_mobile_database_sync.html

Hope this helps – if you do get stuck on any of the code just give me a shout!

1 year ago
  • Has been a member for 2-3 years
  • Bought between 50 and 99 items
  • United States
oceadesign says

thanks for the awesome reply – let you know how it goes!

1 year ago
  • Has been a member for 1-2 years
  • Bought between 1 and 9 items
phug says
Purchased

FYI – App threw an NSException in Titanium iPhone 4.3 Emulator on launch and subsequent task editing.

1. created a new todo task 2. hit Edit and deleted new task then hit Cancel

Here’s the log output from the emulator console:

[INFO] Compiling JavaScript…one moment [WARN] JavaScript compiler reported ”’i’ is already defined.” at includes/db.js:23 [WARN] JavaScript compiler reported “Extra comma.” at tasks.js:153 [WARN] JavaScript compiler reported “Extra comma.” at view_task.js:28 [WARN] JavaScript compiler reported “Extra comma.” at view_task.js:53 [INFO] One moment, building … [INFO] Titanium SDK version: 1.6.2 [INFO] iPhone Device family: iphone [INFO] iPhone SDK version: 4.3 [INFO] iPhone simulated device: iphone [INFO] Performing full rebuild. This will take a little bit. Hold tight… [INFO] Skipping JS compile, running from simulator [INFO] Performing clean build [INFO] Launching application in Simulator [INFO] Launched application in Simulator (23.06 seconds) [INFO] Application started [INFO] To-Do/1.0 (1.6.2.878906d) [INFO] focus done! [INFO] Has children! Len: 1 [INFO] 0) object TiUITableView focus done! [INFO] Has children! Len: 1 [INFO] 0) object TiUITableView focus done! [INFO] Has children! Len: 1 [INFO] 0) object TiUITableView focus done! [INFO] Has children! Len: 1 [INFO] 0) object TiUITableView focus done! [INFO] Has children! Len: 1 [INFO] 0) object TiUITableView focus done! [ERROR] The application has crashed with an unhandled exception. Stack trace: 0 CoreFoundation 0×0233158c exceptionPreprocess + 156 1 libobjc.A.dylib 0×02485313 objc_exception_throw + 44 2 CoreFoundation 0×022e9ef8 +[NSException raise:format:arguments:] + 136 3 CoreFoundation 0×022e9e6a +[NSException raise:format:] + 58 4 QuartzCore 0×01a07ba2 _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 177 5 QuartzCore 0×01a07d55 -[CALayer setPosition:] + 42 6 To-Do 0×0004f92b -[TiViewProxy relayout] + 871 7 To-Do 0×0004eccd -[TiViewProxy refreshView:] + 485 8 To-Do 0×0004fc34 -[TiViewProxy layoutChildrenIfNeeded] + 182 9 To-Do 0×0013c87d performLayoutRefresh + 364 10 CoreFoundation 0×023128c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 19 11 CoreFoundation 0×02313e74 CFRunLoopDoTimer + 1220 12 CoreFoundation 0×022702c9 __CFRunLoopRun + 1817 13 CoreFoundation 0×0226f840 CFRunLoopRunSpecific + 208 14 CoreFoundation 0×0226f761 CFRunLoopRunInMode + 97 15 GraphicsServices 0×041371c4 GSEventRunModal + 217 16 GraphicsServices 0×04137289 GSEventRun + 115 17 UIKit 0×008a9c93 UIApplicationMain + 1160 18 To-Do 0×00003bcc main + 362 19 To-Do 0×000029f1 start + 53 2011-05-16 16:56:56.573 To-Do[7304:207] * Terminating app due to uncaught exception ‘CALayerInvalidGeometry’, reason: ‘CALayer position contains NaN: [4.18708e-42 nan]’
  • Call stack at first throw: ( 0 CoreFoundation 0×023315a9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0×02485313 objc_exception_throw + 44 2 CoreFoundation 0×022e9ef8 +[NSException raise:format:arguments:] + 136 3 CoreFoundation 0×022e9e6a +[NSException raise:format:] + 58 4 QuartzCore 0×01a07ba2 _ZL18CALayerSetPositionP7CALayerRKN2CA4Vec2IdEEb + 177 5 QuartzCore 0×01a07d55 -[CALayer setPosition:] + 42 6 To-Do 0×0004f92b -[TiViewProxy relayout] + 871 7 To-Do 0×0004eccd -[TiViewProxy refreshView:] + 485 8 To-Do 0×0004fc34 -[TiViewProxy layoutChildrenIfNeeded] + 182 9 To-Do 0×0013c87d performLayoutRefresh + 364 10 CoreFoundation 0×023128c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION
+ 19 11 CoreFoundation 0×02313e74 __CFRunLoopDoTimer + 1220 12 CoreFoundation 0×022702c9 __CFRunLoopRun + 1817 13 CoreFoundation 0×0226f840 CFRunLoopRunSpecific + 208 14 CoreFoundation 0×0226f761 CFRunLoopRunInMode + 97 15 GraphicsServices 0×041371c4 GSEventRunModal + 217 16 GraphicsServices 0×04137289 GSEventRun + 115 17 UIKit 0×008a9c93 UIApplicationMain + 1160 18 To-Do 0×00003bcc main + 362 19 To-Do 0×000029f1 start + 53 ) terminate called after throwing an instance of ‘NSException’ [INFO] Application has exited from Simulator
1 year ago
Author
Default-user rmwebs replied

Hi phug,

Could you try emptying your /build/iphone directory out and restarting Titanium – the titanium builder has a few known problems when building on some occasions.

I’ve tried replicating the error from my end however cant seem to do so. Could you confirm your version of Xcode and Titanium Mobile you are using?

Cheers,

Rick

1 year ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 10 and 49 items
  • Brazil
felipegaspar says

Hey,this app can be used like an alarm when the time come?

10 months ago
Author
Default-user rmwebs replied

It probably could if you were to add in the functionality to do so…you could use MP3 files and even push notifications.

10 months ago

by
by
by
by
by