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.polimi.cp.it; import java.io.FileNotFoundException; 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.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteQueryBuilder; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.net.Uri; import android.os.ParcelFileDescriptor; import android.text.TextUtils; import android.util.Log; public class LibreriaCP extends ContentProvider { private static final String myURI = "content://com.polimi.provider.filecp/files"; public static final Uri CONTENT_URI = Uri.parse(myURI); public static boolean giaLetto; // The underlying database private SQLiteDatabase filesDB; private static final String TAG = "FileProvider"; private static final String DATABASE_NAME = "files.db"; private static final int DATABASE_VERSION = 1; private static final String FILE_TABLE = "files"; // Column Names public static final String KEY_ID = "_id"; public static final String KEY_DATE = "date"; public static final String KEY_DESCRIPTION = "description"; public static final String KEY_NAME = "name"; // Column indexes public static final int ID_COLUMN = 0; public static final int DATE_COLUMN = 1; public static final int DESCRIPTION_COLUMN = 2; public static final int NAME_COLUMN = 3; // Helper class for opening, creating, and managing // database version control private static class fileDatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_CREATE = "create table " + FILE_TABLE + " (" + KEY_ID + " integer primary key autoincrement, " + KEY_DATE + " INTEGER, " + KEY_DESCRIPTION + " TEXT, " + KEY_NAME + " TEXT);"; public fileDatabaseHelper(Context context, String name,CursorFactory factory, int version) { super(context, name, factory, version); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(DATABASE_CREATE); } @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 " + FILE_TABLE); onCreate(db); } } // Prepare the costants for the Uri matcher private static final int ALLROWS = 1; private static final int SINGLE_ROW = 2; private static final UriMatcher uriMatcher; // Populate the UriMatcher object, where a URI ending in ‘items’ will // correspond to a request for all items, and ‘items/[rowID]’ // represents a single row. static { uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); uriMatcher.addURI("com.polimi.provider.filecp", "files", ALLROWS); uriMatcher.addURI("com.polimi.provider.filecp", "files/#",SINGLE_ROW); } @Override public int delete(Uri uri, String where, String[] whereArgs) { int count; switch (uriMatcher.match(uri)) { case ALLROWS: count = filesDB.delete(FILE_TABLE, where, whereArgs); break; case SINGLE_ROW: String segment = uri.getPathSegments().get(1); count = filesDB.delete(FILE_TABLE, KEY_ID + "=" + segment + (!TextUtils.isEmpty(where) ? " AND (" + where + ')' : ""), whereArgs); break; default: throw new IllegalArgumentException("Unsupported URI: " + uri); } getContext().getContentResolver().notifyChange(uri, null); return count; } @Override public String getType(Uri _uri) { switch (uriMatcher.match(_uri)) { case ALLROWS: return "vnd.polimi.cursor.dir/file"; case SINGLE_ROW: return "vnd.polimi.cursor.item/file"; default: throw new IllegalArgumentException("Unsupported URI: " + _uri); } } @Override public Uri insert(Uri _uri, ContentValues values) { // Insert the new row, will return the row number if // successful. long rowID = filesDB.insert(FILE_TABLE, "quake", values); // Return a URI to the newly inserted row on success. if (rowID > 0) { Uri uri = ContentUris.withAppendedId(CONTENT_URI, rowID); getContext().getContentResolver().notifyChange(uri, null); return uri; } throw new SQLException("Failed to insert row into " + _uri); } @Override public boolean onCreate() { Context context = getContext(); fileDatabaseHelper dbhelper; dbhelper = new fileDatabaseHelper(context, DATABASE_NAME, null, DATABASE_VERSION); filesDB = dbhelper.getWritableDatabase(); return (filesDB == null) ? false : true; } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sort) { SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); qb.setTables(FILE_TABLE); // If this is a row query, limit the result set to the passed in row. switch (uriMatcher.match(uri)) { case SINGLE_ROW: qb.appendWhere(KEY_ID + "=" + uri.getPathSegments().get(1)); break; default: break; } // If no sort order is specified sort by date / time String orderBy; if (TextUtils.isEmpty(sort)) { orderBy = KEY_DATE; } else { orderBy = sort; } // Apply the query to the underlying database. Cursor c = qb.query(filesDB, projection, selection, selectionArgs, null, null, orderBy); // Register the contexts ContentResolver to be notified if // the cursor result set changes. c.setNotificationUri(getContext().getContentResolver(), uri); // Return a cursor to the query result. return c; } @Override public int update(Uri uri, ContentValues values, String where, String[] whereArgs) { int count; switch (uriMatcher.match(uri)) { case ALLROWS: count = filesDB.update(FILE_TABLE, values, where, whereArgs); break; case SINGLE_ROW: String segment = uri.getPathSegments().get(1); count = filesDB.update(FILE_TABLE, values, KEY_ID + "=" + segment + (!TextUtils.isEmpty(where) ? " AND (" + where + ')' : ""), whereArgs); break; default: throw new IllegalArgumentException("Unknown URI " + uri); } getContext().getContentResolver().notifyChange(uri, null); return count; } public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { if (uriMatcher.match(uri) != SINGLE_ROW) throw new IllegalArgumentException("openFile not supported for directories"); try { /*String id = uri.getPathSegments().get(1); ContentValues values = new ContentValues(); values.put(KEY_DATA, EXTERNAL_STORAGE_DIRECTORY + File.separator + DATABASE_PATH + File.separator + "img"+ id +".png"); update(uri,values,new String(KEY_ID+"="+id),null); */ return openFile(uri, mode); } catch (FileNotFoundException e) { throw new FileNotFoundException(); } } }