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.

I've been trying to figure out if it's possible to disable/enable GO SMS popup notifications via something like Tasker. I came across the following line in /data/data/com.jb.gosms/shared_prefs/com.jb.gosms_preferences.xml:

<boolean name="pref_key_popup_msg" value="true" />

It would seem that I could just flip that to false, but GO SMS doesn't see that (and it actually rewrites the shared_prefs file it looks like). Is there a way to force GO SMS to re-read this shared_prefs file?

I am rooted and am pretty comfortable with shell commands as well as Tasker; I would think that any solution would require one of the above. (Tasker can fire Activities or broadcast intents.)

share|improve this question
add comment

3 Answers

Since this is bordering on the nuances of programming in terms of how preferences are stored, an activity that implements PreferenceActivity, actually modifies the entire preference xml, not just one key value.

The entire preference xml gets loaded and cached, any changes made, it rewrites it out in one fell swoop.

Quite likely, in the case of Go-SMS, there's a default value specified true regardless of what was selected, and also likely, to be hard-coded - raise the issue with Go-SMS developers to find out why?

share|improve this answer
add comment

Try to edit the file after 'force-stopping' the app in settingsapplicationsmanage applications. You cant edit the permission of the app to display notifications however

share|improve this answer
    
I'm talking about popup notifications - not notifications in the status bar. I'll give this a shot! –  Dang Khoa Apr 23 '12 at 19:02
    
This did not work. The string in the xml file got replaced to true. :( –  Dang Khoa Apr 23 '12 at 19:06
    
inside the app you can go to menu-settings - notification settings -uncheck enable popup to disable it. Probably the app checks when it was edited and prevents you from manually editing it –  Ruben Roy Apr 23 '12 at 19:18
    
Yes, yes you can. The point was I would like to be able to do this externally (via Tasker, say). Guess this isn't possible.. –  Dang Khoa Apr 23 '12 at 20:55
    
@DangKhoa Did you force-stop the app before editing the prefs file? There's no way it could rewrite the XML file if it's not running. –  Dan Hulme Aug 14 '13 at 17:05
add comment

I had exactly the same issue with an app I use - I am rooted and found the XML prefs file and the value I manually changed but everytime I boot the app it rewrites the file. Having done some reading on this and experimenting with code I think this is because an app will only call on its preferences (getPreferences) once a settings dialog/screen is closed - generally this is how the app is written. I'm still not quite sure why/how the app rewrites the preference xml regardless of changing the settings in the app or not.

BTW I too want to use Tasker to change a value in the prefs xml of an app to dynamically have the app respond. I am looking into decompiling the app finding the relevant piece of java code and then amending it to call on prefs more frequently.

share|improve this answer
add comment

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.