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.achie.test; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import java.lang.String; import static com.achie.test.Constants.*; import static android.content.Context.*; public class MyDbAdapter { private SQLiteDatabase db; private Context context; public MyDbAdapter(Context c){ this.context = c; } public boolean deleteDatabase(){ return context.deleteDatabase(DATABASE); } public SQLiteDatabase open(){ db = context.openOrCreateDatabase(DATABASE, MODE_PRIVATE, null); return db; } public void close(){ if(db.isOpen()){ db.close(); } } //*****************Application specific********* public void createAchieTable(){ db.execSQL("CREATE TABLE IF NOT EXISTS " + ACHIE_TABLE + " (" + ACHIE_ID + " INTEGER PRIMARY KEY AUTOINCREMENT , " + ACHIE_STATE + " INTEGER, " + EMPLOYEES_STATE + " INTEGER );"); } public boolean initDatabase(){ Log.v("Database: ", "in initDatabase"); Cursor c = db.rawQuery("SELECT COUNT(_id) as count_x FROM "+ACHIE_TABLE , null); c.moveToFirst(); int count = c.getInt(c.getColumnIndex("count_x")); Log.v("Database: ", "in initDatabase "+c.moveToFirst()+" count: "+c.getInt(c.getColumnIndex("count_x"))+" : ::"+count+": "+count); if(count < 1){ Log.v("Database: ", "No elements in ACHIE"); // If the table doesn't have any records insert a default row. ContentValues v = new ContentValues(); v.put(ACHIE_ID, "1"); v.put(ACHIE_STATE, "-1"); v.put(EMPLOYEES_STATE, "-1"); Log.v("Database: ", "Inserting "); db.insert(ACHIE_TABLE, null, v); db.execSQL("UPDATE "+ACHIE_TABLE+ " SET "+ACHIE_STATE+ " = 0 WHERE _id = 1;" ); } c = db.query(ACHIE_TABLE, new String[]{ACHIE_STATE}, ACHIE_ID + " = 1", null, null, null, null); Log.v("Database: ", "in initDatabase "+c.moveToFirst()); if(c.moveToFirst()){ if(c.getInt(c.getColumnIndex(ACHIE_STATE)) >= 0){ //returns true if the ACHIE state is >= 0 Log.v("Database: ", "in initDatabase state is "+c.getInt(c.getColumnIndex(ACHIE_STATE))); return true; } } return false; } public void setFlag(String column, int flag){ db.execSQL("UPDATE "+ACHIE_TABLE+ " SET "+column+ " = "+flag+" WHERE _id = 1;" ); } public int getFlag(String column){ Cursor c = db.query(ACHIE_TABLE, new String[]{column}, ACHIE_ID + " = 1", null, null, null, null); if(c.moveToFirst()){ return c.getInt(0); } return -2; } public boolean checkDatabase(){ Cursor c = null; c = db.query(ACHIE_TABLE, new String[]{ACHIE_STATE, EMPLOYEES_STATE }, ACHIE_ID + " = 1", null, null, null, null); if(c.moveToFirst()){ int flagCount = c.getInt(0) + c.getInt(1); if(flagCount < 2) return false; return true; } return false; } public Cursor getDatabaseStatus(){ return db.query(ACHIE_TABLE, new String[]{ACHIE_STATE, EMPLOYEES_STATE}, ACHIE_ID + " = 1", null, null, null, null); } // Employees public void createEmployeesTable(){ db.execSQL("CREATE TABLE IF NOT EXISTS " + EMPLOYEES_TABLE + " (" + EID + " INTEGER PRIMARY KEY , " + EMPLOYEE_NAME + " TEXT NOT NULL );"); } public void deleteEmployeesTable(){ db.execSQL("DROP TABLE IF EXISTS " +EMPLOYEES_TABLE+ ";"); } public long addEmployee(Employee e){ ContentValues values = new ContentValues(); values.put(EID, e.getId()); values.put(EMPLOYEE_NAME, e.getName()); long result = -1; result = db.insert(EMPLOYEES_TABLE, null, values); return result; } public Cursor fetchEmployees() { Log.v(this.getClass().getName(), "Fetching Employees"); Cursor c = db.query(EMPLOYEES_TABLE, new String[] {EID, EMPLOYEE_NAME}, null, null, null, null, EMPLOYEE_NAME); return c; } }