Search code examples
androidandroid-contentproviderwear-os

Can android wear access a content provider from the mobile device?


Since android wear and mobile are two separate devices, is the wear device able to access a public content provider from a custom app that's on the mobile once it is connected? Thanks.

edit: if you downvote, pls comment why, as your downvotes don't help me understand anything.

edit2: Ok, let me explain a little more. I'm creating a watch face that displays some useful data along with the time and to do that I need to access a content provider from my watch face. Can I access a content provider from an app thats on my phone through my android wear? So far my testing has been unsuccessful in trying to access a content provider directly through getContentResolver().

I could use dataApi to send info to the wear device, but that would require the app also be running on the phone right? So question still remains, How would I retrieve content provider information from an app?


Solution

  • On the watch, you do not have direct access to the providers from the companion phone. The wearable support library provides access to the Calendar Provider and that is the only one that I can remember is available on the watch directly; for the rest, you need to go through the data layer APIs and have a phone component to retrieve the data and send it to or sync it across the watches.