Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Niranjan Deodhar
PLUS
Niranjan Deodhar
Courses Plus Student 1,941 Points

Simplifying code generation in business apps

Is there an equivalent of Hybernate (or any method of declaratively creating all this code) in Android? if I build a data model in SQLLite or some such, 80% of the time the form and list applets required to populate, review and edit data are very predictable and “typical”. It would save so much coding to auto-generate all the XML as well as all the classes for adding, deleting, reading and modifying records in a database.

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Excellent question! I haven't used Hybernate, but there are quite a few ORM libraries for Android. Here are the ones I know about (though I haven't used them all):

They all look promising. OrmLite and greenDAO seem to be the most used, though that doesn't mean they are the best. Cupboard is newer and looks interesting.

Niranjan Deodhar
Niranjan Deodhar
Courses Plus Student 1,941 Points

Thanks Ben, really appreciated. A quick look suggests that if the objective is to minimise the work between having created a relational data model, and all the way through to basic CRUD screens / pages / activities on an app, then greegDAO seem most exhaustive in doing so - the others are more like “code libraries” to reduce the work, but greenDAO speaks of auto code generation which is the key.

No one talks of a GUI interface to declaratively initiate all this and allow access through a GUI - IDE. For that, you have to go all the way to "cross-platform development tools" like Kony, Xamarin, Phonegap, Gupta TDM etc. - which, while useful, are by definition never going to be as powerful in their use of any given platform as something native to that platform....

So I was looking for something in between, and greenDAO appears to come closest, I will give it a go! Thanks again.