EighthProvider.java :  » Log » android-tjintranet » edu » tjhsst » androidIntranet » db » Android Open Source

Android Open Source » Log » android tjintranet 
android tjintranet » edu » tjhsst » androidIntranet » db » EighthProvider.java
package edu.tjhsst.androidIntranet.db;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;

public class EighthProvider extends ContentProvider {

  private static final String TAG = "EighthProvider";
  public static final String NEWS_AUTHORITY = "edu.tjhsst.androidIntranet.db.eighth";
  private static final UriMatcher eighthUriMatcher;
  private static final int EIGHTH = 0;
  private static final int EIGHTH_BLOCK = 1;
  
  static {
    eighthUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
    eighthUriMatcher.addURI(NEWS_AUTHORITY, "eighth", EIGHTH);
    eighthUriMatcher.addURI(NEWS_AUTHORITY, "eighth/*", EIGHTH_BLOCK);
  }

  @Override
  public int delete(Uri arg0, String arg1, String[] arg2) {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public String getType(Uri uri) {
    Log.d(TAG, "Returning Type");
    switch(eighthUriMatcher.match(uri)) {
    case EIGHTH:
      return "vnd.android.cursor.dir/vnd.tjhsst.eighthBlock";
    case EIGHTH_BLOCK:
      return "vnd.android.cursor.item/vnd.tjhsst.eighthBlock";
    }
    return null;
  }

  @Override
  public Uri insert(Uri uri, ContentValues values) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public boolean onCreate() {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public Cursor query(Uri uri, String[] projection, String selection,
      String[] selectionArgs, String sortOrder) {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  public int update(Uri uri, ContentValues values, String selection,
      String[] selectionArgs) {
    // TODO Auto-generated method stub
    return 0;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.