I wrote a small code to add a room for my app, throught the edit text and button. But on clicking the button the connection fails. what is the reason? I added my apikey and secret key as well.
Here's my init()
public void init() {
WarpClient.initialize(Constants.app_key, Constants.app_secret);
try {
theClient = WarpClient.getInstance();
WarpClient.enableTrace(true);
} catch (Exception e) {
// TODO Auto-generated catch block
Toast.makeText(this, "Exception in Initilization", Toast.LENGTH_LONG).show();
}
theClient.addConnectionRequestListener(this);
}
and heres the button click listener
connected.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
props = new HashMap<String, Object>();
props.put(interest.getText().toString(), 30);
progressDialog = ProgressDialog.show(context,"","Please Wait..");
progressDialog.setCancelable(true);
theClient.connectWithUserName("Mr. V");
theClient.createRoom(interest.getText().toString(), "Mr. V", 30, props);
}
});
and finally the onConnected over ride
public void onConnectDone(final ConnectEvent event) {
// TODO Auto-generated method stub
Log.d("OnConnectDone", ""+event.getResult());
runOnUiThread(new Runnable() {
@Override
public void run() {
if(progressDialog!=null){
progressDialog.dismiss();
progressDialog=null;
}
if(event.getResult()==WarpResponseResultCode.SUCCESS){
Toast.makeText(MainActivity.this, "Connection Success", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(MainActivity.this, "Connection Failed "+event.getResult(), Toast.LENGTH_SHORT).show();
}
}
});
}