Background Thread for Android App


I’ve been working on an Android App that goes with a Photon. I’ve new to app development and haven’t had much experience. I’m trying to subscribe to events that the photon publishes to the cloud and a webhook that the photon triggers. However, I don’t understand how to make a new thread to work with the photon.

Any advice or resources would be appreciated.


I’m not a Java expert here but when you hook up an event listener it will be just sitting there till an event arrives and do its job asynchronously by default without you needing to donate an extra thread for it.

Ok. That’s good to know. My biggest problem is when I try to log in to the cloud I get the following error:

method logIn must be called from worker thread, currently inferred thread is main

@cass By default all network calls in Android has to be in separate thread. You can make use of our Async class as specified here