Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send message from service #28

Open
ghost opened this issue Jun 25, 2015 · 7 comments
Open

Send message from service #28

ghost opened this issue Jun 25, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Jun 25, 2015

It is possible to receive a messages and open activities from a services. But can you also send a response message in a service. I want to be able to get data from the phone to the wearable, without the app being opened on the phone.

@XLpacman805
Copy link

I'm trying to do something very similar, except I want data from the wearable to the phone, without the app being opened on the phone.

@thedamfr
Copy link
Contributor

There is no reason it shouldn't work.
Send a Message to the service to make it start.

@ghost
Copy link
Author

ghost commented Jul 1, 2015

Sending a message to the service to start an activity work very well. But how can you send a message to a service that needs to get data from a database and then send back a response to the wear with the data. Keeping in mind that this has to be done without the mobile app being opened.

@thedamfr
Copy link
Contributor

thedamfr commented Jul 1, 2015

Send a message to the service. The message must include parameters.
Have the service fetch your data and put them in the datamap then. You should have a service or something on the wear app that listen for change on the data map. Then you are done.

Todo list :

  1. Wear app listen to dataMap
  2. Wear app send message to Mobile App's Service
  3. Mobile App Service fetch datas
  4. Mobile App Service put datas in DataMap
  5. Wear app get notified of dataMap changed

Did I answer your question ?

@ghost
Copy link
Author

ghost commented Jul 1, 2015

Thanks for the explanation! I think the problem where im stuck in is around step 4 and 5. I made a simple test app for trying to implement this setup. Is it possible for you to review my code?

@thedamfr
Copy link
Contributor

thedamfr commented Jul 1, 2015

You should submit a question on SO. There is no issue on Teleport here.

I will answer you on StackOverflow if you put a question there.

@ghost
Copy link
Author

ghost commented Jul 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants