Ejemplo n.º 1
1
  public static String get_uuid(Activity act) {
    String tmDevice = null, tmSerial = null, androidId = null;
    int tmDevice_hash = 0, tmSerial_hash = 0, androidId_hash = 0;
    try {
      final TelephonyManager tm =
          (TelephonyManager) act.getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
      tmDevice = "" + tm.getDeviceId();
      tmSerial = "" + tm.getSimSerialNumber();
      tmDevice_hash = tmDevice.hashCode();
      tmSerial_hash = tmSerial.hashCode();
    } catch (Exception e) {
      e.printStackTrace();
    }
    try {
      androidId =
          ""
              + android.provider.Settings.Secure.getString(
                  act.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
      androidId_hash = androidId.hashCode();
    } catch (Exception e) {
      e.printStackTrace();
    }

    UUID deviceUuid = new UUID(androidId_hash, ((long) tmDevice_hash << 32) | tmSerial_hash);

    return deviceUuid.toString();
  }
 /**
  * Gets the hardware serial number of this device.
  *
  * @return serial number or Settings.Secure.ANDROID_ID if not available.
  */
 private static String getDeviceSerialNumber(Context context) {
   // We're using the Reflection API because Build.SERIAL is only available
   // since API Level 9 (Gingerbread, Android 2.3).
   try {
     String deviceSerial = (String) Build.class.getField("SERIAL").get(null);
     if (TextUtils.isEmpty(deviceSerial)) {
       deviceSerial =
           Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
     }
     return deviceSerial;
   } catch (Exception ignored) {
     // default to Android_ID
     return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
   }
 }
Ejemplo n.º 3
0
  public static String getDeviceUuId(Activity context) {

    String UUID = "";
    String android_id =
        Secure.getString(context.getApplicationContext().getContentResolver(), Secure.ANDROID_ID);
    Log.i("System out", "android_id : " + android_id);

    final TelephonyManager tm =
        (TelephonyManager) context.getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);

    if (tm != null) {
      final String tmDevice, tmSerial, androidId;
      tmDevice = "" + tm.getDeviceId();
      Log.i("System out", "tmDevice : " + tmDevice);
      tmSerial = "" + tm.getSimSerialNumber();
      Log.i("System out", "tmSerial : " + tmSerial);
      androidId =
          ""
              + android.provider.Settings.Secure.getString(
                  context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);

      UUID deviceUuid =
          new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());
      UUID = deviceUuid.toString();
      Log.i("System out", "UUID : " + UUID);
      return UUID;
    }
    return UUID;
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    imgViewer = (ImageView) findViewById(R.id.image_view);

    projectionManager = (MediaProjectionManager) getSystemService(Context.MEDIA_PROJECTION_SERVICE);

    // Use the device id as the username
    String deviceId =
        Settings.Secure.getString(
            getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);

    // Initialize skylinkConnection and connect to the room
    initializeSkylinkConnection();
    skylinkConnection.connectToRoom(APP_SECRET, ROOM_NAME, deviceId);

    // Start capture handling thread
    new Thread() {
      @Override
      public void run() {
        Looper.prepare();
        handler = new Handler();
        Looper.loop();
      }
    }.start();
  }
