Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Context is not necessary when only using ExternalStorage #41

Open
drakeet opened this issue Oct 3, 2017 · 3 comments
Open

Context is not necessary when only using ExternalStorage #41

drakeet opened this issue Oct 3, 2017 · 3 comments

Comments

@drakeet
Copy link

drakeet commented Oct 3, 2017

I used this library v1.2.1 in my App Pure Writer. It is great!

I turn to v2.1.0 today, and I found Context is not necessary when only using Storage.getExternalStorageDirectory(). It may be better and convenient that move the Context parameter to getInternalFilesDirectory() and getInternalCacheDirectory() which truly need the Context, and supply a Storage() constructor. How about it?

Thanks!

@krokofant
Copy link

krokofant commented Nov 26, 2017

How would it be better and convenient? I think keeping all the methods on an Storage instance is much cleaner. The only method I see being static now in Storage is the isExternalWritable.

If you're going to need Storage you'd need to create an instance of Storage. If you're not going to create an instance of it and only need the getExternalStorageDirectory method you could just call getExternalStorageDirectory on android.os.Environment yourself.

@drakeet
Copy link
Author

drakeet commented Nov 26, 2017

@krokofant I need Storage to read and modify files not only get external storage dir, but for external storage we not need Context at all.

@krokofant
Copy link

@drakeet I see what you mean now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants