Code example for String

Methods: valueOf

0
	 * Constructor. 
	 */ 
	public ClueDatabaseHelper(Context context) {
		super(context, DB_NAME, /* cursor factories */ null, VERSION_NUMBER);
		this.context = context;
		DB_PATH = context.getApplicationInfo().dataDir + "/databases/"; // full path to a directory assigned to the package for its persistent data
	} 
	/** 
	 * Creates a empty database on the system and rewrites it the databse from the assets folder. 
	 */ 
	public void createDatabase() { 
		// check first to see if the database exists 
		SQLiteDatabase db = null;
		try { 
			String filename = DB_PATH + DB_NAME;
			db = SQLiteDatabase.openDatabase(filename, null, SQLiteDatabase.OPEN_READWRITE);
		} catch(SQLiteException e) {
			// errors mean that the database does't exist yet 
		} 
		if (db != null) {
			// the databse does indeed exist