Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package com.droidnova.android.lineofsight.provider; import java.util.HashMap; import android.content.ContentProvider; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.content.UriMatcher; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.net.Uri; import android.text.TextUtils; import android.util.Log; import com.droidnova.android.lineofsight.data.LineOfSightData; import com.droidnova.android.lineofsight.data.LineOfSightData.Player; /** * Entity class for a database with one table. * * @author Martin */ public class AvatarProvider extends ContentProvider { /* Tag for logging */ private static final String TAG = "AvatarProvider"; private static final int CHARACTER = 1; private static final int CHARACTER_ID = 2; private static final String DATABASE_TABLE = "avatar"; private static final int DATABASE_VERSION = 1; private static final UriMatcher uriMatcher; private static HashMap userProjectionMap; private DatabaseHelper openHelper; @Override public boolean onCreate() { openHelper = new DatabaseHelper(getContext()); return true; } @Override public int delete(Uri uri, String where, String[] whereArgs) { SQLiteDatabase db = openHelper.getWritableDatabase(); int count; switch (uriMatcher.match(uri)) { case CHARACTER: count = db.delete(DATABASE_TABLE, where, whereArgs); break; case CHARACTER_ID: String playerId = uri.getPathSegments().get(1); count = db.delete(DATABASE_TABLE, Player._ID + "=" + playerId + (!TextUtils.isEmpty(where) ? " AND (" + where + ')' : ""), whereArgs); break; default: throw new IllegalArgumentException("Unknown URI " + uri); } getContext().getContentResolver().notifyChange(uri, null); return count; } @Override public String getType(Uri uri) { switch (uriMatcher.match(uri)) { case CHARACTER: return Player.CONTENT_TYPE; case CHARACTER_ID: return Player.CONTENT_ITEM_TYPE; default: throw new IllegalArgumentException("Unknown URI " + uri); } } @Override public Uri insert(Uri uri, ContentValues values) { // validate the uri if (uriMatcher.match(uri) != CHARACTER) { throw new IllegalArgumentException("Unknown URI " + uri); } SQLiteDatabase db = openHelper.getWritableDatabase(); long id = db.insert(DATABASE_TABLE, null, values); if (id == -1) { return null; } else { return ContentUris.withAppendedId(Player.CONTENT_URI, id); } } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { SQLiteDatabase db = openHelper.getWritableDatabase(); return db.query(DATABASE_TABLE, projection, selection, selectionArgs, null, null, sortOrder); } @Override public int update(Uri uri, ContentValues values, String where, String[] whereArgs) { SQLiteDatabase db = openHelper.getWritableDatabase(); int count; switch (uriMatcher.match(uri)) { case CHARACTER: count = db.update(DATABASE_TABLE, values, where, whereArgs); break; case CHARACTER_ID: String playerId = uri.getPathSegments().get(1); count = db.update(DATABASE_TABLE, values, Player._ID + "=" + playerId + (!TextUtils.isEmpty(where) ? " AND (" + where + ')' : ""), whereArgs); break; default: throw new IllegalArgumentException("Unknown URI " + uri); } getContext().getContentResolver().notifyChange(uri, null); return count; } static { uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); uriMatcher.addURI(LineOfSightData.AUTHORITY, "avatar", CHARACTER); uriMatcher.addURI(LineOfSightData.AUTHORITY, "avatar/#", CHARACTER_ID); userProjectionMap = new HashMap(); userProjectionMap.put(Player._ID, Player._ID); userProjectionMap.put(Player.NAME, Player.NAME); userProjectionMap.put(Player.GENDER, Player.GENDER); userProjectionMap.put(Player.RACE, Player.RACE); userProjectionMap.put(Player.LEVEL, Player.LEVEL); userProjectionMap.put(Player.EXPERIENCE, Player.EXPERIENCE); userProjectionMap.put(Player.CURRENT_HEALTH, Player.CURRENT_HEALTH); userProjectionMap.put(Player.CURRENT_WITCHERIES, Player.CURRENT_WITCHERIES); userProjectionMap.put(Player.STRENGTH, Player.STRENGTH); userProjectionMap.put(Player.AGILITY, Player.AGILITY); userProjectionMap.put(Player.LIFE, Player.LIFE); userProjectionMap.put(Player.WITCHCRAFT, Player.WITCHCRAFT); userProjectionMap.put(Player.ATTRIBUTE_POINTS, Player.ATTRIBUTE_POINTS); } /** * This class helps open, create, and upgrade the database file. * * @author Martin */ private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, LineOfSightData.DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" + Player._ID + " INTEGER PRIMARY KEY," + Player.NAME + " TEXT," + Player.GENDER + " TEXT," + Player.RACE + " TEXT," + Player.LEVEL + " INTEGER," + Player.EXPERIENCE + " INTEGER," + Player.CURRENT_HEALTH + " INTEGER," + Player.CURRENT_WITCHERIES + " INTEGER," + Player.STRENGTH + " INTEGER," + Player.AGILITY + " INTEGER," + Player.LIFE + " INTEGER," + Player.WITCHCRAFT + " INTEGER," + Player.ATTRIBUTE_POINTS + " INTEGER);"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE); onCreate(db); } } }