Coder Social home page Coder Social logo

simplecontentprovider's Introduction

Simple Content Provider

This library aims to make creation of private and public ContentProviders trivial.

If your app is backed by a database, chances are you took one look at the Content Provider API and decided that it wasn't worth the effort to use. This library aims to help that by removing the need to do all the legwork of writing all the basic CRUD operations that you'll encounter writing a basic content provider.

By using this library, you shouldn't need to write any SQL for most applications — table creation, query generation, etc. are all handled for you.

This library is loosely inspired by Django and follows some of its design principles. It also follows the RESTful design principles that underly Android's data-driven activity flow and encourages the use of URIs to represent all data objects.

One can think of this library a bit like a super stripped down ORM — similar to Hibernate or ORMlite.

Unlike ORMs, this library aims to have very little object creation in order to minimize garbage collection churn. This follows Android's existing Content Provider APIs closely, making it so that there should be very little difference between the use of the content providers created by this library and any other Content Provider Android already exposes (contacts, media, calendars, etc.).

Additionally, this library aims to be flexible enough to allow for easy extension if what it provides is too simple for your application.

Features

  • Drastically simplifies the creation of SQLite-backed ContentProviders — Android's core data persistence layer — for most common cases
  • Supports basic table/object creation as well as foreign key and m2m relationships
  • URI-based automatic query generation makes it easy to pass views of data between activities
  • Provides easy integration into Android's global search
  • Multi-process, multi-threading access is handled automatically
  • Designed to be used alongside other libraries
  • ContentProviders made with this library can be exported to other Android apps

Example

For an example / demo of the library, please see the example code (also available on Google Play). The example shows the core features as well as demonstrates how to hook the library into a UI.

It's probably best to start at SampleProvider and eventually make your way through Message and the accompanying activities.

Using

The Javadocs try to be extensive. You should start at SimpleContentProvider which includes a brief walk-through of the system.

License

Android Simple Content Provider
Copyright (C) 2011-2013 MIT Mobile Experience Lab

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software gnu.org/licenses/lgpl.html

simplecontentprovider's People

Contributors

felipepedroso avatar xxv avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.