Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

AwarenessAPI

 AwarenessAPI

funnelbit

July 27, 2016
Tweet

More Decks by funnelbit

Other Decks in Technology

Transcript

  1. "XBSFOFTT"1* mGoogleApiClient = new GoogleApiClient.Builder(this)
 .addApi(Awareness.API)
 .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {


    @Override
 public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
 Log.e("onConnectionFailed", "failed");
 }
 })
 .build();
  2. )FBEQIPOF Awareness.SnapshotApi
 .getHeadphoneState(mGoogleApiClient)
 .setResultCallback(new ResultCallback<HeadphoneStateResult>() {
 @Override
 public void onResult(@NonNull

    HeadphoneStateResult headphoneStateResult) {
 switch (headphoneStateResult.getHeadphoneState().getState()) {
 case HeadphoneState.PLUGGED_IN :
 Log.e("ϔουϗϯ", "ૠ͍ͯ͠Δ");
 break;
 case HeadphoneState.UNPLUGGED:
 Log.e("ϔουϗϯ", "ૠ͍ͯ͠ͳ͍");
 break;
 }
 }
 });
  3. 8FBUIFS Awareness.SnapshotApi
 .getWeather(mGoogleApiClient)
 .setResultCallback(new ResultCallback<WeatherResult>() {
 @Override
 public void onResult(@NonNull

    WeatherResult weatherResult) {
 if (weatherResult.getWeather() == null) return; weatherResult.getWeather() .getConditions()
 }
 });
  4. #SPBEDBTU3FDFJWFS public class MyFenceReceiver extends BroadcastReceiver { … @Override
 public

    void onReceive(Context context, Intent intent) { if (TextUtils.equals(fenceState.getFenceKey(), "startWakingFence")) {
 switch(fenceState.getCurrentState()) {
 case FenceState.TRUE:…
 case FenceState.FALSE:…
 case FenceState.UNKNOWN:…
 …
 }
 } …