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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -