• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

caching/syncing mysql to sqlite

 
Brian Wheeler
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm trying to find a way to cache images and strings from mysql to sqlite so that my android application can access locally? I think I can use php and json to do the job but I'm unsure how I would use json to parse images. Has anyone done anything like this before?

Cheers!
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since both XML and JSON are textual, you will have to encode/decode the pictures. The base64 encoding available from Apache Commons Codec (http://commons.apache.org/codec/) can help. If the Dalvick converter doesn't like all of Commons Codec, you can try to extract only the parts you need. If that doesn't work, encoding algorithms aren't that hard to write from scratch.
 
Brian Wheeler
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I went a different route. I'm storing images to a server and using httpget to get image from url. Then inserting the image to sqlite. As far as strings and integers, I'll still use php and json to do the job. Is this a good plan?

Cheers!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic