Questions tagged [google-awareness]

A unified sensing platform enabling applications to be aware of multiple aspects of a users context, while managing battery and memory health.

Google's Awareness API unifies 7 location and context signals in a single API, enabling you to create powerful context-based features with minimal impact on system resources. Combine optimally processed context signals in new ways that were not previously possible, while letting the API manage system resources so your app doesn't have to.

76 questions
16
votes
3 answers

Awareness API & Android O using BroadcastReceiver

I have an Android app which uses the Awareness API to setup a fence when a headset is plugged in. I have implemented the AwarenessFence using code much like in the examples at: https://developers.google.com/awareness/android-api/fence-register. I…
9
votes
2 answers

Awareness API. Get location.failure on certain phones

Awareness.SnapshotApi.getLocation(client) .setResultCallback(new ResultCallback() { @Override public void onResult(@NonNull LocationResult locationResult) { if (locationResult.getStatus().isSuccess())…
8
votes
2 answers

BroadcastReceiver stop working on Xiaomi after couple of hours

I'm using Awareness API for my project and receiving actions via BroadcastReceiver. This is the question with my code: link. The problem is that everything works fine in all android version except in Xiaomi devices. Where BroadcastReceiver not…
Dim
  • 4,527
  • 15
  • 80
  • 139
8
votes
1 answer

Awareness API Query for Fence State

I am trying to get fence state with the Awareness API. Here is the documentation about this. But... When using: Awareness.FenceApi.queryFences I can see its deprecated, and instead need to use: Awareness.getFenceClient Can anyone please give me an…
Dim
  • 4,527
  • 15
  • 80
  • 139
7
votes
4 answers

Google Awareness API SecurityException is thrown

I'm using DetectedActivityFence from Google Awareness API. It's working fine on my own devices, but I received a several crashes in Crashlytics about SecurityException. Fatal Exception: java.lang.SecurityException: Invalid API Key for package =…
andrei_zaitcev
  • 1,358
  • 16
  • 23
6
votes
1 answer

Google Awareness Api events while app isn't running

I would like either a BroadcastReceiver or IntentService (depending on how long my eventual processing takes) to start when a Google Awareness API "fence" fires. For example, perhaps I want to know how many times I activate a set of beacon fences…
William T. Mallard
  • 1,562
  • 2
  • 25
  • 33
6
votes
1 answer

Awareness API - Place type home

On google awareness API Guides page there is mention about Context types. Contextual data includes sensor-derived data such as location (lat/lng), place (home, work, coffee shop) However, on reference page with Places type Place reference,…
poss
  • 1,759
  • 1
  • 12
  • 27
5
votes
0 answers

DetectedActivityFence not triggering?

As the title suggest, I'm trying to use the new Awareness API, which works great but the DetectedActivityFence that never gets triggered, no matter what I do, sometimes it gets triggered immediately after it gets registered and that's all. Tried…
5
votes
1 answer

onResult() in Awareness.SnapshotApi.getLocation NOT getting called from a Service

I am trying to get location from a background Service. The problem is that the onResult() function inside the Awareness.SnapshotApi.getLocation(mGoogleApiClient).setResultCallback(new ResultCallback() is NOT getting called. What…
user1406716
  • 9,565
  • 22
  • 96
  • 151
5
votes
1 answer

Awareness Snapshot API's Weather stuck for days across locations and weather change

When I started looking at getting the weather using the relatively new Snapshot API I was a bit puzzled/concerned when I couldn't find any sort of timestamp on the results being returned. I implemented the usage of the API and everything seemed ok…
Roy Solberg
  • 18,133
  • 12
  • 49
  • 76
4
votes
0 answers

Google's time fence using Awareness API is not reliable

I am building an SDK that is using Google Awareness API. I have some actions that need to be executed based on different schedules for each day, also when the app is backgrounded - a perfect match for Google's FenceClient or so I thought. The…
Ofir A.
  • 3,112
  • 11
  • 57
  • 83
4
votes
0 answers

Android Things - Unable to get Weather and Location

I'm trying to use the Google Awareness API in my IoT Project, however, when calling the Weather and Location API I'm receiving TIMEOUT errors. Gradle: compile 'com.google.android.gms:play-services-awareness:11.0.4' provided…
DaniloBertelli
  • 121
  • 1
  • 5
4
votes
5 answers

Google Awareness API, Invalid API key, Crash

This is my first attempt at creating an android application. In trying to use the Awareness API provided by Google I receive a SecurityException in logcat, and the error: "Invalid API Key for package = com.example.android.project. Status code…
Alexander
  • 410
  • 5
  • 14
3
votes
1 answer

Awareness API: com.google.android.gms.common.api.ApiException: 15

In my onCreate I call the following function to detect the weather. private void detectWeather() { if( !checkLocationPermission() ) { return; } Awareness.getSnapshotClient(this).getWeather() …
Bram
  • 2,515
  • 6
  • 36
  • 58
3
votes
0 answers

android activity recognition with awareness API inconsistent

I have driving detection setup with the Awareness API for with fences for "starting" and "stopping". Problem The app detects that I'm driving about 50% of the time, but often only if/when I turn the screen on while I'm driving. This defeats the…
Neil MacMillan
  • 208
  • 2
  • 8
1
2 3 4 5 6