CornerStone is a useful data manager framework for Android.
Using CornerStone can reduce your work of fetching data and releasing data.
You can pay more attention on the other thing.
An android application is consist of data and view.
In most cases, we need
We followed the following principles to make data managing powerful :
- Using the global manager to manage all data.
- Using DataProvider to keep data.
- Using DataFetcher to fetch data.
- Using DataObserver to watch data change.
- Manager release the data when not used.
CornerStone supports Android 4.0 (Ice Cream).
*Tips: Exactly, Cornerstone can be used in the platforms below 14 if you edit the build.gradle, but I don't recommend to do that. *
If you are building with gradle, please add the following line to the dependencies
section of your build.gradle
file:
compile 'com.kifile.android.cornerstone:Cornerstone:1.3'
We use the Cornerstone to manage all the DataProviders. It means that you shouldn't create a new DataProvider by yourself.
The right way to get a DataProvider is registering a DataProvider in your Cornerstone, then obtaining it from the method obtainProvider(KEY)
in GlobalDataProviderManager.
I suggested registering in your Application class like the followings:
public class App extends Application {
static {
Cornerstone.registerProvider(EXAMPLE_KEY, ExampleDataProvider.class);
}
}
DataProvider is the place where you keep your data.
And we obtain DataProvider
You can see how to use DataProvider here, Click it
You can see how to use DataProvider here, Click it
Cornerstone is upder Apache License 2.0