AwarenessAPI

 AwarenessAPI

8928b5277aa7234dbca4ff782952343a?s=128

funnelbit

July 27, 2016
Tweet

Transcript

  1. 10.

    "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. 14.

    )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. 15.

    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. 17.
  5. 22.

    #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:…
 …
 }
 } …