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

Starting/Stopping Data Collection from Smartphone #10

Open
Mustafa-raja opened this issue Sep 7, 2024 · 5 comments
Open

Starting/Stopping Data Collection from Smartphone #10

Mustafa-raja opened this issue Sep 7, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Mustafa-raja
Copy link

The library documentation states:

Start/stop data collection from smartphone

The library fully handles this for you. You can start and stop the data collection from the smartphone and receive the collected data. You have to do nothing!

While this suggests that the library supports starting and stopping data collection from the smartphone, it does not provide any details or examples on how to trigger these actions.

Request:

Could you please provide additional documentation or examples on how to:

  • Start data collection from the smartphone.
  • Stop data collection from the smartphone.

Detailed instructions or code snippets demonstrating these functionalities would be greatly appreciated.

Additional Context:

This information is crucial for integrating the library into applications where control of data collection needs to be managed from a smartphone rather than the Wear OS device.

Thank you for your assistance!

@matey97
Copy link
Collaborator

matey97 commented Sep 9, 2024

Hi @Mustafa-raja, as stated in the second paragraph of the README:

This library can be used to build WearOS applications that are the counterpart of smartphone applications built with the nativescript-wearos-sensors plugin (for the NativeScript framework). The smartphone application counterpart can request to start/stop the data collection on the smartwatch, and then receive the collected data from the smartwatch.

Basically, starting/stopping the data collection from the smartphone is possible when the smartphone application uses the nativescript-wearos-sensors NativeScript plugin. The main drawback is that the smartphone application has to be developed using NativeScript (a multiplatform development framework) and not native technologies (why? to integrate this feature into another set of features that we already developed in NativeScript).

Therefore, to use this library and control the data collection from the smartphone, there are two options:

  1. Develop a NativeScript app and use the nativescript-wearos-sensors plugin. There is a demo application in the plugin's repository that you can check, and the last release contains an apk you can install and test.
  2. Implement in the smartphone the required components to handle the communication (start/stop, receive data, etc.) with the smartwatch. Basically, the smartwatch and the smartphone communicate using the Android's Message Client using a defined protocol. So the smartphone needs to implement its communication protocol part. For example, to start the data collection of the ACCELEROMETER, the smartphone sends a message with the desired collection interval and return batch (interval#batchSize) to the path /accelerometer/start. It would be like translating the nativescript-wearos-sensors code (TypeScript) into Java/Kotlin. I would not recommend it, but if you need a native application this is the only way.

Let me know if you need more information or further assistance.

@Mustafa-raja
Copy link
Author

Thank you for the reply, I used Google's data layer API to establish communication. It would be good to have the communication feature added for Android using java/kotlin

@matey97
Copy link
Collaborator

matey97 commented Sep 9, 2024

I know it would be nice to have a smartphone native library. However, right now I'm busy with other things and can't commit to develop it. I might do it in the future, but can't promise anything or give an ETA. Sorry 😞.

@matey97 matey97 added the enhancement New feature or request label Sep 9, 2024
@Mustafa-raja
Copy link
Author

would you mind if i fork your code and build those features on it ?

@matey97
Copy link
Collaborator

matey97 commented Sep 10, 2024

Of course you can! But bear in mind that you will have to build those features in a specific library for the smartphone. I mean, WearOSSensors is meant for smartwatches, thus you should create another library/app for smartphones.

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

No branches or pull requests

2 participants