I write apps for a living, and the documentation has lots missing. I am just trying to write a simple app that logs in and lists devices. The documentation implies something that should never happen in Android dev, a network call on the main thread. Well it doesn’t work, and it is not because it is on their main thread. The firmware has lots of hello world like examples. But the Android is really missing lots of example code. here is my super simple code. Why doesn’t it work???
This is more like what I was expecting however this code looks to be out of date…
09-18 16:33:22.458 4019-4019/com.example.rodgerwilson.particleblinker W/ParticleCloud: ParticleCloud.get() is deprecated and will be removed before the 1.0 release. Use ParticleCloudSDK.getCloud() instead!
09-18 16:33:22.480 4019-4019/com.example.rodgerwilson.particleblinker E/Async: Error calling API: Unknown error communicating with server.
io.particle.android.sdk.cloud.ParticleCloudException
at io.particle.android.sdk.cloud.ParticleCloud.logIn(ParticleCloud.java:173)
at com.example.rodgerwilson.particleblinker.MainActivity$2.callApi(MainActivity.java:74)
at com.example.rodgerwilson.particleblinker.MainActivity$2.callApi(MainActivity.java:72)
at io.particle.android.sdk.utils.Async$AsyncApiWorker.doInBackground(Async.java:105)
at io.particle.android.sdk.utils.Async$AsyncApiWorker.doInBackground(Async.java:73)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: io.particle.android.sdk.cloud.ParticleCloudException
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at io.particle.android.sdk.cloud.ParticleCloud.logIn(ParticleCloud.java:173)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at com.example.rodgerwilson.particleblinker.MainActivity$2.callApi(MainActivity.java:74)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at com.example.rodgerwilson.particleblinker.MainActivity$2.callApi(MainActivity.java:72)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at io.particle.android.sdk.utils.Async$AsyncApiWorker.doInBackground(Async.java:105)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at io.particle.android.sdk.utils.Async$AsyncApiWorker.doInBackground(Async.java:73)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:305)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
09-18 16:33:22.484 4019-4019/com.example.rodgerwilson.particleblinker W/System.err: at java.lang.Thread.run(Thread.java:761)
09-18 16:33:22.485 4019-4019/com.example.rodgerwilson.particleblinker D/info: Unknown error communicating with server.
I am having an issue in reading variable from my device after logging in.It is giving me error reading variable and “variable temp does not exist on device” however we have defined this variable as global in Web IDE of particle. Kindly suggest how we can get this variable on our Android App.