Turbozanik Turbozanik - 19 days ago 5
Android Question

Unable to resolve host "api.backendless.com": No address associated with hostname

Just trying to run the tutorial and i am getting this error. I just can't understand what is wrong. I am using initApp iside my application class, maybe its the problem?Any suggestions?

public class App extends Application {

@Override

public void onCreate() {

super.onCreate();

String appVersion = "v1";

Backendless.initApp( this, getString(R.string.backId), getString(R.string.backSecretKey), appVersion );

}


}

BackendlessUser user = new BackendlessUser();

user.setEmail( "michael@backendless.com" );

user.setPassword( "my_super_password" );

Backendless.UserService.register( user, new BackendlessCallback<BackendlessUser>()

{

@Override

public void handleResponse( BackendlessUser backendlessUser )

{

Log.i( "Registration", backendlessUser.getEmail() + " successfully registered" );

}

} );

Answer

May be you forgot to give internet permission in manifest file. Pelase add below permissions in manifest file.

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Comments