Start a new topic

Trouble getting ping to be successful on android basic test!

PROBLEM: I am getting the error -



2334-2334/com.dialectdialogue.dialectdialogue E/kinvey ping﹕ Kinvey Ping Failed

java.net.UnknownHostException: baas.kinvey.com

at java.net.InetAddress.lookupHostByName(InetAddress.java:497)

at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)

at java.net.InetAddress.getAllByName(InetAddress.java:256)



and am very unsure how to go about fixing it..I have included all the jars as library files (after much headache) and included the INTERNET permission inside the manifest file, and the application runs fine. Am I missing something?



SOURCE:



import com.kinvey.android.Client;

import com.kinvey.android.callback.KinveyPingCallback;



public class MainActivity extends Activity {



public static final String TAG = "kinvey ping";



@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);



//create kinvery client

final Client mKinveyClient = new Client.Builder("my info", "my other info"

, this.getApplicationContext()).build();



//login button with kinvey

loginButton = (Button) findViewById(R.id.loginButton);

loginButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(MainActivity.this, HomeActivity.class);

startActivity(intent);

}

});



mKinveyClient.ping(new KinveyPingCallback() {

public void onFailure(Throwable t) {

Log.e(TAG, "Kinvey Ping Failed", t);

}

public void onSuccess(Boolean b) {

Log.d(TAG, "Kinvey Ping Success");

}

});



}







Thanks!
1 Comment

`java.net.UnknownHostException: baas.kinvey.com` implies the cause of the issue is an `Unknown Host`.



This can happen for a handful of reasons, but the problem is most likely on the device itself. Can you ensure the device is connected to the internet? Open up a browser on the device, and visit `baas.kinvey.com` -- you should see a `hello` message. If that page contains the message, can you double check the internet permission? there might be a typo or something else.



If you don't see that hello message in your browser on the device, can you double check that is properly connected to a network?
Login or Signup to post a comment