title: is it possible to have sqlite tables in jar file for android
body: <p>Is it possible to have SQLite tables inside a jar of an android application.<br>
  Here I have a DatabaseHelper page in My android application but i am not able to include it as a java library file. Is it possible?  </p>
  
  <p>Here is the code:  </p>
  
  <p>public class DatabaseHelper extends SQLiteOpenHelper {  </p>
  
  <pre><code>public static final String DATABASE_NAME = "Siemens";  
  public static final String DATABASE_TABLE_SYNC = "sync_table";  
  public static final String TBL_SUB_STATUS = "tbl_sub_status";  
  public static final String TBL_RESPONSE_CATEGORY = "tbl_response_category";  
  public static final String DATABASE_TABLE_FIELD = "field_table";  
  public static final String TBL_PENDING_PM = "pending_calls";  
  public static final String TBL_UPDATE_ORDER = "tbl_update_order";  
  public static final String TABLE_ANSWERS_OF_QUESTIONNAIRE = "quetionnaire_answers";  
  public static final String TBL_PENDING_JOBS = "pending_site_call_list";  
  public static final String TABLE_FILE_ATTACH = "file_attachments";  
  public static final String TABLE_SIGN_ATTACH = "sign_attachments";  
  public static final String TABLE_QUESTIONNAIRE_FILE_ATTACH = "fileattachment_for_questionnaire";  
  public static final String TABLE_QUESTIONNAIRE_CLOSE = "questionnaire_completed";  
  public static final String TBL_JOB_CLOSE = "site_call_closure_table";  
  public static final String TABLE_IS_FILE_ATTACHED = "attached_files";  
  
  public static final String TABLE_QUESTIONNARE_LIST = "QuestionnareList";  
  public static final String CANCEL_OR_FOLLOWUP = "tbl_cancel_or_followup";  
  public static final String TBL_SAVE_JOBS = "tbl_save_jobs";
  public static final String TBL_REJECT_STATUS = "tbl_callreject_status";
  public static final String TBL_MATERIAL_MASTER = "tbl_material_master";
  public static final String TBL_CLOSURE_SUBSTATUS = "tbl_closure_substatus";
  
  public static final int DATABASE_VERSION = 5;
  
  public DatabaseHelper(Context context, String name, CursorFactory factory, int version) {
      super(context, DATABASE_NAME, factory, DATABASE_VERSION);
  }
  
  @Override
  public void onCreate(SQLiteDatabase db) {
      try {
          db.execSQL("CREATE TABLE " + DATABASE_TABLE_SYNC + "(KEYS TEXT, SUBVALS TEXT, DEFS TEXT)");
          db.execSQL("CREATE TABLE " + TBL_SUB_STATUS + "(KEYS TEXT, SUBVALS TEXT)");
          db.execSQL("CREATE TABLE " + TBL_RESPONSE_CATEGORY + "(RESPONSE_CATEGORY TEXT, PRODUCT_CATEGORY TEXT)");
          db.execSQL("CREATE TABLE " + DATABASE_TABLE_FIELD + "(FIELDID TEXT PRIMARY KEY, FIELDVALUES TEXT, FIELDDEF TEXT)");
          db.execSQL("CREATE TABLE " + TBL_PENDING_PM + "(PAGE_NUMBER TEXT, GUID TEXT, TICKET_NUMBER TEXT PRIMARY KEY, ATM_ID TEXT, BANK_NAME TEXT, CALL_DATE TEXT, LATITUDE REAL,LONGITUDE REAL, TOTAL_CALLS TEXT, TOTAL_PAGES TEXT,CALL_TYPE TEXT,PRODUCT TEXT,CONTACT_PERSON TEXT,CONTACT_NUMBER TEXT,LAST_PM_DATE TEXT,PRODUCT_CATEGORY TEXT,STAGE TEXT,ENG_CODE TEXT,ENGINEER TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_ANSWERS_OF_QUESTIONNAIRE + "(SRNO TEXT PRIMARY KEY, QUESTION_CODE TEXT,QUESTION TEXT, ANSWERS TEXT,MANDATORY_ANSWER TEXT,COMMENTS TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_QUESTIONNAIRE_CLOSE + "(ROWNO INTEGER PRIMARY KEY AUTOINCREMENT,ATMID TEXT,CALL_TYPE TEXT,SRNO TEXT, NETWORK_STATUS TEXT,VISITED_DATE TEXT,ANSWERS TEXT,LATITUDE TEXT,LONGITUDE TEXT,TRACED_USING TEXT,UNIQUE_ID TEXT)");// /db.execSQL("CREATE TABLE " + TBL_PENDING_JOBS + "(PAGE_NUMBER TEXT, GUID TEXT, TICKET_NUMBER TEXT PRIMARY KEY, CONTACT_PERSON TEXT, CUSTMER_NAME TEXT, CALL_DATE TEXT, LATITUDE REAL,LONGITUDE REAL, TOTAL_CALLS TEXT, TOTAL_PAGES TEXT,PRODUCT TEXT,CONTACT_NUMBER TEXT,SUB_STATUS TEXT)");
  
         db.execSQL("CREATE TABLE " + TBL_PENDING_JOBS + "(PAGE_NUMBER TEXT, GUID TEXT, TICKET_NUMBER TEXT PRIMARY KEY, CONTACT_PERSON TEXT, CUSTMER_NAME TEXT, CALL_DATE TEXT, LATITUDE REAL,LONGITUDE REAL,C_ACTIVITY TEXT,LOCK_ACTIVITY TEXT,CALL_ACCEPTED TEXT, TOTAL_CALLS TEXT, TOTAL_PAGES TEXT,PRODUCT TEXT,CONTACT_NUMBER TEXT,SUB_STATUS TEXT,PRODUCT_CATEGORY TEXT,STAGE TEXT,ENG_CODE TEXT,ENGINEER TEXT)");
  
          db.execSQL("CREATE TABLE " + TBL_JOB_CLOSE + "(ROWNO INTEGER PRIMARY KEY AUTOINCREMENT,SRNO TEXT,COMMENTS TEXT,ACTIVITY_DATE_TIME TEXT, LATITUDE TEXT, LONGITUDE TEXT,TRACED_USING TEXT,START_DATE TEXT,END_DATE TEXT,RESPONSE_CATEGORY TEXT,LAST_UPDATE_DATE TEXT,ACTIVITY_DATE TEXT,TIME_TAKEN TEXT,TYPE TEXT,UNIQUE_ID TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_FILE_ATTACH + "(SRNO INTEGER PRIMARY KEY AUTOINCREMENT, TICKET_NO TEXT,IMAGE_PATH TEXT, IMAGE_NAME TEXT, COMMENTS TEXT,IS_CAMERA_IMAGE TEXT, ATM_ID TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_SIGN_ATTACH + "(TICKET_NUMBER TEXT PRIMARY KEY, SIGN_LOCATION TEXT, FILE_NAME TEXT,SIGN_FILE BLOB,PERSON_NAME TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_QUESTIONNAIRE_FILE_ATTACH + "(SRNO INTEGER PRIMARY KEY AUTOINCREMENT, TICKET_NO TEXT, QUESTION_CODE TEXT, IMAGE_PATH TEXT, IMAGE_NAME TEXT, COMMENTS TEXT,IS_CAMERA_IMAGE TEXT, ATM_ID TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_IS_FILE_ATTACHED + "(TICKET_NUMBER TEXT PRIMARY KEY, IS_ATTACHED TEXT)");
          db.execSQL("CREATE TABLE " + TABLE_QUESTIONNARE_LIST + "(SRNO TEXT,QUESTION_CODE TEXT,QUESTION TEXT,ANSWERS_TYPE TEXT,MANADATORY_VALUES TEXT,DEFAULT_VALUE TEXT,QUESTION_TYPE TEXT)");
  
          db.execSQL("CREATE TABLE " + CANCEL_OR_FOLLOWUP + "(ROWNO INTEGER PRIMARY KEY AUTOINCREMENT,DOCKET_NUMBER TEXT,COMMENTS TEXT,ACTIVITY_DATE TEXT, LATITUDE TEXT, LONGITUDE TEXT,TRACED_USING TEXT, FLAG TEXT,SUB_STATUS TEXT,UNIQUE_ID TEXT)");
          db.execSQL("CREATE TABLE " + TBL_UPDATE_ORDER + "(ROWNO INTEGER PRIMARY KEY AUTOINCREMENT,UNIQUE_ID TEXT, DOCKET_NUMBER TEXT)");
          db.execSQL("CREATE TABLE " + TBL_SAVE_JOBS + "(ROWNO INTEGER PRIMARY KEY AUTOINCREMENT,USERNAME TEXT, GUID TEXT,TBL_NAME TEXT,SYNC_COUNT INTEGER,COL1 TEXT,COL2 TEXT,COL3 TEXT,COL4 TEXT,COL5 TEXT,COL6 TEXT,COL7 TEXT,COL8 TEXT,COL9 TEXT,COL10 TEXT,COL11 TEXT,COL12 TEXT,COL13 TEXT,COL14 TEXT,COL15 TEXT,COL16 TEXT,COL17 TEXT,COL18 TEXT,COL19 TEXT,COL20 TEXT,COL21 TEXT,COL22 TEXT,COL23 TEXT,COL24 TEXT,COL25 TEXT)");
  
          db.execSQL("CREATE TABLE " + TBL_REJECT_STATUS + "(KEYS TEXT, SUBVALS TEXT)");
          db.execSQL("CREATE TABLE " + TBL_MATERIAL_MASTER + "(MATERIAL_TYPE TEXT, PRODUCT_CATEGORY TEXT)");
          db.execSQL("CREATE TABLE " + TBL_CLOSURE_SUBSTATUS + "(KEYS TEXT, SUBVALS TEXT)");
      } catch (SQLiteException e){
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  @Override
  public void onUpgrade(SQLDatabase db, int oldVersion, int newVersion) {
      try {
          db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE_SYNC);
          db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE_FIELD);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_PENDING_PM);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_ANSWERS_OF_QUESTIONNAIRE);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_QUESTIONNAIRE_CLOSE);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_PENDING_JOBS);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_JOB_CLOSE);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_FILE_ATTACH);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_QUESTIONNAIRE_FILE_ATTACH);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_IS_FILE_ATTACHED);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_QUESTIONNARE_LIST);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_UPDATE_ORDER);
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_SIGN_ATTACH);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_REJECT_STATUS);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_MATERIAL_MASTER);
          db.execSQL("DROP TABLE IF EXISTS " + TBL_CLOSURE_SUBSTATUS);
          onCreate(db);
      } catch (SQLException e){
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>When I add this in library I am getting error on SQLite Database, Context, execSql, Sqlite db. I am not able to identify the error.  Pls Help.</p>