Search in sources :

Example 1 with IOUtils

use of com.klinker.android.twitter.utils.IOUtils in project Talon-for-Twitter by klinker24.

the class TweetWearableService method sendImage.

public void sendImage(Bitmap image, String url, WearableUtils wearableUtils, GoogleApiClient googleApiClient) {
    PutDataMapRequest dataMap = PutDataMapRequest.create(KeyProperties.PATH);
    byte[] bytes = new IOUtils().convertToByteArray(image);
    dataMap.getDataMap().putByteArray(KeyProperties.KEY_IMAGE_DATA, bytes);
    dataMap.getDataMap().putString(KeyProperties.KEY_IMAGE_NAME, url);
    for (String node : wearableUtils.getNodes(googleApiClient)) {
        Wearable.MessageApi.sendMessage(googleApiClient, node, KeyProperties.PATH, dataMap.asPutDataRequest().getData());
        Log.v(TAG, "sent " + bytes.length + " bytes of data to node " + node);
    }
}
Also used : IOUtils(com.klinker.android.twitter.utils.IOUtils) PutDataMapRequest(com.google.android.gms.wearable.PutDataMapRequest)

Aggregations

PutDataMapRequest (com.google.android.gms.wearable.PutDataMapRequest)1 IOUtils (com.klinker.android.twitter.utils.IOUtils)1