There is a simpler way to get the application data directory with min API 4+. From any Context (e.g. Activity, Application):
getApplicationInfo().dataDir
http://developer.android.com/reference/android/content/Context.html#getApplicationInfo()
More Related Contents:
- How to programmatically move, copy and delete files and directories on SD?
- Android: How to open a specific folder via Intent and show its content in a file browser?
- How to delete a whole folder and content?
- Creating a directory in /sdcard fails
- How can I get the size of a folder on SD card in Android?
- how to create a folder in android External Storage Directory?
- How can I display images from a specific folder on android gallery
- Checking if an Android application is running in the background
- How to send Device to device notification by using FCM without using XMPP or any other script.?
- Android: Proper Way to use onBackPressed() with Toast
- Android – zoom in/out RelativeLayout with spread/pinch
- Scale Image to fill ImageView width and keep aspect ratio
- How can I enable disable GPS programmatically in Android? [duplicate]
- Send data back to the script which started the activity via adb shell am start
- ProGuard: can’t find referenced class com.google.android.gms.R
- Marquee Set Speed
- Android Manifest Restrict To Tablets
- Importing Module in Android Studio
- Generate bitmap from HTML in Android
- ListView items are not clickable. why?
- Android – getting from a Uri to an InputStream to a byte array?
- Is there a way to have 1 Firebase database for 2 apps with different package names?
- What are the Android SDK build-tools, platform-tools and tools? And which version should be used?
- What is the correct way to specify dimensions in DIP from Java code?
- Firestore – get the parent document of a subcollection
- Set default page for ViewPager in Android
- How to read USSD messages in android? [closed]
- Why the background of ProgressDialog doesn’t set to the transparent?
- Android Linkify both web and @mentions all in the same TextView
- How to add days into the date in android