Esempio n. 1
0
  private boolean isOnline() {
    String response = HttpCom.send(url + "report.php", new String[][] {{"action", "check"}});
    System.out.print(response);
    String resp[] = response.split(":");

    if (resp[0].equals("off")) {
      showError("Error in initialization", resp[1]);
      return false;
    } else if (resp[0].equals("ok")) {
      return true;
    } else {
      showError("Error in 'check' header", "Response : " + resp[0]);
      return false;
    }
  }
Esempio n. 2
0
 private void fillLog() {
   String logs[];
   do {
     logs =
         HttpCom.send(
                 url + "report.php",
                 new String[][] {
                   {"action", "getlog"},
                   {"line", String.valueOf(listModel.getSize())}
                 })
             .split("\n");
     for (int i = 0; i < logs.length; i++) {
       listModel.addElement(logs[i]);
     }
   } while (logs.length == 0);
 }