Hi,
Erel did something like that using Reflection. Perhaps could you check
this code ? I didn't do the test
I tested that code on 3 phones:
1) LG P500 (android 2.3.3)
2) SG S (android 4.2.2)
3) Zopo C2 (android 4.2.1)
With phone 1) the code works and is able to enable the speaker while the headphones are plugged using r.RunMethod2("setMode", 1, "java.lang.int").
Unfortunately the code doesn't work with the other two phones (but the FM radio app still does). I think that there should be some other way, hopefully more device independent, to enable the speaker or perhaps it is just the radio output that could be easily routed to it...