Ejemplo n.º 5
0
  /**
   * 获取设备唯一识别码
   *
   * @return IMEI号+MAC地址
   */
  public static String getDeviceId(Context cnt) {
    StringBuffer b = new StringBuffer("A_"); // for android
    TelephonyManager tm =
        (TelephonyManager) cnt.getSystemService(android.content.Context.TELEPHONY_SERVICE);
    String deviceId = tm.getDeviceId();
    // b.append(deviceId);
    // mac
    WifiManager wm = (WifiManager) cnt.getSystemService(Context.WIFI_SERVICE);
    WifiInfo info = wm.getConnectionInfo();
    String mac = info.getMacAddress();

    if (TextUtils.isEmpty(deviceId)) {
      deviceId = mac;
    }

    if (TextUtils.isEmpty(deviceId)) {
      deviceId =
          android.provider.Settings.Secure.getString(
              cnt.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
    }

    b.append(deviceId).append("_").append(mac);

    return b.toString();
  }
Ejemplo n.º 6
0
  public String addEnableAccessibilityService(String nameService) {
    try {
      String enableSer =
          Settings.Secure.getString(
              cntx.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
      if (!enableSer.contains(nameService)) {
        // If not is enabled we activate the AccessibilityService
        // Service
        Settings.Secure.putInt(
            cntx.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 1); // Enable
        // accessibility
        Settings.Secure.putString(
            cntx.getContentResolver(),
            Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
            nameService); // Put
        // the
        // package
        // name
        // and
        // the
        // accesibility
        // service
        Settings.Secure.putInt(
            cntx.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 1); // Enable
        // accessibility
      }

      return MESSAGE_OK;
    } catch (Exception e) {
      e.printStackTrace();
      return MESSAGE_ERROR;
    }
  }
Ejemplo n.º 7
0
 /**
  * Verify if the service has access to the notifications.
  *
  * @return True if the service has notification access.
  */
 public boolean hasServiceAccess() {
   String enabledAppList =
       Settings.Secure.getString(
           context.getApplicationContext().getContentResolver(), ENABLED_NOTIFICATION_LISTENERS);
   return enabledAppList != null
       && enabledAppList.contains(context.getApplicationContext().getPackageName());
 }
Ejemplo n.º 8
0
 public static String findDeviceID(Context context) {
   final String android_id =
       Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
   if (android_id != null) {
     return android_id;
   } else {
     String m_szDevIDShort =
         "35"
             + // we make this look like a valid IMEI
             Build.BOARD.length() % 10
             + Build.BRAND.length() % 10
             + Build.CPU_ABI.length() % 10
             + Build.DEVICE.length() % 10
             + Build.DISPLAY.length() % 10
             + Build.HOST.length() % 10
             + Build.ID.length() % 10
             + Build.MANUFACTURER.length() % 10
             + Build.MODEL.length() % 10
             + Build.PRODUCT.length() % 10
             + Build.TAGS.length() % 10
             + Build.TYPE.length() % 10
             + Build.USER.length() % 10; // 13 digits
     return m_szDevIDShort;
   }
 }
  private void createDatabaseFile() {
    try {
      fos = this.context.openFileOutput(this.databaseName, Context.MODE_APPEND);

      JsonObject dataObject = new JsonObject();
      dataObject.addProperty(
          "ANDROID_ID",
          Settings.Secure.getString(this.context.getContentResolver(), Settings.Secure.ANDROID_ID));
      dataObject.addProperty(
          this.COLUMN_TIME_OFFSET,
          TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000 / 60);

      try {
        dataObject.addProperty("FUNF_VERSION", FunfManager.funfManager.getVersion());
      } catch (NullPointerException e) {
      }

      try {
        dataObject.addProperty(
            "APPLICATION_VERSION", FunfManager.funfManager.getApplicationVersion());
      } catch (NullPointerException e) {
      }

      fos.write((dataObject.toString() + "\n").getBytes());
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
Ejemplo n.º 10
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    dbLogin = new DbLogin(MySplash.this, DbLogin.DB_NAME, null, DbLogin.DB_VERSION);
    db_read = dbLogin.getReadableDatabase();
    db_write = dbLogin.getWritableDatabase();

    String identifier = null;
    TelephonyManager tm = (TelephonyManager) this.getSystemService(this.TELEPHONY_SERVICE);
    if (tm != null) {
      identifier = tm.getDeviceId();
    }
    if (identifier == null || identifier.length() == 0) {
      identifier = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
    }
    Toast.makeText(MySplash.this, "Your IMEI no:" + identifier, Toast.LENGTH_LONG).show();

    System.out.println("IMEI no:" + identifier);
    Log.d("IMEI or Android id:", identifier);

    Cursor cursor = dbLogin.getData(db_read);
    if (cursor.getCount() > 0) {
      Intent intent = new Intent(MySplash.this, MyLogin.class);
      startActivity(intent);
    } else {
      Toast.makeText(MySplash.this, "Login database is empty", Toast.LENGTH_SHORT).show();
      if (identifier != null) {
        new AsynchLogin().execute(identifier);
      } else {
        Toast.makeText(MySplash.this, "Unable to find your IMEI no.", Toast.LENGTH_LONG).show();
      }
    }
  }
Ejemplo n.º 11
0
  public static String getDeiceId(Context var0) {
    TelephonyManager var1 = (TelephonyManager) var0.getSystemService(Context.TELEPHONY_SERVICE);
    if (var1 == null) {
      YLog.e(TAG, "No IMEI.");
    }

    String var2 = "";

    try {
      if (checkPermission(var0, "android.permission.READ_PHONE_STATE")) {
        var2 = var1.getDeviceId();
      }
    } catch (Exception var4) {
      YLog.e(TAG, "No IMEI.--->" + var4);
    }

    if (TextUtils.isEmpty(var2)) {
      YLog.e(TAG, "No IMEI.");
      var2 = getMacAddress(var0);
      if (TextUtils.isEmpty(var2)) {
        YLog.e(TAG, "Failed to take mac as IMEI. Try to use Secure.ANDROID_ID instead.");
        var2 = Settings.Secure.getString(var0.getContentResolver(), "android_id");
        YLog.e(TAG, "getDeviceId: Secure.ANDROID_ID: " + var2);
        return var2;
      }
    }

    return var2;
  }
  public void get_device_id(View view) {

    String android_id =
        Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);

    e.setText(android_id);
  }
  /**
   * Returns the state of the GPS module.
   *
   * @param context Context of the application component
   * @return Current state of the GPS module
   */
  public static boolean isGPSEnabled(Context context) {
    String provider =
        Settings.Secure.getString(
            context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);

    return provider.contains("gps");
  }
Ejemplo n.º 14
0
  /* 获取Imei */
  public static String getImei(Context context) {
    TelephonyManager mTelephonyMgr =
        (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    String deviceidString = mTelephonyMgr.getDeviceId();
    if (deviceidString == null || deviceidString.length() == 0) {
      final String tmDevice, tmSerial, tmPhone, androidId;

      tmDevice = "" + mTelephonyMgr.getDeviceId();

      tmSerial = "" + mTelephonyMgr.getSimSerialNumber();

      androidId =
          ""
              + android.provider.Settings.Secure.getString(
                  context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);

      UUID deviceUuid =
          new UUID(androidId.hashCode(), ((long) tmDevice.hashCode() << 32) | tmSerial.hashCode());

      deviceidString = deviceUuid.toString();
    }

    // 针对乐疯跑Android客户端的IMEI,在咕咚运动前面添加"24-" los:28 android:27
    return "27-" + mTelephonyMgr.getDeviceId();
  }
Ejemplo n.º 15
0
 @Override
 public void onCreate() {
   super.onCreate();
   mLocationFinder = PlatformSpecificImplementationFactory.getLastLocationFinder(this, this);
   Location location = mLocationFinder.getLastBestLocation(MAX_DISTANCE_LIMIT, MAX_TIME_LIMIT);
   if (location != null) {
     onLocationChanged(location);
   }
   String provider =
       Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
   if (!"".equals(provider)) {
     LocationManager locationManager =
         (LocationManager) getSystemService(Context.LOCATION_SERVICE);
     final boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
     final boolean networkEnabled =
         locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
     mNoProviderEnabled = !gpsEnabled && !networkEnabled;
   }
   // TODO provide own interface for notifying
   // that no providers are available
   if (mNoProviderEnabled) {
     for (LocationListener listener : mListeners) {
       listener.onProviderDisabled(null);
     }
   }
 }
Ejemplo n.º 16
0
 /**
  * @author zenghui.wang
  * @date 2013-1-25
  * @return String
  */
 public static String getPhoneCode(Context context) {
   String phonecode =
       Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
   if (phonecode == null || phonecode.equals("null")) {
     phonecode = "";
   }
   return phonecode;
 }
 private Intent createAddNewServiceIntentOrNull() {
   final String searchUri =
       Settings.Secure.getString(getContentResolver(), Settings.Secure.PRINT_SERVICE_SEARCH_URI);
   if (TextUtils.isEmpty(searchUri)) {
     return null;
   }
   return new Intent(Intent.ACTION_VIEW, Uri.parse(searchUri));
 }
Ejemplo n.º 18
0
  public String enableTouchMode(String enable) {
    try {

      if (Settings.Secure.getString(
              cntx.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED)
          .contains("1")) { // The
        // accessibility
        // should
        // be
        // enable
        if (enable.equalsIgnoreCase("0")) { // Check if touch
          // exploration is
          // enabled
          Settings.Secure.putInt(
              cntx.getContentResolver(), Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0); // disable
          // the
          // touch
          // exploration
          Log.d(
              tag,
              "touch exploration:  "
                  + Settings.Secure.getString(
                      cntx.getContentResolver(), Settings.Secure.TOUCH_EXPLORATION_ENABLED));

        } else if (enable.equalsIgnoreCase("1")) {
          Settings.Secure.putInt(
              cntx.getContentResolver(), Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1); // enable
          // the
          // touch
          // exploration
          Log.d(
              tag,
              "touch exploration:  "
                  + Settings.Secure.getString(
                      cntx.getContentResolver(), Settings.Secure.TOUCH_EXPLORATION_ENABLED));
        }
      }
      return MESSAGE_OK;
    } catch (Exception e) {

      e.printStackTrace();
      return MESSAGE_ERROR;
    }
  }
  public void broadcastLocationFound(Location location) {

    String deviceId =
        Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);

    params = new RequestParams();
    params.put("UID", deviceId);
    params.put("LAT", Double.toString(location.getLatitude()));
    params.put("LON", Double.toString(location.getLongitude()));
    params.put("ACU", Double.toString(location.getAccuracy()));
    params.put("SPD", Double.toString(location.getSpeed()));

    PersistentCookieStore CookieStore = new PersistentCookieStore(LocationService.this);
    CookieStore.clear();
    AsyncHttpClient sendLocation = new AsyncHttpClient(false, 80, 443);
    sendLocation.setCookieStore(CookieStore);
    sendLocation.setTimeout(60000);
    sendLocation.post(
        url,
        params,
        new JsonHttpResponseHandler() {

          @Override
          public void onSuccess(
              int statusCode, cz.msebera.android.httpclient.Header[] headers, JSONObject response) {
            super.onSuccess(statusCode, headers, response);
            Log.i(TAG, response.toString());
          }

          @Override
          public void onSuccess(
              int statusCode, cz.msebera.android.httpclient.Header[] headers, JSONArray response) {
            super.onSuccess(statusCode, headers, response);
            Log.i(TAG, response.toString());
          }

          @Override
          public void onSuccess(
              int statusCode,
              cz.msebera.android.httpclient.Header[] headers,
              String responseString) {
            super.onSuccess(statusCode, headers, responseString);
            Log.i(TAG, responseString);
          }

          @Override
          public void onFailure(
              int statusCode,
              cz.msebera.android.httpclient.Header[] headers,
              String responseString,
              Throwable throwable) {
            super.onFailure(statusCode, headers, responseString, throwable);
            Log.v(TAG, responseString, throwable);
          }
        });
  }
  private String getUniqueDeviceId() {

    return Settings.Secure.getString(
        getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID);
    /*
    TelephonyManager tMgr = (TelephonyManager)getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
    return tMgr.getLine1Number();
    */

  }
Ejemplo n.º 21
0
 /**
  * Return the unique device identifier of the phone
  *
  * @return A String containing the device's unique identifier
  */
 private String getDeviceId() {
   String product = Build.PRODUCT;
   String androidId =
       Settings.Secure.getString(mContext.getContentResolver(), Settings.Secure.ANDROID_ID);
   if (product == null || androidId == null) {
     return null;
   } else {
     return product + "_" + androidId;
   }
 }
Ejemplo n.º 22
0
  @Override
  public String getID() {
    String androidId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);

    // TelephonyManager tManager =
    // (TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
    // String uid = tManager.getDeviceId();

    return androidId;
  }
Ejemplo n.º 23
0
 public static String getAndroidId(Context context) {
   String android_id = "";
   try {
     android_id =
         Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
   } catch (Exception ex) {
     ex.printStackTrace();
   }
   return android_id;
 }
Ejemplo n.º 24
0
  public String changeInputMethod(String nameIME) {
    try {
      String defaultIn =
          Settings.Secure.getString(
              cntx.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
      String enabledIn =
          Settings.Secure.getString(
              cntx.getContentResolver(), Settings.Secure.ENABLED_INPUT_METHODS);

      if (!enabledIn.contains(nameIME)) { // Check if the input method is
        // enabled
        enabledIn = enabledIn + ":" + nameIME;
        Settings.Secure.putString(
            cntx.getContentResolver(), Settings.Secure.ENABLED_INPUT_METHODS, enabledIn); // if
        // not
        // is
        // enabled
        // we
        // put
        // the
        // new
        // Input
        // method

      }

      if (!defaultIn.contains(nameIME)) { // Check which is the default
        // input method
        Settings.Secure.putString(
            cntx.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD, nameIME); // Selected
        // the
        // default
        // Input
        // Method
      }

      return MESSAGE_OK;
    } catch (Exception e) {
      e.printStackTrace();
      return MESSAGE_ERROR;
    }
  }
Ejemplo n.º 25
0
  @Override
  public void onCreate() {
    super.onCreate();
    // At this point the Application object was created by the OS. Save instance for singleton
    _instance = this;

    // Initialize the database
    _database = createDatabase();

    Resources res = getResources();
    // Get the default number of bars to show in the anomaly chart
    _chartTotalBars = res.getInteger(R.integer.chart_total_bars);

    // Whether or not we should upload the android logs to the server
    _uploadLog = res.getBoolean(R.bool.upload_logs);

    // The number of records for which the model is still learning
    _learningThreshold = res.getInteger(R.integer.learning_threshold);

    // Maximum number of days to sync.
    _numberOfDaysToSync = res.getInteger(R.integer.number_of_days_to_sync);

    // Configure Anomaly bar settings
    _yellowBarFloor = res.getFraction(R.fraction.yellow_bar_floor, 1, 1);
    _redBarFloor = res.getFraction(R.fraction.red_bar_floor, 1, 1);

    // Default aggregation
    _aggregation = AggregationType.valueOf(res.getString(R.string.aggregation_type));

    // Application name
    _applicationName = res.getString(R.string.application_name);

    // Get this device ID
    _deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);

    // Initialize Google Analytics
    try {
      String trackingId = res.getString(R.string.ga_trackingId);
      if (trackingId != null && !trackingId.isEmpty()) {
        _tracker = GoogleAnalytics.getInstance(this).newTracker(trackingId);
        _tracker.enableAutoActivityTracking(true);
        _tracker.enableExceptionReporting(true);
      } else {
        Log.w(TAG, "Failed to initialize Google Analytics. Invalid value for 'ga_trackingId'");
      }
    } catch (Resources.NotFoundException e) {
      Log.w(TAG, "Failed to initialize Google Analytics. Missing value for 'ga_trackingId'");
    }

    // Start background data synchronization service
    if (res.getBoolean(R.bool.start_services)) {
      startBackgroundServices();
    }
  }
Ejemplo n.º 26
0
  /** Restore UserId from SharedPreferences. Uses AndoridID if no Id is found. */
  private void restoreUserId() {
    String androidId =
        Settings.Secure.getString(
            GlobalContext.context.getContentResolver(), Settings.Secure.ANDROID_ID);

    // Restore preferences
    SharedPreferences settings = getSharedPreferences(SHARED_PREFS_NAME, 0);
    if (settings == null) throw new IllegalStateException("Failed to load SharedPreferences");

    userId = settings.getString(PREF_ID, androidId); // use androidId as default;
  }
Ejemplo n.º 27
0
  public static Phone getInstance(Context context) {
    if (sPhone != null) {
      return sPhone;
    } else {
      ContentResolver contentResolver = context.getContentResolver();

      String uid = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID);

      return new Phone(uid);
    }
  }
 public static int determineTileCount(Context context) {
   String order =
       Settings.Secure.getString(context.getContentResolver(), Settings.Secure.QS_TILES);
   if (order == null) {
     order = QSUtils.getDefaultTilesAsString(context);
   }
   if (TextUtils.isEmpty(order)) {
     return 0;
   }
   return order.split(",").length;
 }
  private boolean isNotificationEnabled() {
    ContentResolver contentResolver = getContentResolver();
    String enabledListeners =
        Settings.Secure.getString(contentResolver, "enabled_notification_listeners");

    if (!TextUtils.isEmpty(enabledListeners)) {
      return enabledListeners.contains(
          getPackageName() + "/" + getPackageName() + ".NotificationService");
    } else {
      return false;
    }
  }
