Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

caching/syncing mysql to sqlite

 
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!
 
author
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!
    Bookmark Topic Watch Topic
  • New Topic