AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.util.QUtil Class Reference

Static Public Member Functions

static String getExternalStoragePath (Context context, boolean forcePrivate)
 
static String getExternalStoragePath (Context context)
 
static File getExternalStorageDir (Context context)
 
static File getExternalStorageDir (Context context, boolean forcePrivate)
 
static String getReplAssetPath (Context context, boolean forcePrivate)
 
static String getReplAssetPath (Context context)
 
static String getReplDataPath (Context context, boolean forcePrivate)
 
static String getReplDataPath (Context context)
 

Detailed Description

Utility functions to handle API changes in Android Q.

Author
ewpat.nosp@m.ton@.nosp@m.mit.e.nosp@m.du (Evan W. Patton)

Definition at line 18 of file QUtil.java.

Member Function Documentation

◆ getExternalStorageDir() [1/2]

static File com.google.appinventor.components.runtime.util.QUtil.getExternalStorageDir ( Context  context)
static

Get the SDK-specific external storage directory. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific). If the

forcePrivate

flag is true, then the app-private directory will always be returned on devices running Android 2.2 Froyo or later.

For more details on why this is needed, see the deprecation notice at https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()

Parameters
contexta context, such as a Form
Returns
the path to the app's shared storage.

Definition at line 72 of file QUtil.java.

◆ getExternalStorageDir() [2/2]

static File com.google.appinventor.components.runtime.util.QUtil.getExternalStorageDir ( Context  context,
boolean  forcePrivate 
)
static

Get the SDK-specific external storage directory. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific). If the

forcePrivate

flag is true, then the app-private directory will always be returned on devices running Android 2.2 Froyo or later.

For more details on why this is needed, see the deprecation notice at https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()

Parameters
contexta context, such as a Form
forcePrivateforce the use of the context-specific path
Returns
the path to the app's shared storage.

Definition at line 93 of file QUtil.java.

◆ getExternalStoragePath() [1/2]

static String com.google.appinventor.components.runtime.util.QUtil.getExternalStoragePath ( Context  context)
static

Get the SDK-specific external storage path. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific).

For more details on why this is needed, see the deprecation notice at https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()

Parameters
contexta context, such as a Form
Returns
the path to the app's shared storage.

Definition at line 53 of file QUtil.java.

◆ getExternalStoragePath() [2/2]

static String com.google.appinventor.components.runtime.util.QUtil.getExternalStoragePath ( Context  context,
boolean  forcePrivate 
)
static

Get the SDK-specific external storage path. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific). If the

forcePrivate

flag is true, then the app-private directory will always be returned on devices running Android 2.2 Froyo or later.

For more details on why this is needed, see the deprecation notice at https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()

Parameters
contexta context, such as a Form
forcePrivateforce the use of the context-specific path
Returns
the path to the app's shared storage.

Definition at line 36 of file QUtil.java.

◆ getReplAssetPath() [1/2]

static String com.google.appinventor.components.runtime.util.QUtil.getReplAssetPath ( Context  context)
static

Get the SDK-specific path to where the REPL assets live. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific).

For more details on why this is needed, see the deprecation notice at https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()

Parameters
contexta context, such as a Form
Returns
the path to the REPL's asset storage

Definition at line 143 of file QUtil.java.

◆ getReplAssetPath() [2/2]

static String com.google.appinventor.components.runtime.util.QUtil.getReplAssetPath ( Context  context,
boolean  forcePrivate 
)
static

Get the SDK-specific path to where the REPL assets live. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific). If the

forcePrivate

flag is true, then the app-private directory will always be returned on devices running Android 2.2 Froyo or later.

For more details on why this is needed, see the deprecation notice at https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory()

Parameters
contexta context, such as a Form
forcePrivateforce the use of the context-specific path
Returns
the path to the REPL's asset storage

Definition at line 122 of file QUtil.java.

◆ getReplDataPath() [1/2]

static String com.google.appinventor.components.runtime.util.QUtil.getReplDataPath ( Context  context)
static

Get the SDK-specific path to where the REPL data live. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific).

Parameters
contexta context, such as a Form
Returns
the path to the REPL's data storage

Definition at line 174 of file QUtil.java.

◆ getReplDataPath() [2/2]

static String com.google.appinventor.components.runtime.util.QUtil.getReplDataPath ( Context  context,
boolean  forcePrivate 
)
static

Get the SDK-specific path to where the REPL data live. On Android Q and later, this is always an app-private directory on the "external" storage. On earlier versions of Android, this returns the external storage path for all apps (although possibly user-specific). If the

forcePrivate

flag is true, then the app-private directory will always be returned on devices running Android 2.2 Froyo or later.

Parameters
contexta context, such as a Form
forcePrivateforce the use of the context-specific path
Returns
the path to the REPL's data storage

Definition at line 158 of file QUtil.java.


The documentation for this class was generated from the following file: