android wear - Does Wearable.DataApi.getDataItems users UriMatcher -
i'm trying extract data wearable.dataapi matches wear:/someattr/*
the motivation i'm using putdatarequest.createwithautoappendedid since want avoid overriding data written in wearable device.
i match following uri:
wear:/someattr/3/rand1 wear:/someattr/2/rand2 wear:/someattr/3/rand6
but avoid
wear:/someotherattr/3/rand1
can use wildcard data dataapi?
i have current workaround of not providing uri wearable.dataapi.getdataitems brings data includes unwanted dataitems wish avoid.
any ideas?
i found solution in similar question @dzeikei
from android official documentation
int filter_prefix filter type getdataitems(googleapiclient, uri, int), deletedataitems(googleapiclient, uri, int): if filter set, given uri taken path prefix, , operation apply matching items.
so in order match example use
uri.builder builder = new uri.builder(); builder.scheme(putdatarequest.wear_uri_scheme).path("someattr"); uri uri = builder.build(); pendingresult<dataitembuffer> pendingresult = wearable.dataapi.getdataitems(googleapiclient, uri, dataapi.filter_prefix);
Comments
Post a Comment