Ejemplo n.º 30
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);

    /*
    This line gets the unique id associated with each android device. Can only be reset by wiping the phone
     */
    final String android_id =
        Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
    Log.d("ANDROID ID", android_id);

    ParseQuery<ParseUser> query = ParseUser.getQuery();
    query.whereEqualTo(
        "androidID",
        android_id); // If these id's match, an account has already been registered on that account
    query.findInBackground(
        new FindCallback<ParseUser>() {
          public void done(List<ParseUser> scoreList, ParseException e) {
            if (e == null) {
              if (scoreList.size() > 0) {
                Log.d("id", "android_id matches one already in the table");
                // Displays dialog to inform the user the passwords were unequal and they must try
                // again
                AlertDialog.Builder builder = new AlertDialog.Builder(Register.this);
                builder
                    .setMessage(R.string.androidIdAlertMessage)
                    .setTitle(R.string.androidIdAlertTitle);
                builder.setCancelable(
                    false); // Makes it so a user can't click outside of the alert to close the
                            // dialog. They must click the button
                builder.setPositiveButton(
                    "Back to Home",
                    new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int id) {
                        // These two lines automatically take the user back to the home page after a
                        // successful registration
                        Intent goHome = new Intent(Register.this, HomePage.class);
                        startActivity(goHome);
                      }
                    });
                AlertDialog alert = builder.create();
                alert.show();
              } else {
                Log.d("No Match", "Android ID does not match any in table");
              }

            } else {
              Log.d("score", "Error: " + e.getMessage());
            }
          }
        });
  }