I’m trying to make a basic app that simply logs in to the particle cloud using my credentials and reads a list of devices associated with my account, however the login always fails. Is this how I should be logging in on the app? I’ve searched for examples using the code I found at https://docs.particle.io/reference/android/#android-device-setup-library but there doesn’t seem to be much around specifically using ParticleCloudSDK.getCloud().logIn.
This should be pretty basic, I’m not sure what I’m doing wrong.
try {
// Init the CloudSDK
ParticleCloudSDK.init(MainActivity.this);
ParticleCloudSDK.getCloud().logIn("*******", "******");
Toaster.s(MainActivity.this, "Logged in!");
// Now we're logged in, we want to read a list of devices
getDeviceList();
} catch (ParticleCloudException e) {
Toaster.s(MainActivity.this, "FAILED TO LOGIN!");
}
Yes, it does print out “FAILLED TO LOGIN”, so an error is being caught.
I’m new to Android development, so maybe I’m not getting the correct error message, however when I pass toast messages of e.getMessage() or e.getBestMessage.tostring() I get:
Just to add some more details for this, I downloaded and compiled the example app https://github.com/spark/spark-sdk-android and when i try to login, it fails with a toaster message “permission denied” when using my particle account abd also on a second account I created for sanity checking. I’ve even programatically populated the login username and password in case I was all thumbs:
final String email = "username";
final String password = "password";
final EditText textid = (EditText) findViewById(R.id.email);
final EditText textpass = (EditText) findViewById(R.id.password);
textid.setText(email);
textpass.setText(password);
Something I’ve just noticed is ParticleCloud.get() is a depreciated function, maybe it doesn’t work now?
“Permission denied” is most likely because you forgot to change device id passed into getDevice method or you are trying to access device which does not belong to your account.
Just a question. Did you guys ever figure this out?I am having the EXACT same issue. I downloaded that app that you sent and got the same message. “Permission denied”