Has anyone succeeded in using pubnub examples for android? I am working a senior project that uses it for interacting with raspberry pi remotely. The demo project works find but replacing the pub/sub key with my own causes unknownhostExecption. I have created GCM account and using the api key as the sender ID. My manifest is registered the appropriate permission as well. I have been stuck with for a while. but still unable to figure out the cause. What do i need to do?
1 Answers
I will start by linking to an Android PubNub project that was created to interact with a Raspberry Pi remotely. Take a look here https://github.com/GleasonK/PHue
I have created GCM account and using the api key as the sender ID.
Are you trying to use GCM? If all you need is Pub/Sub you simply need your developer Pub and Sub keys. Unknown host might be because you are using the wrong keys. Visit the admin console and log in (https://admin.pubnub.com/). You should then see Publish Key
and Subscribe Key
. Those are the two you need to use when instantiating a Pubnub
object in Android.
If your project actually requires GCM, PubNub does support that as well. From the PN Blog. If this is what you need me to elaborate on let me know and I would be glad to!

- 1,032
- 8
- 17