Call (and get the response for) a USSD Code, in the background?
<p>I'm wanting to write a widget displays the users' prepay balance, remaining data etc. </p>

<p>I'm thinking of automatically calling the USSD code which returns this data (will have to have a regex for each network), at intervals (not often, to save battery). This would have to be done in the background. I have an app at the moment which runs the ussd code and returns the result, so I think this should be possible - but I'm not sure how it would be done in the background.</p>

<p>I've seen the intents for Calling a number, but I'm not sure how to get the result, and I'm also thinking that that intent would cause the call screen to come up into the foreground?</p>

<p>The other option is to get the data by screen-scraping the result from the carrier's website/maybe wap site but that would result in data charges for the user, so I would prefer a solution using the USSD code.</p>

<p>Thanks in advance for any help - only started working on understanding android today so got quite a lot to learn :)</p>
