I'm trying to use my wearOS app to extend my Paint app. I tried sending a Bitmap to the wear app everytime a new point was added, but that caused horrible lag.
I tried serializing a Path array, but then quickly noticed I could just pass the three different paint features, (start, move, end) via points and functions.
This is my onMove attempt:
public void sendPoint(Point p)
{
long[] newPoint = new long[2];
newPoint[0] = p.x;
newPoint[1] = p.y;
PutDataMapRequest dataMap = PutDataMapRequest.create("/count");
dataMap.getDataMap().putLongArray("count", newPoint);
PutDataRequest request = dataMap.asPutDataRequest();
Task<DataItem> putTask = Wearable.getDataClient(this).putDataItem(request);
}
Before I get into onStart and onEnd - I'd like to point out with this exact code:
public void sendPaint(Bitmap b)
{
Bitmap bitmap = b;
Asset asset = createAssetFromBitmap(bitmap);
PutDataMapRequest dataMap = PutDataMapRequest.create("/image");
dataMap.getDataMap().putAsset("profileImageX", asset);
PutDataRequest request = dataMap.asPutDataRequest();
Task<DataItem> putTask = Wearable.getDataClient(this).putDataItem(request);
}
I was able to send my bitmap.
The reason I say this is weird is becasue all I did was change .putAsset
dataMap.getDataMap().putAsset("profileImageX", asset);
to .putLongArray
dataMap.getDataMap().putLongArray("count", newPoint);
Any ideas as to why this isn't working? I noticed sendData only works if the data is new, perhaps this is the issue. In that case, I'd like to know how to erase the "data" send after it is received and used in the WearOS app.