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);
}
}
Aggregations