JohnDoe4136
JohnDoe4136

Reputation: 539

Blackberry java.io.IOException radio is off

I am trying to connect my device to a http server using wifi. But I am having this exception:

java.io.IOException radio is off

What is usually the cause of this and what should I check for?

Thank in advance.

Upvotes: 1

Views: 981

Answers (1)

gkane
gkane

Reputation: 365

I've never had this error so I can't be sure. However it sounds as if your wifi reciever is turned off, try the following code.

if (RadioInfo.getState() == RadioInfo.STATE_OFF) {
        if (Dialog.ask(Dialog.D_YES_NO, "You currently have no network connection\nDo you want to turn connections on?", Dialog.YES) == Dialog.YES)
        {
            //Activate GPRS
            Radio.activateWAFs(RadioInfo.WAF_3GPP);

            //Sleep for 10secs to allow wireless to activate. 
            // TODO (DG) DO THIS IN NEW THREAD TO PREVENT BLOCKING UI THREAD
            try {
                Thread.sleep(10000);
            }
            catch (InterruptedException e) {
                e.printStackTrace();
            }
        } }

Upvotes: 2

Related Questions