helpers/src/main/java/com/google/ar/core/codelab/cloudanchor/helpers/StorageManager.java
/** Gets a new short code that can be used to store the anchor ID. */
Gets a new short code that can be used to store the anchor ID.
Gets a new short code that can be used to store the anchor ID .
public int nextShortCode(Activity activity) {
    SharedPreferences sharedPrefs =
        activity.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);
    int shortCode = sharedPrefs.getInt(NEXT_SHORT_CODE, INITIAL_SHORT_CODE);
    sharedPrefs.edit().putInt(NEXT_SHORT_CODE, shortCode + 1).apply();
    return shortCode;
  }
public int nextShortCode ( Activity activity ) { SharedPreferences sharedPrefs = activity . getSharedPreferences ( SHARED_PREFS_NAME , Context . MODE_PRIVATE ) ; int shortCode = sharedPrefs . getInt ( NEXT_SHORT_CODE , INITIAL_SHORT_CODE ) ; sharedPrefs . edit ( ) . putInt ( NEXT_SHORT_CODE , shortCode + 1 ) . apply ( ) ; return shortCode ; }
Gets a new short code that can be used to store the anchor ID.
Gets a new short code that can be used to store the anchor ID .