Trying to register an Android device with backendless, I execute the following code per documentation and see no devices registered in the backendless console.
Sorry, I cannot reproduce the error. Here’s my code, I used another app where I was testing a memory leak (do not let the namespace name confuse you):
package com.backendless.memoryleaktest;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import com.backendless.Backendless;
import com.backendless.Subscription;
import com.backendless.async.callback.AsyncCallback;
import com.backendless.exceptions.BackendlessFault;
import com.backendless.messaging.Message;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
Backendless.initApp(this, "757E349F-C515-5AF3-FF5D-EFF0379BFB00", "115455F0-5317-46D0-FFB2-82712757C900", "v1");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
registerDevice();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
private void registerDevice()
{
Backendless.Messaging.registerDevice(
"XXXXXXXX",
Arrays.asList("default", "test-channel"),
new Date(1451455200000l) );
}
}
Good Day…It seems I cant solve my problem, which is very similar to that of Tim R. My device still is not showing ,now I do not understand because I have followed tutorials on the matter…I have even redone my code in case I might have made some mistakes…
My Manifest
I have declarations set up like you have defined above…not forgetting to replace [APP PACKAGE NAME] with my full app package name.
I have added server api Key to backendless console.
I have also added a sender ID into my app…
Both of which came from googles cloud messaging.
Whenever I register device it throws HandleResponce but My device is not showing, and even the channels ive registered for arent showing…