Samuel Moshie
Samuel Moshie

Reputation: 570

How to get currently installed location of APK

I am developing an application that I need to log to the server the memory location that the application currently resides ie: Internal memory or External storage. Any idea on how to accomplish this?

Upvotes: 1

Views: 347

Answers (1)

Arnav M.
Arnav M.

Reputation: 2609

Use the following code to get your application's APK directory-

ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0);
        String installDir =appInfo.sourceDir;

Upvotes: 1

Related Questions