https://github.com/jerson/react-native-storage-util
info about free space and external devices, only for **Android**
https://github.com/jerson/react-native-storage-util
Last synced: 6 months ago
JSON representation
info about free space and external devices, only for **Android**
- Host: GitHub
- URL: https://github.com/jerson/react-native-storage-util
- Owner: jerson
- Created: 2018-06-16T20:05:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-23T22:03:56.000Z (over 7 years ago)
- Last Synced: 2025-07-08T19:57:57.916Z (6 months ago)
- Language: Java
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-storage-util
info about free space and external devices, only for **Android**
## Getting started
`$ npm install react-native-storage-util --save`
### Mostly automatic installation
`$ react-native link react-native-storage-util`
### Manual installation
#### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import me.jerson.mobile.storage.RNStorageUtilPackage;` to the imports at the top of the file
- Add `new RNStorageUtilPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-storage-util'
project(':react-native-storage-util').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-storage-util/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-storage-util')
```
## Usage
```javascript
import StorageUtil from 'react-native-storage-util';
StorageUtil.getAll();
StorageUtil.getLocations();
StorageUtil.getFreeSpace(path);
StorageUtil.getTotalSpace(path);
```