Note that there are some explanatory texts on larger screens.

plurals
  1. POPersistance of complex Java objects (SQLite, Serialization, JSON) and client-server app architecture
    primarykey
    data
    text
    <p>I'm working on an Android application which is fetching data from internet among other things. Actually, the project was started by someone else which is not here anymore, and now that I have to turn it into a light client application and implement the server side (in Java), I'm wondering what would be the best tools/patterns to use to fit my needs.</p> <p>Let's say I have to deal with several models (class representing a category) of objects which all inherits from one class : they have common attributes (such as name, attache thumbnail...) but specific properties too. Because of this,you can understand that I can't afford to manage one specific table to map each single class.</p> <p>However, I still want to be able to cache my objects somewhere in the Android device to populate the views of the application when working in offline mode.</p> <p>Currently, the solution used by the previous developer was to store data directly into a TEXT field in the SQLIite database, as serialized objets. This should be ok on the server side but I've read that the usual Java serializaton was very slow on the Android platform, although it is not really noticeable now because I work with around ~50 objects, I was looking for more performant alternatives for the future.</p> <p>I've came across the JSON solution which can easily handle complex structures and Jackson library seems very interesting with its simplified data binding to POJO objects and its well-known performance. But then, how should I store my Json objects ? Is it possible to keep a json string in a TEXT field of a SQlite table ? Or should I rather store them as .json file for each object ? Which one is the more efficient to retrieve later lot of data?</p> <p>Plus, I was thinking that JSON would be a very good exchange format between the Android client application and my server whould is in charge of processing the information from internet third-parties apis and exposing this data with webservices. (rather than trying to implement some RMI-like solution) Is using the usual Apache HTTPClient enough on Android to communicate with the server?</p> <p>For those who successfully developped client-server application (which seems very common to me) is this a good approach for Android ? It seems to me that with mobile platforms, you can't really use the approach that you've learned for more classic J2EE app and such... Any advice would be greatly appreciated because I'm a student and Android beginner who really want to improve her mobile development skills !</p> <p>Thanks :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload