delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

i cannot connect to server #137

Open shankaranand007 opened 7 years ago

shankaranand007 commented 7 years ago

ConnectionDetector conDet = new ConnectionDetector(getBaseContext()); if(!conDet.isConnectingtoInternet()){ Toast.makeText(this, "NO..internet connection", Toast.LENGTH_SHORT).show(); }else{ Toast.makeText(this, "Internet connected", Toast.LENGTH_SHORT).show(); } //instance meteor = new Meteor(MainActivity.this, "ws://ydapp.in:3000//websocket"); //callback meteor.addCallback(this);

    //establish connection
     meteor.connect();

    if (meteor.isConnected()) {
        Toast.makeText(this, "connect", Toast.LENGTH_SHORT).show();
        Intent i = new Intent(MainActivity.this, Welcome.class);
        startActivity(i);
    } else {
        Log.e("Errorr","Error");
        Toast.makeText(this, "Not connect", Toast.LENGTH_SHORT).show();
        meteor.reconnect();
    }