Esempio n. 1
0
 public static File getDefaultDownloadPath(String filename) {
   File dir = new File(SafeSlingerPrefs.getDownloadDir());
   if (!dir.isDirectory()) {
     dir.mkdirs(); // make directory
   }
   return new File(dir, filename);
 }
Esempio n. 2
0
  public static int getTotalUsers() {
    String userName;
    long keyDate;
    int userNumber = 0;
    do {
      userName = null;
      keyDate = 0;
      userName = SafeSlingerPrefs.getContactName(userNumber);
      keyDate = SafeSlingerPrefs.getKeyDate(userNumber);
      if (!TextUtils.isEmpty(userName)) {
        userNumber++;
      }
    } while (keyDate > 0);

    // always at least 1
    return userNumber > 1 ? userNumber : 1;
  }