Calico is a tool to create and use Android Content Providers in a simple manner. It is an object-relational mapping originally inspired by ActiveRecord from Ruby on Rails, but now very diverged because of the platform differences.
Content Providers are a useful tool whether or not you wish to share content with other applications, but the the amount of boilerplate code necessary to get one started is very off-putting. Once ready, cursors are a efficient way of accessing the content, but not very object-oriented. This library aims to deal with both these issues.
To be written, once the first release is out. :P
If you want to contribute to the development, compile the library from source, or simply add Calico as a submodule to your project, read this section.
This library depends in turn on other libraries. Some are included as git
submodules; all those will be in the submodules
directory.
After cloning the project, run git submodules sync
and git submodules update
to pull the sources of those modules.
The Calico library depends on the Android 2.3.3 SDK and the Android Compatibility package v4. It probably compiles with earlier versions of the SDK, I just build it against level 10.
Same requirements as the library. Of course, it also depends on the library itself. All unit and integration tests are in the
To run tests, you need Robolectric and its dependencies. Everything you need should be available in the submodule directory. The order of the dependencies is important (i.e. JUnit4 should be before Android), the following one works:
- Robolectric main libraries (submodules/robolectric/lib/main/*)
- Robolectric test libraries (submodules/robolectric/lib/test/*)
- Robolectric
- Android SDK
- Android Compatibility package v4
- Calico sources
Note: Due to the low-level nature of testing Calico, Robolectric has proved less helpful than I had hoped. I've refactored most of the tests to Android Unit tests, and will continue this trend.
Robolectric is its own project, but its documentation is very much lacking. To build it the following dependency order works:
- Robolectric main libraries (submodules/robolectric/lib/main/*)
- Android SDK 2.3.3 with Google APIs (android-10)
- Android Compatibility package v4
- Java 1.6
- Robolectric sources