Where does Android store the default application settings that connects each type of content with a designated application? I mean which application open each kind of file or content type so if I got two PDF readers and I downloaded a PDF file android will use one of them without letting the user an option to choose.

I know I can clear the default settings of an application but it's not what I'm looking for.

I want to find the table/database/file that android uses for this. Is it in a sqlite database file? Where is it stored ?

  • 1
    depends on the application, either as shared preferences which is xml or as sqlite... I think you have to be a bit more specific...
    – t0mm13b
    Commented Dec 6, 2012 at 21:39
  • 4
    I guess what the OP means is: If I want to open e.g. an image file, and have multiple image viewers/editors attached, I get the choice to mark one as "always use this". Where does Android store this preference? It's not per app, this has to be a system-wide setting.
    – Izzy
    Commented Dec 6, 2012 at 23:19
  • Here is a StackOverflow question asking almost the same thing, but for use in code. stackoverflow.com/questions/8626421/…
    – Stephen S
    Commented Dec 7, 2012 at 15:19
  • Given that each app has the option to clear its default association settings, I guess it's a file per app, but I don't know where is it stored. Commented Dec 7, 2012 at 17:07
  • 1
    That would be the launcher application's database, for example, I use ADW Launcher, and in that, there's a table called favourites, which holds the intents to apps and how to handle them for differing apps of similar handling, for example two PDF readers. You will not find that within Android itself.
    – t0mm13b
    Commented Dec 7, 2012 at 17:28

2 Answers 2


On Jelly Bean, the preferred activities are stored in the XML file /data/system/users/0/package-restrictions.xml for the primary user. Other users have their user ID in place of 0 in that path. If encrypted file system is enabled, it starts with /data/secure/system instead of /data/system.

Other than through the PackageManager service, this file can only be accessed by root. You can see the code that reads and writes the file (and thus infer the format) in the class com.android.server.pm.Settings.


If I had an image file in my sdcard, I would open it via QuickPic because that is my default gallery viewer. If I wanted to switch my default gallery viewer, I would go to Settings -> Apps -> QuickPic -> "Clear Data" and then I would be able select how to open an image file again.

Therefore, Android seems to store the default application data within the program's data files that is being used.

  • 1
    Clever guess, but your conclusion is wrong. If the setting were inside the app's data directory, the app itself would be able to make itself the default or not default. Also, the system would have to read every app's data directory to find out which app is default.
    – Dan Hulme
    Commented Jun 28, 2013 at 9:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .