Read/Write Settings? - Windows Phone 7 Software Development

I am looking to read and write system settings. I have already found out how to Read the current theme style (Dark or Light), but is it possible to programmatically change it?
I have also looked everywhere for an API to be able to grab the current wallpaper file, and write in a different one, but no luck.
Can anybody point me in the right direction?
Thanks!

afaik I don't think you can change the user's theme, but you can override it.
Download either the DarkStyles.xaml or LightStyles.xaml:
http://www.windowsphonegeek.com/news/theme-forcing-for-windows-phone-7
Then you can merge the xaml file into the resource dictonary of the resources of app.xaml:
Code:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/DarkStyles.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
I don't think there's an api for grabbing the current wallpaper, but u can use MediaLibrary to check out the currently saved pictures if I remember correctly, otherwise there might be something related to Tasks.

Don't know about wallpaper but I have a thread for adding customs accents and 3 extra themes. Yu could also make your own but im on my phone and it would take forever to type out how.
Sent from my HD7 using XDA Windows Phone 7 App

Related

Custom Folder Icons

Hi, I'm looking for a way to customise the icons for folders created on the Home screen. I realise that we can change the png files but that would change all folders, what I want is to be able to customise each folder I create separately.
Currently I'm using Apps Organizer to do this and while it works well it is slow to load the shortcuts inside.
I don't want to run a home replacement so does anyone know of a simple and effective solution to allow custom icons for each folder? (I think this is something that Android should have by default)
Is that a no then?
thats an option i would be glad to have in my device!
please suggest it to irrenhaus to aplly it in his AdvancedLauncher
in this thread
http://forum.xda-developers.com/showthread.php?t=540880
I will think about this, it shouldn't be much work . But no promises yet
That's great to hear, it seems like a pretty basic function to me and I can't see why Android doesn't just support it to begin with. I hope you manage to conjure something, it will be much appreciated by many people I think
Mik

Developing against HTC libs

I'm trying to figure out how to write an app that uses HTC API's. Specifically I want my app to switch scenes but I can't figure out how to call in to their libraries.
I unzipped Rosie.apk and it is only resources, no java.
it's the classes.dex
Right but how do I import something from a dex in eclipse and build it?
manicmethod said:
Right but how do I import something from a dex in eclipse and build it?
Click to expand...
Click to collapse
no way.
.dex is compiled, not source.
does java have a way to forward-declare classes so I can tell java they'll be there when it tries to run?
I haven't done much (read: any) actual development on Android yet, as I just got my Hero recently (developing solely on an emulator? ewww), but isn't the typical way of interacting with other applications on Android through Intents and Actions?
Browsing through the AndroidManifest.xml file in Rosie.apk, there seems to be a reference to com.htc.launcher.ThemeChooser.action.theme_change - Maybe this would be a place to start?
Ah yes, I'm still in the mindset of calling other peoples interfaces to do things. Thanks for the tip.
trying to figure out what to do with it will be fun, I'm sure
So com.htc.launcher.ThemeChooser.action.theme_change launches the chooser. I need to be able to change the scene under the covers by telling it what theme to switch to, any one have any ideas?
Glad to see that you made a little bit of progress I did some more searching, but this time in Rosie.odex. I found an ACTION_THEME_CHANGE string. Perhaps it could be something like this:
Component Name: com.htc.launcher.ThemeChooser.action.theme_change
Action: ACTION_THEME_CHANGE
Data: ?
Like I mentioned, I'm new to this stuff I'm not sure if there is a way to log or monitor intents (that would sure make this easy, wouldn't it?).
After looking at this more I think I need to hook into the htc settings content provider and see if I can change the settings like that. I found this in the manifest.xml:
E: provider (line=191)
A: android:name(0x01010003)="LauncherProvider" (Raw: "LauncherProvider")
A: android:readPermission(0x01010007)="com.htc.launcher.permission.READ_SETTINGS" (Raw: "com.htc.launcher.permission.READ_SETTINGS")
A: android:writePermission(0x01010008)="com.htc.launcher.permission.WRITE_SETTINGS" (Raw: "com.htc.launcher.permission.WRITE_SETTINGS")
A: android:authorities(0x01010018)="com.htc.launcher.settings" (Raw: "com.htc.launcher.settings")
so according to http://developer.android.com/guide/topics/providers/content-providers.html it looks like the Uri should be:
Uri u = Uri.parse("content://com.htc.launcher.settings");
except when I try that I get an exception saying that is an invalid URI :\
I'm not sure that it would be a setting. I mean, I'm sure you could find an attribute to set, but I don't think the switch would be instantaneous (likely requiring a reboot to show), unless there is something listening for changes to the settings. I could be wrong, of course.
Figured it out:
final Uri u = Uri.parse("content://com.htc.launcher.settings/widget_workspaces");
And the resulting table has
_id, display_name, created, status, and ancestor_id
So I think I can change status and then figure out how to throw a notify
I guess you were right, it looks like the widget_workspaces table has all the scenes available but the status field doesn't do what I assumed it would, rather it looks like it indicates whether a scene was shipped by HTC, is your saved scene or is unsaved.
I was really hoping this would do it because I don't know where to look now.
Well, looking at the ddms, it seems like I am wrong. It looks like ThemeChooser activity will do the swapping itself after you have selected a different scene. So it doesn't look like you will be able to make use of HTC's packages to do the swapping for you. Unfortunately, the only thing I can think that you could do next, is figure out how it is storing the scenes and load it and call all of the loading functions yourself...
Well, I have no way of calling their loading functions so I guess I'm out of luck :X
Check out smali and baksmali to snoop around in the classes.dex.
P
I used ddx1.7 to snoop in the dex files and found the tables and everything they were storing settings in. Unfortunately it looks like they neither store the current active scene in the table nor have an intent to call that will switch it without popping up the dialog.
It looks like what I want to do isn't possible.

[MOD]Windows 8 Metro Icons for Non-Metro Programs!

THIS IS NOT A QUESTION!​
>Okay, so I had a thought, why try registry hacking to modify icons on the start screen when there must be a much simpler way? Well I may have come up with a solution... I have not personally tested this yet and it would only be a temporary solution although I don't see why it wouldn't work so let's see how it goes hey?
>My basic idea came when I was using my iPad earlier and got linked to the appstore, now I know this is hardly related although the same happen on computers, so what I thought is why not use a similar technique to launch desktop programs from a metro app (Or a website saved to the startscreen), using a bit of HTML and JavaScript it "should" be possible to launch a link to a program automatically when a page launches.
HTML:
Launch the executable
<script>
function LaunchApp() {
if (!document.all) {
alert ("Available only with Internet Explorer.");
return;
}
var ws = new ActiveXObject("WScript.Shell");
ws.Exec("{EXE FILE LOCATION}");
}
</script>
This is assuming you know the file location (There are other ways, this is the way iTunes does it) now the only thing you need to do is make a basic HTML file and make sure you include the icon for the Start Screen and a good title for it. It may seem like a lot of work although after you have one basic app you can make more faster and add them to your startscreen a lot faster I hope this helps some people, I will personally have a play with it later and see if I can build some example launchers for you to use. I also plan to soon write a full guide along with creating a proper windows 8 startscreen compatible website.
Oh this version is also based on IE being your default browser, I will add updated code in a few days (The only browsers you can add icons with are IE or Chrome anyway and an IE wrapper in the chrome webstore could fix this anyway!)
Pretty sweet, I'll test when I get home. Do you know if this could be used to work with Metro apps as well? I'd like to be able to set my own tile color, I prefer the "accent color" approach on Windows Phone. The various mish mash of random colors in Windows 8 gets under my skin.
quite possibly although I think you can actually edit metro apps anyway, I forget the directory though.
not sure.. haven't tried it yet though.. someone will I think. and he's coming in 3.... 2.... 1....
C:\Program Files\WindowsApps
Sent from my SM-T210R using XDA Free mobile app

[Q] making sense of .smali

hey guys.
can one of you masters point me in the correct direction to understanding .smali code?
I'm trying to update the video ringtone app that I had themed back in 2010. I've been able to get most of it done via .xml and .png edits, but I'm running into an issue I never ran back then. there's a check in the code of the program that tells me the app is corrupt. I know it's because it's been edited, but it's a free apk, i'm not breaking any rules. never heard of free apks being so strict.
I'm fairly certain it's down to .smali, as I've poured through all the .xmls and I don't see anything referencing that error except the strings.xml in res/values/.
within the smali i'm fairly certain i'm in the right folder, as I'm seeing different .smali files for specific parts of the program I can recognize based on the name, but nothing makes sense of what's on the smali code.
i can real .xml plainly, but .smali reads like text java...which I'm very bad at. is this something that I can visualize by using Eclipse or another Java compiler? how do you guys find what you need to edit in the code?
any help is greatly appreciated.
nobody? I know someone must know because you awesome guys do smali changes all the time!
I found a "guide" on editing/themeing Android. It mentioned I needed Eclipse. that's ALL it ever said about Eclipse...I need it, for what?!
What does it do when you try to open the program? Does it just fc or does it actually tell you that it's corrupt?
the problem only happens when I try to select a video for a specific contact.
instead of opening the video picker thing, it gives a toast notification saying the application is corrupt. the toast notification goes away and the app stays open.
I can continue to use the app otherwise, and everything else seems to be working. the share/download videos option gives the same message, but that connects to a server, so that is understandable.
the app still works. i just don't want to release it as is since you can only have one video ringtone right now, and I like having custom ringtones and I know so will other people.

[HOWTO][INFO]Editing the CSC file on your phone.

All samsung "touchwiz" based devices contain files in /system/csc that set variables dictating how certain parts of the phone act, what is pre-configured, etc. In the case of the AT&T variants, the contents of these files are often dictated by AT&T.
This post is an attempt to try and catalog some of the more useful values that can be changed (and the result of changing them.) Not all the variables seem to do much, and only by trial and error can we really know what will happen... So far, I've only played around with items I found interesting, but will continue to expand in this and if people reply to this post with actual experience changing other variables, I'll add the information to this thread.
PLEASE TEST THINGS AND CONTRIBUTE TO THIS THREAD.
Please don't reply with guesses as to what things may or may not do or with requests about specific variables. I'm hoping that eventually document every CSC variable available and "requests" won't make it go faster. If you want to know what a not-yet-documented variable does, try it out (and post your results.)
First, in order to play with the csc files, your phone should be rooted. This isn't optional, as you'll need the ability to overwrite files in the phone's /system partition (the firmware - sometimes improperly called the "ROM")
I'd strongly suggest making a nandroid (or backup via CWM Recovery or TWRP) before making changes. It's possible to mess things up badly enough that the phone won't boot properly.
It's possible to edit the CSC files directly on the phone, but I'd strongly suggest not doing that. Therefore, you should have a good text editor on your computer that's able to properly deal with unix/linux style line endings (notepad isn't good enough.) Notepad++ is a very good editor and freely available. Google "notepad++" For a linux box, plain "gedit" is fine.
In order to edit the files, you'll need to be able to mount the /system partition as read-write, and to move files from /system/csc to your PC or other location for editing. You have several options for this including root explorer, ES File Explorer, or just using adb. I prefer adb myself, but I'm a commandline type of person.
I won't be spending time describing how to get the CSC files off your phone to your PC, nor will I tell you how to overwrite the existing ones with your edits. This isn't because I'm elitist, an a**hole, or anything like that. (I _am_ some of those things, but that isn't my reason here.) My purpose for leaving out the information is to force inexperienced users to learn these things before editing system files. If I give you all the information, you become dependent on me for more information, and I don't want that (and trust me - neither do you.) As well, if I spoon-feed this, you won't have any idea what do to when something goes wrong.
Find this post helpful? If so, please make it MORE helpful by testing one of the other CSC features and replying to this thread telling us what result you had. ​
First up... feature.xml...
feature.xml
The CSC "feature.xml" file is in XML format. This means that everything "variable" has a start and end tag. Both contain the name of the variable,
but the end tag has a slash in it. The value of the variable is between the start and end tags. For example: <VariableName>value</VariableName>. So, if this message describes changing "CscFeature_SamsungSucks" from "false" to "true", you'd search in the xml file for "CscFeature_SamsungSucks" and might find this:
Code:
<CscFeature_SamsungSucks>false</CscFeature_SamsungSucks>
You'd change the "false" to "true" (no quotes!) and be done. In some cases, the entire line can be deleted (as noted.)
This file has a LOT of variables in it and this post will concentrate on that particular file. Almost all tinkering will occur in this file, and it's also the easiest to edit (as there aren't any complex xml structures.)
CscFeature_Common_DisableMenu4GalSearch: setting this to false didn't seem to bring up any new global address list options on my device (I'm connected to an exchange server) in the email app or contacts/dialer app.
CscFeature_Settings_DisableMenuFindMyMobile: (see next line)
CscFeature_Settings_FindMyMobile: setting "DisableMenuFindMyMobile" to false and this entry to true will enable the "find my mobile" entries in the Settings->Security menu. I'm unable to get these items to function properly, however. (They worked with my international note2, so it might be that there are other support files missing on the AT&T variant I'm using now.)
CscFeature_FMRadio*: editing these seem to have no effect (I don't think any of the LTE capable NoteII phones are capable of FM Radio.)
CscFeature_NFC_StatusBarIconType: If you delete this line, it will get rid of the "N" statusbar icon when NFC is turned on.
CscFeature_Message*: Be warned that editing some of these may break SMS/MMS messaging on your device. There appears to be many carrier specific settings in here that have dependencies on the specific carrier. For example, I don't think that AT&T's network supports proper SMS Delivery reports, so even setting the corresponding variable to "true" would be futile.
CscFeature_Email_UseFixedBgColorAsWhite: if changed from true to false, the email app will appear inverted (with a black background and white/gray text.)
CscFeature_Sip_DisableAutoCorrection: doesn't seem to have any impact on the samsung keyboard
CscFeature_Sip_DisableSpaceSuggestion: doesn't seem to have any impact on the samsung keyboard
CscFeature_Sip_DefaultOff4AutoSubstitution: doesn't seem to have any impact on the samsung keyboard
CscFeature_Launcher_*: all these seem to be for setting defaults for the touchwiz launcher, so no sense in changing them.
language.xml
(coming soon)
This appears to control what languages are available to the system. Canadian users might want to play with this file to see if adding en_US to the "Display" and/or "SupportList" tags will allow them to choose US English (and perhaps get google's TTS to talk to them in google now.)
others.xml
(coming soon)
This appears to set some carrier defaults, including the APN information and the carrier built-in dialer contacts (such as "AT&T Customer Care")
customer.xml
(coming soon)
I've only glanced at this file so far, but it appears to be carrier specified network information, some carrier specified settings defaults, and even some carrier specified browser bookmarks. There also appears to be some APN related information in here, but I'm not certain what it's in here for.
Nice how to guide man its very informative, im going to play around with this later when I get home...do you mind if I add it to my reference thread so it doesnt get lost when this thread begins to get bigger?
Sent from my SAMSUNG-SGH-I317 using xda premium
mjwhirly said:
Nice how to guide man its very informative, im going to play around with this later when I get home...do you mind if I add it to my reference thread so it doesnt get lost when this thread begins to get bigger?
Click to expand...
Click to collapse
This isn't mine to control. This "belongs" to the community, and I hope that the community contributes to it in a meaningful way. Please feel free to reference it elsewhere - perhaps with (contributions welcome) noted. My ONLY demand is that no one profits from effort I've given freely.
My secret motive is to nudge people out of the "MyRom" mentality and more into the "lets all work together to learn, develop and share" mentality often seen with kernels and open source projects.
Take care
Gary
Gary, have you seen the CSC feature web, set user agent?
Possibly an option to set "Desktop" as default user agent in browser, I for one despise mobile sites.
antiochasylum said:
Possibly an option to set "Desktop" as default user agent in browser, I for one despise mobile sites.
Click to expand...
Click to collapse
Not sure if this is what you are looking for or not: Start the browser, tap the "menu" button. Turn on the "desktop view" checkbox.
There are some UAgent related entries in the feature.xml file. Please play with them and post your results:
CscFeature_Web_SetUserAgent // currently empty
CscFeature_Web_SetUAProfile
CscFeature_Web_Bool_EnableUAProfile // currently false
Thanks so much for this. Sorry for the noob question but I haven't done much with xml files. What is the character to just comment out a line?
Sent from my SAMSUNG-SGH-I317 using xda premium
Romee74 said:
Thanks so much for this. Sorry for the noob question but I haven't done much with xml files. What is the character to just comment out a line?
Click to expand...
Click to collapse
In XML, in order to comment out a line (instead of completely deleting it), it has to be surrounded by special tags:
On the left of the commented out area, you need "<!--" (no quotes) and on the right, you need "-->"
See the below code block for an example.
Code:
<Is_This_Commented> false </Is_This_Commented>
<!-- <Is_This_Commented> true </Is_This_Commented> -->
Take care
Gary
On my Galaxy S III, the file /system/etc/feature_default.xml appears to contain default settings, and feature.xml can override those defaults. I'm not sure how comprehensive the list of settings in feature_default.xml are, but I would imagine that many of the available ones are covered there.
Thundersnuz said:
On my Galaxy S III, the file /system/etc/feature_default.xml appears to contain default settings, and feature.xml can override those defaults. I'm not sure how comprehensive the list of settings in feature_default.xml are, but I would imagine that many of the available ones are covered there.
Click to expand...
Click to collapse
That's interesting. Which variant of sgs3 do you have? Would you be willing to attach the two files to a reply in this thread (or point me to someplace I can find the firmware your using to investigate?)
Thank you
Gary
It would be amazing if we could somehow enable auto-replace on the samsung keyboard. I ended up switching to swiftkey because of how many mistakes I've been making with the stock keyboard, but now I don't get to take advantage of swipe, stylus writing, or the one-handed features...
UCLAKoolman said:
It would be amazing if we could somehow enable auto-replace on the samsung keyboard. I ended up switching to swiftkey because of how many mistakes I've been making with the stock keyboard, but now I don't get to take advantage of swipe, stylus writing, or the one-handed features...
Click to expand...
Click to collapse
I completely agree, but I wasn't able to get it working when tinkering with the CSC values (as noted in the corresponding post.) Perhaps there's some other combination of values that might get it going.
Please give it a try and let us know how it works out.
Take care
Gary
Removing the NFC icon from the staus bar is awesome but has anyone tried switching this line;
<CscFeature_NFC_DefaultCardModeConfig>DISABLE</CscFeature_NFC_DefaultCardModeConfig>
To enable? Im not sure why att would "block" this feature, especially with google wallet getting more support for non-nfc devices.
Sent from my SAMSUNG-SGH-I317 using xda app-developers app
MonsterBandit said:
...but has anyone tried switching this line...
Click to expand...
Click to collapse
I'm not sure why people keep asking if other people have done this, that, or the other thing. TRY IT and let us know what happens.
garyd9 said:
I'm not sure why people keep asking if other people have done this, that, or the other thing. TRY IT and let us know what happens.
Click to expand...
Click to collapse
fair enough...thanks btw...im slowly growing the courage to make changes and explore deeper into these devices...changed the value to "ENABLE" (minus the quotes) and seemingly nothing changed. Google Wallet app still says Not supported. That might be on Google Wallet's end tho. I guess the better question might be has anyone with a Note 2 gotten Google Wallet to work?
When I first got my GN2 running stock, carrier billing worked. I then flashed Jedi 3.3, and it disappeared. I remember that on my HOXL, someone mentioned a fix on the build.prop. Is there anything I can do on the GN2's build.prop to get my carrier billing back?
I'm on AT&T by the way.
silentecho13 said:
When I first got my GN2 running stock, carrier billing worked. I then flashed Jedi 3.3, and it disappeared. I remember that on my HOXL, someone mentioned a fix on the build.prop. Is there anything I can do on the GN2's build.prop to get my carrier billing back?
I'm on AT&T by the way.
Click to expand...
Click to collapse
this is pretty much a how to thread ..
you seem to be having issues with a rom , you should post in there ..
here is how I fixed it in previous roms ..
compare your build.prop form your att rom to the one you are using ..
and add / replace with the att stuff .

Categories

Resources