Android Open Source - ContentProviderProcessor Customer Contract






From Project

Back to project page ContentProviderProcessor.

License

The source code is released under:

Apache License

If you think the Android project ContentProviderProcessor listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.wackernagel.android.contractcontentprovider.sample.provider;
//  w w w  . ja v  a  2  s.  c  o m
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import de.wackernagel.android.contractcontentprovider.Contract;

public class CustomerContract implements Contract {
  
  public static final String TABLE = "customers";
  
  public static final String COLUMN_NAME = "name";
  
  public static final Uri CONTENT_URI = Uri.parse( "content://" + SampleProvider.AUTHORITY + "/" + TABLE );
  
  public static final String CREATE_STATEMENT = "create table if not exists " + TABLE + "("
      + COLUMN_ID + " integer primary key autoincrement, "
      + COLUMN_NAME + " text not null );";

  @Override
  public void onCreateStatement(SQLiteDatabase db) {
    db.execSQL( CREATE_STATEMENT );
  }

  @Override
  public void onUpgradeStatement(SQLiteDatabase db, int oldVersion, int newVersion) {
  }

  @Override
  public String getTable() {
    return TABLE;
  }

}




Java Source Code List

de.wackernagel.android.contractcontentprovider.AbstractContentProviderProcessor.java
de.wackernagel.android.contractcontentprovider.ContentProviderProcessor.java
de.wackernagel.android.contractcontentprovider.ContentProviderUtils.java
de.wackernagel.android.contractcontentprovider.ContractContentProvider.java
de.wackernagel.android.contractcontentprovider.ContractSQLiteOpenHelper.java
de.wackernagel.android.contractcontentprovider.Contract.java
de.wackernagel.android.contractcontentprovider.DefaultContentProviderProcessor.java
de.wackernagel.android.contractcontentprovider.GenericUriMatcher.java
de.wackernagel.android.contractcontentprovider.sample.MainActivity.java
de.wackernagel.android.contractcontentprovider.sample.provider.CustomerContract.java
de.wackernagel.android.contractcontentprovider.sample.provider.SampleProvider.java