Check data connection

suggest change

This method is to check data connection by ping certain IP or Domain name.

public Boolean isDataConnected() {
    try {
        Process p1 = java.lang.Runtime.getRuntime().exec("ping -c 1");
        int returnVal = p1.waitFor();
        boolean reachable = (returnVal==0);
        return reachable;
    } catch (Exception e) {
        // TODO Auto-generated catch block
    return false;

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents