• Stars
    star
    351
  • Rank 120,906 (Top 3 %)
  • Language
    Java
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy integration with Android's built-in and custom content providers data

Easy Content Providers

Easy integration with Android's built-in and custom content providers data. It even comes with a Sample app and Stetho extension for debugging purposes.

Android Arsenal

Why and When

We often experiment with new features, new apps, new ideas or we just code through a hackathon project that's built on-top of Android's content providers.. In such cases, we need tools to get what we want with minimum friction. This is where easy-content-providers come in - we can get all android stored data very easily and we can debug results through Chrome dev tools (based on Stetho implementation).

The library uses reflection and some additional operations to make the ORM implementation generic, this is great for flexibility and POCs but might not be sufficient for high performance production apps. Also, if you don't define the exact columns you want, the mapping will happen on all columns (select * from ...). Sometimes, this is not what you want.

Example Usage

Gradle:

dependencies {
    compile 'me.everything:providers-android:1.0.1'
}

Getting all calendars:

CalanderProvider provider = new CalendarProvider(context);
List<Calendar> calendars = provider.getCalendars().getList();

Full documentation can be found at the wiki.

Inspecting provider data

Gradle:

dependencies {
    compile 'me.everything:providers-stetho:1.0.1' 
}

Leveraging Stetho's ability to inspect SQLite databases, you can visualize, explore and modify all provider data.

Screenshot

In the above example, all providers can be seen expanded, "provider-calendar" is selected and it's items appear in the table to the right.

Adding your own providers

And of course, you can see your own providers by registring them. In our example (check sample app):

... 
providersStetho.registerProvider("provider-custom", "posts", new ProvidersStetho.QueryExecutor<Post>() {
    @Override
    public Data<Post> onQuery(String query) {
        PostsProvider provider = new PostsProvider(getApplicationContext());
        return provider.getPosts();
    }
});	
...

Which looks like so:

Screenshot

SQL Quering

Stetho allows to query SQLite databases from within it's console. Currently, Android providers are interactable with sql, with the following limitations:

  • Only all-inclusive queries are possible select * from "tablename"

  • Results may take a few seconds to appear.

  • Querying tables in provider-calendar can only be done like so:

    • #events:id=3 - select from events where calendar id = 3
    • #instances:id=100 - select from instances where event id = 100
    • #reminders:id=100 - select from reminders where event id = 100
    • #attendees:id=100 - select from attendees where event id = 100

    Screenshot

We are inclined to rid ourselves of these limitations. Stay tuned for upcoming developments.

Sample App

Try it out with our sample app. Download the apk, run it on a connected device, open chrome://inspect in Chrome and start inspecting the providers to your delight.

Notice the app lists items from each provider. Take a look at the app's source code to see how this was implemented.

Screenshot




Author

Roman Kushnarenko - sromku

License

Apache License 2.0

More Repositories

1

overscroll-decor

Android: iOS-like over-scrolling effect applicable over almost all scrollable Android views.
Java
2,833
star
2

geodis

A redis based geo-resolving library
Python
322
star
3

inbloom

Cross language bloom filter implementation
Java
296
star
4

webp-android

webp support for Android API Level 4 and up, includes the native library and a WebPImageView to render webp in your app
C
266
star
5

OverScrollView

A ScrollView with over scroll capabilities, a complete replacement for android's ScrollView.
Java
264
star
6

kickass-redis

Loose python framework for kickass redis patterns
Python
154
star
7

plaxien

An Android library to create Explain Views for algorithms
Java
142
star
8

go-disque

Go client for Disque
Go
136
star
9

ncdu-s3

Run ncdu on S3 buckets
Python
110
star
10

redshift_console

Redshift Ops Console
JavaScript
92
star
11

openspace

An open source app to showcase your open source work (yo dawg)
JavaScript
74
star
12

fabric-aws

fabric AWS integration
Python
72
star
13

rainbow

Cloudformation on steroids
Python
55
star
14

vertex

Go API management framework
JavaScript
54
star
15

probe

Android performance instrumentation tool
Python
42
star
16

webp-test

Testing WebP compression for app icons
Ruby
33
star
17

click-config

Config parsing for click cli applications
Python
31
star
18

recat

logcat alternative with on the fly log deobfuscation!
Python
31
star
19

meduza

A fast data store on top of redis
Go
29
star
20

teleport

Execute Python code in country-specific networking context
Python
21
star
21

pyretrace

A python reimplementation on Proguard's Retrace
Python
20
star
22

lobo

Our Dev Flow Tool
Python
20
star
23

TouchyJS

Mobile web application framework
JavaScript
18
star
24

disposable-redis

Create disposable redis servers on the fly for testing
Go
16
star
25

pystream

Stream backups directly to/from S3/HDFS without wasting disk space during the process
Python
14
star
26

gofigure

A simple config file reading library for Go
Go
11
star
27

pyfrank

python binding for iOS automation using frank.
Python
9
star
28

Screaction

A js script enabling you to change css values as the page scrolls
JavaScript
8
star
29

jitter

Jitt Command Line Tool
Python
7
star
30

everythingme.github.io

A showcase of our open source work, built with openspace
JavaScript
7
star
31

android-logger

Java
6
star
32

ffos-notes

Notes App for FirefoxOS
JavaScript
5
star
33

pytest-blocker

A pytest plugin to mark a test as blocker and skip all tests after it upon failure.
Python
4
star
34

sublime.me

SublimeText3 setup for Everything.me FEDS
JavaScript
3
star
35

jitt

A crowd-sourcing oriented localization service for Andorid applications
CSS
3
star
36

python-disposable-redis

Disposable Redis for your Unittests
Python
3
star
37

logstash-scribeinput

A logstash input plugin which receives scribe log entries via thrift
Java
2
star
38

generator-savedata

Photoshop plugin to save document data for BabelFish
JavaScript
2
star
39

cql_dump

Python
1
star
40

go-accuweather

Go wrapper for the Accuweather API.
Go
1
star