Пример #1
0
 public static void addDataToLocalDatabase(
     Context context, ArrayList<Users> usersArrayList, String table) {
   for (int i = 0; i < usersArrayList.size(); i++) {
     sQliteHandlerClass.addUser(usersArrayList.get(i), table);
     Log.d("DATABASE", "Table:" + table + "\n" + usersArrayList.get(i).toString());
   }
   sQliteHandlerClass.close();
 }
Пример #2
0
 public static void updateLocalDatabase(String filename, String username) {
   ContentValues cv = new ContentValues();
   cv.put(
       "personal_photo",
       filename); // These Fields should be your String values of actual column names
   SQLiteDatabase db = sQliteHandlerClass.getWritableDatabase();
   db.update(
       sQliteHandlerClass.TABLE_FRIENDS, cv, "username " + "= " + "'" + username + "'", null);
 }
Пример #3
0
 public static Users getUser(String username, String table) {
   Users tmp = null;
   try {
     tmp = sQliteHandlerClass.getUsers(username, table);
   } catch (NullPointerException e) {
     e.printStackTrace();
   }
   return tmp;
 }
Пример #4
0
 public static ArrayList<Users> getUsersFromLocalDatabase(Context context, String TABLE) {
   ArrayList<Users> arrayListToReturn = null;
   return arrayListToReturn = sQliteHandlerClass.getAllUsers(TABLE);
 }
Пример #5
0
 public static boolean removeUser(String username) {
   return sQliteHandlerClass.removeUser(username);
 }