Umer Pasha Blogs

www.umerpasha.com

Listing installed APKs in an Android system

on August 1, 2012

Following code lists all the APKs installed in the Android System. I have checked this with ICS 4.0.1 and works fine. Pre-installed applications are in /system/app folder. User installed applications are in /data/app. Though this mostly works, user installed applications will probably only show up if you have a rooted device.



________________________________________________________
 public class Testing extends Activity {
    private static final String TAG = "TEST";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        File appsDir = new File("/data/app");

        String[] files = appsDir.list();

        for (int i = 0 ; i < files.length ; i++ ) {
            Log.d(TAG, "File: "+files[i]);

        }
    }

________________________________________________________
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: