Share via


Context.GetDatabasePath(String) Method

Definition

Returns the absolute path on the filesystem where a database created with #openOrCreateDatabase is stored.

[Android.Runtime.Register("getDatabasePath", "(Ljava/lang/String;)Ljava/io/File;", "GetGetDatabasePath_Ljava_lang_String_Handler")]
public abstract Java.IO.File? GetDatabasePath (string? name);
[<Android.Runtime.Register("getDatabasePath", "(Ljava/lang/String;)Ljava/io/File;", "GetGetDatabasePath_Ljava_lang_String_Handler")>]
abstract member GetDatabasePath : string -> Java.IO.File

Parameters

name
String

The name of the database for which you would like to get its path.

Returns

An absolute path to the given database.

Attributes

Remarks

Returns the absolute path on the filesystem where a database created with #openOrCreateDatabase is stored.

The returned path may change over time if the calling app is moved to an adopted storage device, so only relative paths should be persisted.

Java documentation for android.content.Context.getDatabasePath(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.Content.Context.OpenOrCreateDatabase(System.String%2c+Android.Content.FileCreationMode%2c+Android.Content.FileCreationMode)>