| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 
 |  
try {
            c = (HttpConnection) Connector.open("http://www.ratp.info/horaire/fr/ratp/rer/prochains_passages/RB/Gentilly/A");
            rc = c.getResponseCode();
            if (rc != HttpConnection.HTTP_OK) {
                throw new IOException("HTTP response code: " + rc);
            }
            is = c.openInputStream();
            is.close();
            c.close();
 
        }catch(Exception ex)
        {
            TextBox err = new TextBox("err", ex.toString() , 256, 0);
            display.setCurrent(err);
            pauseApp();
        }finally{
            TextBox t = new TextBox("Pb", "IL Y A UN GROS PROBLEME", 256, 0);
             display.setCurrent(t);
        }
 
        TextBox t = new TextBox("Hello", res, 256, 0);
 
        t.addCommand(exitCommand);
        t.setCommandListener(this);
 
        display.setCurrent(t); | 
Partager