I’m primarily an embedded developer, but am trying to develop an Android app for my application. I have got a small hang of activities and intents. I am having difficulty trying to pass a SparkCloud object from one activity to another.
The aim is to attempt the login in one activity, and then switch to another activity and pass the cloud instance to that. I could also pass in the credentials between activities instead as they are native datatypes. I feel like the former implementation is more ideal as it is a piece of information the second activity needn’t worry about.
You don’t need to pass credentials. I thought so at first to, but once your user logs in he’s logged in for each activity. So you can just grab a new cloud by calling ParticleSDK.getCloud
Thanks a lot for that ! That just made my code a lot simpler. For reference, here is an instance of the cloud object I created in my second activity for usage inside that activity which works now.
I was following the instructions on the Particle Reference Manual for Android. That shows 0.1.3 which still uses the Spark APIs. I’ll switch it over to the new rev as you said to be forward compatible.