Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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 ?

share|improve this question
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 Dec 6 '12 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 Dec 6 '12 at 23:19
    
Here is a StackOverflow question asking almost the same thing, but for use in code. stackoverflow.com/questions/8626421/… –  Stephen Schrauger Dec 7 '12 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. –  Francisco Alvarado Dec 7 '12 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 Dec 7 '12 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.

share|improve this answer

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.

share|improve this answer
    
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 Jun 28 '13 at 9:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.