How can I get my Android device Internal Download Folder path? [duplicate]

If a device has an SD card, you use: Environment.getExternalStorageState() If you don’t have an SD card, you use: Environment.getDataDirectory() If there is no SD card, you can create your own directory on the device locally. //if there is no SD card, create new directory objects to make directory on device if (Environment.getExternalStorageState() == null) … Read more

How to Get True Size of MySQL Database?

From S. Prakash, found at the MySQL forum: SELECT table_schema “database name”, sum( data_length + index_length ) / 1024 / 1024 “database size in MB”, sum( data_free )/ 1024 / 1024 “free space in MB” FROM information_schema.TABLES GROUP BY table_schema; Or in a single line for easier copy-pasting: SELECT table_schema “database name”, sum( data_length + … Read more

Read video stored on android native storage in my Ionic app

I’ve been searching for a solution. I resolve this issue as follows. After platform.ready() function I created a directory as follows. this.file.createDir(this.file.externalDataDirectory , ‘Videos’, false).then(() => { // console.log(‘Directory created successfully’); }).catch(() => { // console.log(‘Failed to create directory’); }); To download videos inside the created directory import { FileTransfer, FileTransferObject } from ‘@ionic-native/file-transfer’; import … Read more

How to store persistent data client side

You can use the Web Storage API (Window.localStorage or Window.sessionStorage). Check out this article on html5doctor for a more in-depth explanation. The Web Storage API is supported by all modern browsers at this point. The read-only localStorage property allows you to access a Storage object for the Document’s origin; the stored data is saved across … Read more

How to find the amount of free storage (disk space) left on Android? [duplicate]

Example: Getting human readable size like 1 Gb String memory = bytesToHuman(totalMemory()) /************************************************************************************************* Returns size in bytes. If you need calculate external memory, change this: StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); to this: StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath()); **************************************************************************************************/ public long totalMemory() { StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); long total = (statFs.getBlockCount() * statFs.getBlockSize()); return total; … Read more

is there a maximum size to android internal storage allocated for an app?

If you use Environment.getExternalStorageDirectory() (or Context.getExternalFilesDir() for API level 8 and up) as the place for your json file, then I believe the size will be limited by the available space in the external storage (usually an SD card). For most devices, I believe there are no fixed limits built into Android for external file … Read more