Dumbledroid: magical integration between Android apps and webservices
Note: this text was extracted from blog.leocad.io.
I love open source software. And Dumbledroid was the first one I developed. It's being used for a while now, but never had a proper documentation or manual. Today, I fixed that and gave him a well-deserved bio and some interesting how-tos.
Introducing Dumbledroid
Dumbledroid is a framework that enables integration between an Android app and a RESTful server using magic. Actually, it's not real magic. I'm kidding.
Using Dumbledroid, the developer doesn't have to write parsers for JSON or XML documents from a web service. It maps the document nodes to the class fields and does this automagically!
Dumbledroid also does automatic caching in memory and in disk. Presto!
Usage
You can find a whole detailed guide on the project page on Github. But, in short, if you have a JSON like this:
{
"name": "Luke",
"surname": "Skywalker",
"age": 18,
"isFromDarkSide": false,
"averageShipSpeed": 138.46
}
You only need to write a class like this:
public class Jedi extends AbstractModel {
private String name;
private String surname;
private int age;
private boolean isFromDarkSide;
private double averageShipSpeed;
}
…and you're done. If you name the class' fields exactly like the JSON nodes, Dumbledroid will do the parsing for you. It's magic, you know.
Can I use it on my Android app?
Sure. Dumbledroid is open-source, and its source code is released under the BSD 2-clause license.
If you use it and if it helps you, I'd appreciate you refer my name (Leocadio Tiné) and the link to the project's page in your project's website or credits screen. Though you don't have any legal/contractual obligation to do so, just good karma.
Learn more
The project page on Github has a very detailed README explaining how to use this framework. More tutorials and guides can be found on the wiki page.
You can download the example app on Google Play to see Dumbledroid in action.
And you can find the source code of the example app on the DumbledoreExample
folder of the project on Github.
So what are you waiting for? Start cloning!