If you are used to coding Android applications, there is a good chance that you had to write some
A quick reminder about
Parcelable : It’s an interface you can implement on your classes. If you do so, you can then store the whole class in a
Bundle or as an
My webservice library, DataDroid, use
Parcelable objects to retrieve the result from the webservices if you don’t use a Database to store your data.
There is one downside with
Parcelable … You need to write a LOT of boilerplate to implement the
Parcelable interface in your class. And as every good software engineer, I’m lazy :D
Which brings us to ParcelableCodeGenerator !!
You can find all the information on its GitHub page, but here is a short explanation :
- You clone the repository and import the Java project in Eclipse (or your favorite IDE)
- You write a JSON file defining your
Parcelableclass in the
inputfolder (you can use subfolders to sort your files). Examples are provided to learn the syntax
- You run the project as a Java Project
- The corresponding classes are “magically” generated in the
outputfolder ready for you to copy them in your project
It’s really easy to use and it’s going to save you a lot of time.
Last important thing : the project license. As all my other projects, it is released under the Beerware license :
You can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.
- ContentProviderCodeGenerator or how to create your ContentProviders easily
- How to fix the “NoClassDefFoundError” with ADT 17
- How to fix the “Conversion to Dalvik format failed with error 1″ with ADT 14
- How to make professional looking screenshots for your apps — 09/2013 Edition
- Some Gradle Tips for your Android development