Steppschuh / Sensor-Data-Logger

Android Wear sensor data plotter
Apache License 2.0
202 stars 73 forks source link

Implemented a basic json logger #9

Open jliebers opened 3 years ago

jliebers commented 3 years ago

Hi @Steppschuh,

first of all, thank you for your work with this fantastic app. I took a quick look at your thesis and I have to tell that we share the same goal. In my PhD I focus on getting rid of passwords as well. And for that reason I intend to log some spatial movement through an Android Wear Device (Moto 360 in my case), but I need that data logged to file for a post-hoc analysis. Whilst your app already does an excellent job of visualization, connection etc., I am glad to add this missing feature (#8). 🙂 🚀

Please find a pull request for some basic logging functionality that adds a second floating action button to start and stop the logging of the selected sensors to a JSON file. The file then is stored in Android's external storage in a directory resembling the package name. I also added some example data. It is only a very basic implementation, so please do not judge me (I did some Android in the past, but that's quite some years ago), but I think it does the job and it might be better than nothing. Also I tried to comment/document the most important things in the code.

If you have any comments I am open for feedback. I would be very happy if you could review the changes and in case of approval, please push an update to Google Play.

On a side note, I also had some troubles getting Gradle and the wear-build to work. Reason lies within some wear-library on version 1.4.0 being removed from the mirrors. So I had to fetch the files from an unofficial mirror and place them at this location: %appdata%\..\Local\Android\Sdk\extras\m2repository\com\google\android\support\wearable\1.4.0 (Win10). After that I built the app.

Everything was tested on a Sony Xperia XZ2 Compact and a Moto 360 smart watch.

Cheers!

Steppschuh commented 3 years ago

Hey Jonathan, thanks for your contribution! I'll look into this on the weekend and get back to you.

Regarding the deprecated wearable dependency: Are there breaking changes when updating to a newer version? If not, it might be easier to just migrate to a more recent version (same applies to other dependencies).

jliebers commented 3 years ago

Hey Stephan,

Regarding the deprecated wearable dependency: Are there breaking changes when updating to a newer version? If not, it might be easier to just migrate to a more recent version (same applies to other dependencies).

I tried to update the libraries but to be honest I am not an expert on Gradle or the Android Build ecosystem. So I naturally ran into lots of problems and gave up after ca. 2 hours of trying. Instead I opted to run the old build as described. But most likely someone with more experience can sort it out easily ... or not (as I cannot know). 😉

Cheers,

Jonathan

jliebers commented 3 years ago

Hey,

thanks for the feedback, I find it valuable and I will incorporate it once I find the time (probably around the weekend). Thanks!

Cheers,

Jonathan

jliebers commented 3 years ago

Hi, thanks for the feedback. I have included all of it and pushed a new commit to my branch. 🙂 If you like, take a look. Thanks in advance.

PS: I have tested the new implementation on a LG LM-K510 with a Moto 360.