title: Passing images between Java client, Java server (with db sortage) and Android handset
body: <p>I have created an application suite of three programs.
  The first program is a Java application that takes an image file and resizes it and creates an object with additional Strings for use in the Android client.</p>
  
  <p>The second program is a Java servlet (RESTful services atm) that accepts uploads from the first program and stores the object into a database and then servers those objects to other Java applications and to Android handsets.</p>
  
  <p>The third program is an Android application that needs to download the objects from the server, save them to the SD card and then access them for use.</p>
  
  <p>I wanted to just use RMI to pass the objects around the network but Android doesn't support RMI, so  I started looking at XML-RPC and eventually decided to try RESTful services to act as the web controller for uploading and downloading.  What I am having a problem with is figuring out how to encode my data.</p>
  
  <p>One class has an ArrayList of objects that contain Strings.</p>
  
  <p>One class has an image and a few Strings.</p>
  
  <p>More classes will come with varying amounts of Strings and Images.</p>
  
  <p>At the moment I am trying to use Gson to encode the objects into JSON but that doesn't seem to be working when I view the file, it can't handle the ArrayList. I am thinking about converting the images to Base64 strings to make the storage easier.</p>
  
  <p>How should I be handling my data and what server could I be using? Ideally i would just like to get the data on the initial Java app and then just pass the objects around to the server and the other clients.</p>
  
  <p>Thanks!</p>