Skip to content

Scope Storage Utility library will help manage your image and file from the Private and Shared storage location and also it handle the Android Scope Storage Policy.

Notifications You must be signed in to change notification settings

jiwomdf/Scope-Storage-Utility

Repository files navigation

Scope Storage Utility

Welcome to Scope Storage Utility Library
This library will help manage your image and file from the Private and Shared storage location and also it handle the Android Scope Storage Policy.

So now you dont have to worry anymore about the struggle of managing file in private or shared storage in different sdk

the benefit of this library are

  1. Easy to use ✅
  2. Provide shared and private storage file management and also handle the scope storage policy
    as now for the android API 30+ there is a new rule of saving data to shared storage
  3. Provide synchronous & asynchronous solution ✅
  4. Safe from throwing an error
    the error can be trace by search the logcat of "ScopeStorageUtility"
  5. For more detail info, see the full doc here Full Documentation Link

Flowchart How it Works

Bitmap File
save bitmap (private & shared) load outstream for file creation (private & shared)
delete bitmap (private & shared) delete file (private & shared)
load bitmap (private & shared) get public file URI (shared)
get public file URI (shared)

How to download the lib

Add jitpack package repository in your root build.gradle at the allprojects inside repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the dependency

	dependencies {
		...
		implementation 'com.github.jiwomdf:Scope-Storage-Utility:VERSION'
	}

Prerequirement

Please include this permission in your application

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 

For android Tiramisu use READ_MEDIA_IMAGES instead of READ_EXTERNAL_STORAGE

Quick view how to use the lib

This is the example of load png file in shared storage, it already handle loading png using Media Query API for scope storage device and using the Environment for non scope storage device

    manage(this)
        .isShareStorage(true)
        .attribute(
            UtilityModel(
            	fileName = "test",
            	directory = "folder/subfolder/",
            	env = Environment.DIRECTORY_DCIM,
            	extension = Extension.get(Extension.PNG)
            )
        )
        .load({ bitmap ->
            //success
        },{
            //failed
        })

Full Documentation of The Library Can Be Found Here👋

➡️ Full Documentation Link ⬅️


Feel free to see and contribute

About

Scope Storage Utility library will help manage your image and file from the Private and Shared storage location and also it handle the Android Scope Storage Policy.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published