aspose file tools
The moose likes Android and the fly likes caching/syncing mysql to sqlite Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "caching/syncing mysql to sqlite" Watch "caching/syncing mysql to sqlite" New topic
Author

caching/syncing mysql to sqlite

Brian Wheeler
Greenhorn

Joined: Dec 06, 2010
Posts: 15
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

Joined: May 14, 2008
Posts: 4875

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.


JBoss In Action
Brian Wheeler
Greenhorn

Joined: Dec 06, 2010
Posts: 15
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!
 
 
subject: caching/syncing mysql to sqlite
 
Threads others viewed
issue related to JTable and SQLite database
Alternative to Database
SQLite in Netbeans
database primer
JSON WebServices
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture