Android OS Forum banner
1 - 2 of 2 Posts

·
KeyKitLimeKat
Joined
·
545 Posts
Discussion Starter · #1 ·
Hey guys, I have been staring at the CM7 source code for a while and wanted to make a small modification to it.. I figured that the easiest way to make it versatile would be to make it a preference feature and include it in CMParts.apk.. I got stumped when I had to find the file to add my own preferences.. I know there are some built in like ACCELEROMETER_ROTATION, ADB_ENABLED, and AIRPLANE_MODE_ON.. If I wanted to add one and use it, which file would I be looking at? I've tried under packages/providers and haven't found it anywhere..

I appreciate any help you guys can give in advance!

Thanks :android-smile:
 

·
Premium Member
Joined
·
1,155 Posts
I'd suggest setting up your environment to work with eclipse, that way when you are lost, you can do ctrl+click and it will open the class for you and you can see where it is located. In your case you're looking for the Settings provider class which is located in frameworks/base/core/java/android/provider/Settings.java

However, this is only used for good design practices. It is simply a global reference to a string so you can access it anywhere, without any typos. No one's stopping you from setting your own preference strings, for instance you can do something like

Code:
Settings.System.setInt(getContentResolver() , "CUSTOM_SETTING_STRING_HERE", 3893873);
 
1 - 2 of 2 Posts
Top