How to authenticate programatically Connection API?

I have to communicate with more than two devices which have been working perfectly with Google NearbyAPI Connections. Now I need to secure the connection restricting the access to the cluster network. …

Google Nearby Messages API: Attempting to perform a high-power operation from a non-Activity Context

Calling subscribe on the Google Nearby Messages API for Android results in the Exception: Attempting to perform a high-power operation from a non-Activity Context My code: public void subscribe(…