I want my Data Model and my Getters and Setters set like a simple Java Class, let Eclipse create all the getters and setters and if I call them, I want the Data to be stored persistently. There is a sort of way with SQLiteDatabase Class, but it´s still not as comfortable as if you work with simple Java Classes. Is there are framework for it.(also, not only for android. (I got the Idea from the web framework Grails)
//Define DataModel
class StackOverflowUser {
private String name;
private int points;
}
//getters, setters...
//store Data persistently in a Database:
dan.setPoints(dan.getPoints()+5);
I dont understand why this OO Language has this very comfortable way of objects and getters and setters to easily define a data model, but when it comes to persistence, I need dozens of helper classes. It´s not a concrete problem but I hope you have an idea.
Use Shared Preferences to store your data. Please read this tutorial —>
http://androidandandroid.wordpress.com/2010/07/25/android-tutorial-16/