The App external storage is initialized at game start for you to use, therefore Android creates an empty directory. Note: If the user uninstalls the app, the data saved here will be deleted if not copied to another location before by the user. Other apps (like file managers) can access the files up to Android 10, from Android 11 on the directory is only accessible via USB access. This directory (located at Android/data/data/your_package_id/) is readable and writable from your app without any further permission and changes.
This directory is again only accessible by that application. Each installed application has a dedicated internal storage directory. No other application on the Android system can access these files.įiles can also be stored on what the Android documentation refers to as internal storage (accessible via in LibGDX), where they are readable and writable.
it automatically resizes images.Īssets are stored in your Android project’s assets directory and will be packaged with your APK automatically when you deploy your application and are accessible via, a read-only directory not to be confused with what the Android documentation refers to as “internal”. Android manipulates them at load time, e.g.
Resources better lend themselves to normal Android applications but introduce problems when used in games. libGDX only uses the assets mechanism, as it provides raw access to the byte streams and more closely resembles a traditional filesystem. Files can be stored inside the application’s APK either as resources or as assets. On Android the situation is a little bit more complex.
Ignoring file permissions, files and directories are usually readable and writable by all applications. Files can be referenced with paths relative to the current working directory (the directory the application was executed in) or absolute paths. On a desktop OS, the filesystem is one big chunk of memory.
Here we review the filesystem paradigms of the platforms libGDX supports Desktop (Windows, Linux, Mac OS X, Headless) Libgdx’s Files (code) module provides the ability to:īefore we can dive into that aspect of Libgdx, we have to first review the different notions of filesystems for all supported platforms. Each of these platforms handles file I/O a little differently. LibGDX applications run on four different platforms: desktop systems (Windows, Linux, Mac OS X, headless), Android, iOS, and JavaScript/WebGL capable browsers. Deleting, Copying, Renaming and Moving Files/Directories.Listing and Checking Properties of Files.Checking Storage availability and paths.Adding Extensions and 3rd Party Libraries.Internationalization and Localization Utilities ModelBuilder, MeshBuilder and MeshPartBuilder.SpriteBatch, TextureRegions, and Sprites.Continuous and Non-Continuous Rendering.Querying and configuring graphics (monitors, display modes, vsync, display cutouts).