Hi Abraham,
you could add anotherBroadcastReceiver [1] in the Preferences class that changes the state of the daemon (as you said, the pref is called "enabledSwitch"). You could then fire an intent from your application to start/stop the daemon when needed. It's probably just a few lines of code. By the way, I think it's reasonble in some situations to start the daemon automatically if an app that requires the daemon is started.
Best regards, Christian
[1] http://developer.android.com/reference/android/content/BroadcastReceiver.htm...
Am 29.01.2014 07:54, schrieb Johannes Morgenroth:
Hello Abraham,
the choice to enable / disable the background service for DTN is left to the user alone. I do not know any argument to give Apps the permission to do that. If you require that the user enables the daemon, you can ask him to do that and then open the daemon preferences.
Kind regards, Johannes Morgenroth
Am 28.01.2014 18:47, schrieb Abraham Martín:
Ops, I found why it isn't working. It checks if the SharedPreference "enabledSwitch" is true before starting the process. I can't change it from my app as the SharedPreferences are in private mode. Is there any way to change the value of "enabledSwitch" through the API?
Thanks a lot,
Abraham.
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.