@@ -0,0 +1,2281 @@
+package com.cross.amsecure;%0A%0Aimport java.util.HashMap;%0A%0Aimport android.content.ContentValues;%0Aimport android.content.Context;%0Aimport android.database.Cursor;%0Aimport android.database.sqlite.SQLiteDatabase;%0Aimport android.database.sqlite.SQLiteOpenHelper;%0A%0A/*%0A   @author to  Ibrahim Hanna @2016%0A                         ibrahim.seniore@gmail.com  %0A*/%0A%0A%0Apublic class DBHelper extends SQLiteOpenHelper %7B%0A%0A%09   public static final String DATABASE_NAME = %22AmSecure.db%22; %0A%09   public static final String SITES_TABLE_NAME = %22Sites%22; %0A%09   public static final String SITES_COLUMN_ID = %22ID%22; %0A%09   public static final String SITES_COLUMN_NAME = %22Name%22; %0A%09   public static final String SITES_COLUMN_PASSWORD = %22Password%22; %0A%09   public static final int DATABASE_VERSION=1;%0A%09%0A%09   private HashMap sitesMap;%0A%09   %0A%09DBHelper(Context context)%7B%0A%09%09super(context, DATABASE_NAME, null, DATABASE_VERSION);%0A%09%7D%0A%09%0A%09%0A%09@Override%0A%09public void onCreate(SQLiteDatabase db) %7B%0A%09%09 db.execSQL( %0A%09%09%09      %22CREATE TABLE %22 +SITES_TABLE_NAME+ %0A%09%09%09      %22 (ID integer primary key, Name text,Password text)%22 %0A%09%09%09      );%0A%09%7D%0A%0A%09@Override%0A%09public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09 db.execSQL(%22DROP TABLE IF EXISTS Sites%22); %0A%09     onCreate(db); %0A%09%7D%0A%0A%09%0A%09public boolean inserSite(String name)%7B%0A%09%0A%09%09SQLiteDatabase db=this.getWritableDatabase();%0A%09%09ContentValues contentValues=new ContentValues();%0A%09%09contentValues.put(%22Name%22, name);%0A%09%09contentValues.put(%22Password%22, %22sadasdfhjkkl%22);%0A%09%09 db.insert(SITES_TABLE_NAME, null, contentValues);%0A%09%09 return true;%0A%09%09%0A%09%7D%0A%09%0A%09public boolean insertSite(String name, String passworsd)%7B%0A%09%09%0A%09%09%0A%09%09SQLiteDatabase db=this.getWritableDatabase();%0A%09%09ContentValues contentValues=new ContentValues();%0A%09%09contentValues.put(%22Name%22, name);%0A%09%09contentValues.put(%22Password%22,passworsd);%0A%09%09 db.insert(SITES_TABLE_NAME, null, contentValues);%0A%09%09 return true;%0A%09%09%0A%09%7D%0A%09%0A%09public Cursor getSites()%7B%0A%09%09%0A%09%09SQLiteDatabase db=this.getReadableDatabase();%0A%09%09Cursor cursor=db.query(SITES_TABLE_NAME, new String%5B%5D%7B%22Name%22%7D,%0A%09%09%09%09null, null, null, null, null);%0A%09%09return cursor;%0A%09%7D%0A%09%0A     public Cursor getSiteRow(String name)%7B%0A%09%09%0A%09%09SQLiteDatabase db=this.getReadableDatabase();%0A%09%09Cursor cursor=db.rawQuery(%22select * from Sites where Name=%22+name, null);%0A%09%09return cursor;%0A%09%7D%0A%09%0A%09%0A%7D%0A

Create DBHelper.java