Android Google Awarness APIs edit

Google Awareness APIs


Remember, the Snapshot API is used to request current state while the Fence API continuously checks for a specified state and sends callbacks when an app isn’t running.

Overall, there are a few basic steps in order to use the Snapshot API or Fence API:

<!-- Not required for getting current headphone state -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Only required for actvity recognition -->
<uses-permission android:name=""/>

<!-- Replace with your actual API key from console -->
<meta-data android:name=""

<!-- Required for Snapshot API only -->
<meta-data android:name=""
GoogleApiClient client = new GoogleApiClient.Builder(context)

An easy way to check for the needed user permission is a method such as this:

private boolean isFineLocationGranted() {
    if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)
                != PackageManager.PERMISSION_GRANTED) {
        Log.e(getClass().getSimpleName(), "Fine location permission not granted!");

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents
64 Menu
88 Google Awarness APIs
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close