Oldes
Oldes

Reputation: 989

Environment.getExternalStorageDirectory() deprecation and OBB file location

I was using now deprecated Environment.getExternalStorageDirectory() to get expansion (OBB) files location, which I constructed like:

Environment.getExternalStorageDirectory() + "/Android/obb/" + packageName + "/"

with result like:

/storage/emulated/0/Android/obb/com.app.ID/

How am I supposed to get such a location now? If I use getExternalFilesDir(), I will end with location like:

/storage/emulated/0/Android/data/com.app.ID/files

Am I supposed to store OBB files there instead of the original OBB location, use some sort of relative path or what? Am I only one who must deal with expansion files and care that these must be downloaded if user deletes them?

This never ending Android API deprecation with need to target the latest API makes me crazy:/

Upvotes: 0

Views: 285

Answers (1)

You should use getContext().getObbDir() Read this

Upvotes: 1

Related Questions