# Using TripDetector.AWARENESS

Follow this guide to use the TripDetector.AWARENESS feature

## Enable Google Awareness API

1. Create or use an existing project in <https://console.cloud.google.com/>
2. Navigate to "APIs and Services" by either using the search in Google Cloud Services or by using this link: <https://console.cloud.google.com/apis/dashboard>
3. Select "Enable APIs and Services" then search for and select "Awareness API". (<https://console.cloud.google.com/apis/library/usercontext.googleapis.com>)
4. Select "Enable" and wait until the process has finished
5. Now that the API has been enabled, lets get a key to use in the app.
   1. Select the "[Credentials](https://console.cloud.google.com/apis/credentials)" tab
   2. Click "Create Credentials" -> "API key". This will generate an ***unrestricted*** key.
   3. In the dialog with the key showing, select "Edit API key"
   4. Set the application restriction to "Android Apps"
   5. Under Android Restrictions click "Add"
   6. Follow the instructions on the screen to add your app's fingerprint to the restrictions

## Add Awareness API to Manifest

Add the following to your app's manifest and replace "API\_KEY" with the key generated using the above instructions

<pre class="language-xml"><code class="lang-xml">&#x3C;manifest>
    &#x3C;application>
<strong>        &#x3C;meta-data
</strong><strong>            android:name="com.google.android.awareness.API_KEY"
</strong><strong>            android:value="API_KEY"/>
</strong>    &#x3C;/application>
&#x3C;/manifest>
</code></pre>

## Add Feature to IMSTripManager

When adding TripDetectors, include the TripDetector.AWARENESS feature

```
 .addTripDetectors(TripDetector.AWARENESS, ...)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sdk.ims.tech/readme/android/using-the-sdk/trip-detection-and-recording/trip-manager-configuration/using-tripdetector.awareness.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
