Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Wear

Android Wear

• Basics of Android Wear
• Devices & User experience
• Before Development
• While Developing

Salim KAYABAŞI

October 17, 2014
Tweet

More Decks by Salim KAYABAŞI

Other Decks in Programming

Transcript

  1. Agenda • Basics of Android Wear • Devices & User

    experience • Before Development • While Developing
  2. • Less interruption, more connectivity • Extending interactions • What

    you need, when you need • Informations that moves with you
  3. Preparing • Required android version is 4.3 and above •

    Lastest Google Play Services and Android Wear application • Internet connection over paired device • Android Studio > 0.8 • Gradle > 0.12 • Wearable support library
  4. Remember • Lower battery and smallest screens • Notify when

    if it is important • Show relevant actions • Content oriented • Micro interactions • Use your hardware (like heart rate monitor)
  5. Do not • Miss the point • Need to go

    beyond what phone can do • Games, Flashlight, Readers, Drawing
  6. Data Sharing PutDataMapRequest dataMap = PutDataMapRequest.create("/path-to-data"); dataMap.getDataMap().putInt(DATA_KEY, yourObject); PutDataRequest request

    = dataMap.asPutDataRequest(); PendingResult<DataApi.DataItemResult> pendingResult = Wearable.DataApi .putDataItem(mGoogleApiClient, request); @Override public void onDataChanged(DataEventBuffer dataEvents) { for (DataEvent event : dataEvents) { if (event.getType() == DataEvent.TYPE_DELETED) { Log.d(TAG, "DataItem deleted: " + event.getDataItem().getUri()); } else if (event.getType() == DataEvent.TYPE_CHANGED) { Log.d(TAG, "DataItem changed: " + event.getDataItem().getUri()); } } }
  7. Messages SendMessageResult result = Wearable.MessageApi.sendMessage( mGoogleApiClient, node, START_ACTIVITY_PATH, null).await(); if

    (!result.getStatus().isSuccess()) { Log.e(TAG, "ERROR: failed to send Message: " + result.getStatus()); } @Override public void onMessageReceived(MessageEvent messageEvent) { if (messageEvent.getPath().equals(START_ACTIVITY_PATH)) { Intent startIntent = new Intent(this, MainActivity.class); startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startIntent); } }