Save information in a SQLite and then upload to a JSON with webserive

3

I have read several tutorials on how to get a JSON and pass the information to a SQlite, however as I do the reverse, I get the application data already saved in SQLite and then transfer it to a webservice with JSON ... thanks right away

    
asked by anonymous 20.09.2016 / 04:10

1 answer

2

Add the google dependency of google to your gradient, have in m2Repository, you will do your normal bench search, transform into a normal java object and then just call gson so

new Gson().toJson(object).build();

I do not remember exactly if it is so, if this is what you really want, I recommend you take a look at Gson's documentation, it's a great class, I always use it, so simple I do not even remember how I do ...

In the documentation you have the notes that you can make in your classes to be able to customize the json, take a field or not and change the name it comes in json ...

link

I believe this link will answer your questions ...

    
20.09.2016 / 12:55