Skip to content
Create Content Provider with Ease.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle/wrapper
historyprovider_library
.gitignore
HistoryProvider.gif
LICENSE.md
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

HistoryProvider

API Android Arsenal Android Dev Digest License
History Provider is a simple library that stores your typed history inside a Database using the concept of Content providers, making the history database available to any application in the phone.

alt tag

Installation

Add gradle dependency with command:

dependencies {
    compile 'org.ishmeetsingh.androbot:historyprovider:1.0.0'
    }

By using Maven:

<dependency>
  <groupId>org.ishmeetsingh.androbot</groupId>
  <artifactId>historyprovider</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Implementation

These steps are required to implement HistoryProvider in your Android Project:

  1. Make a new class and implements Cursor Loader android.app.LoaderManager.LoaderCallbacks<Cursor> and Override all the methods.
  2. Make an Listview and make an Adapter for it.
  3. In the MainActivity, Define an EditText by findViewById() and make a method to store words in the Database like this:
String name = EditText_Name.getText().toString().trim();
ContentValues values = new ContentValues();
values.put(WordContract.WordEntry.COLUMN_WORD_NAME,name);
Uri newUri = getContentResolver().insert(WordContract.WordEntry.CONTENT_URI, values);

FULL IMPLEMENTATION FOR ABOVE STEPS IS PROVIDED IN THE SAMPLE APP.

Additional Important Requirement:

Define the Content Provider in the Manifest file like this(No Values should be changed here excluding the provider name):

<provider
android:name="com.example.historyprovider_library.WordsProvider"
android:authorities="com.example.android.words"
android:enabled="true"
android:exported="true"
android:multiprocess="true" />

For any problems using HistoryProvider, Refer the Sample App or Contact me at ishmeet.1136@gmail.com

You can’t perform that action at this time.