GithubHelp home page GithubHelp logo

simplecontentprovider's People

Contributors

felipepedroso avatar xxv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplecontentprovider's Issues

Incorrect comment in the constructer for example/SampleProvider

I guess I'm nitpicking.

example/SampleProvider.java#SampleProvider()

// the above three statements can be repeated to create multiple data
// stores. Each will have separate tables and URIs.

There's only two statements above (not including the constuctor). I guess at some point there were more.

Add multicolumn unique

It would be great, if i can create multicolumn unique. A made a workaround by created a new ColumnType.

Provider name in example manifest

<provider
    android:name="SampleProvider"
    android:authorities="edu.mit.mobile.android.content.example.sampleprovider"
    />

In the example project's manifest, the name is given as SampleProvider. How does this work without pre-pending the name with a period to indicate that the application package should be used?

The guidelines found on developer.android.com (http://developer.android.com/guide/topics/manifest/provider-element.html) indicate that the name attribute should be fully qualified, or the first character should be a period.

In the example project, everything is under one package.
I'm asking because my application's package name is different from the package my Provider is in (the manifest is the Only place where the old package name is used, to allow updates for existing users).

The comment for the String constant in SampleProvider in the example project says:

// Each ContentProvider must have a globally unique authority. You should
// specify one here starting from your Application's package string:

Is it the case that it's required to start from that package string, or just that it's the practice? Under the "Designing an Authority" section on developer.android.com (http://developer.android.com/guide/topics/providers/content-provider-creating.html), it says "should" append application package name, though from the context of the paragraph, looks like it's just to avoid naming conflicts, rather than any technical reason.

add getter for the DatabaseHelper.

In SimpleContentProvider there should be a protected getter for mDatabaseHelper so that subclasses can access the database directly if they need to.

create one2many helper

m2m is great, but one2many is often what one needs. Parts of the current m2m tried to be o2m, so that needs to be fixed.

The harder part about o2m (considering the current framework) is that it requires the ability to change the table creation for the target object. This may require creating a special column type.

automatic migration for simple changes

Adding/dropping columns are pretty common in doing DB work. It'd be really cool if there was some infrastructure to assist with automatic generation of table migration SQL.

One of the hard parts about this with the current model is that it would probably involve introspection using SQLite-specific commands to compare table definitions.

Add support for non-DB URIs

Currently, it's not possible to have one path of the provider backed by something other than the database, even though that should be possible. Ideally, one could have - say - a contact photo URI go straight to a filesystem instead of a database. This will require a bit of refactoring and maybe changing of the API, but is one of the goals for this framework.

To demonstrate this functionality, a simple filesystem path handler should be written which allows for storage / retrieval of content from a file, probably by returning a URI instead of the binary blob itself (it may be valuable to check out the way that Android implements the contact provider for this).

Improve m2m helper

The existing ManyToMany helper provides basic functionality, but there is a lot of room for improvement. It's not entirely easy to discover and use the relationship between tables and how to construct appropriate URLs for querying parent/children.

It would probably be a good idea to look deeper at what Django and Hibernate provide in terms of this and see what can be done while still sticking to the URI-centric worldview and ContentProvider API.

way to integrate non-SQLite paths

It'd be nice if it would be possible to create virtual paths in the same content provider that aren't backed by SQLite databases. For example, one could have a thumbnail resource that's backed by a filesystem. This extension could possibly include a simple file-backed provider for saving binary blobs.

Insert ignore issue

When i'm using "insert ignore" or "unique on conflict ignore" the insert throws exception, because of the rowid = -1 in GenericDBHelper at line ~ 120 (insertDir). The solution is simple: remove throwing and simple return null.

Incomplete method comment in example project

// this is called when the activity is re-started by the system with a new intent. This is only
// really used with the

In SimpleContentProviderExample#onNewIntent(Intent) the method comment is incomplete. I haven't felt this way since finishing Harry Potter 6.

add support for bulk operations

Currently, there's no support for for bulk inserts or any other bulk operations. This can be extremely helpful for performance and should be added.

This should support the bulkInsert() and applyBatch() functions, wrapping any DB calls in a transaction to ensure it's atomic.

defaultValue = DatetimeColumn.NOW_IN_MILLISECONDS is not atomic

using defaultValue = DatetimeColumn.NOW_IN_MILLISECONDS as well as flags = DatetimeColumn.FLAG_AUTO_NOW doesn't yield atomic setting of the column values.

Test 2 failed with created / modified being off by 1ms. Ideally these should be exactly the same.

add M2M example

Provide an example that demonstrates M2M being used. Perhaps People/Project ?

demonstrate CursorLoader framework

As the future of Android is the Loader model, we should either move the current example to the Loader framework (using the compatibility library) or provide an example that demonstrates the use of the new framework.

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.