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)
import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; public class DbCat { // Para as variaveis da BD e tabela 'cat' public static final String COL_id = "id"; public static final String COL_nome = "nome"; public static final String COL_descricao = "descricao"; // Para o nome da bd private static final String DATABASE_NAME ="Categorias"; // Para o nome da tabela da bd private static final String DATABASE_TABLE ="cat"; private static final int VersaoDB = 2; // Instancia private DbHelper ourHelper; private final Context ourContext; private SQLiteDatabase ourDatabase; private static class DbHelper extends SQLiteOpenHelper { private static final String TAG = null; public DbHelper(Context context) { super(context, DATABASE_NAME, null, VersaoDB); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE if not exists " + DATABASE_TABLE + " (" + COL_id + " INTEGER PRIMARY KEY AUTOINCREMENT, " + COL_nome + " TEXT NOT NULL, " + COL_descricao + " TEXT NOT NULL);" ); Log.v("INFO1","creating db"); } @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 log"); onCreate(db); } } // Construtor public DbCat(Context c) { ourContext = c; } public DbCat open() throws SQLException { ourHelper = new DbHelper(ourContext); ourDatabase = ourHelper.getWritableDatabase(); return this; } public void close(){ ourHelper.close(); } public String getDados() { String [] columns = new String[] {COL_id, COL_nome, COL_descricao}; Cursor c = ourDatabase.query(DATABASE_TABLE, columns, null, null, null, null, null); String dadosLidos = ""; int linhaId = c.getColumnIndex(COL_id); int linhaNome = c.getColumnIndex(COL_nome); int linhaDes = c.getColumnIndex(COL_descricao); for(c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) { dadosLidos = dadosLidos + c.getString(linhaId)+ " " + c.getString(linhaNome) + " " + c.getString(linhaDes) + "\n"; } return null; } public boolean checkTabela() { Cursor c = ourDatabase.rawQuery("SELECT * FROM " + DATABASE_TABLE, null); if (!(c.moveToFirst()) || c.getCount() ==0){ return false; } return true; } public long criarRegisto(String name, String desc) { Log.d("test", "adding"); ContentValues cv = new ContentValues(); cv.put(COL_nome, name); cv.put(COL_descricao, desc); return ourDatabase.insert(DATABASE_TABLE, null, cv); } }