3

I'm recently developing apps on android wearable(MOTO 360).

My question is, is it possible to save the sensor data as a file in my watch? Or I must sent those data back to my handheld to save?

I try to use File directory = Environment.getExternalStoragePublicDirectory("/groundTruth"); to save sensor data into a file in my watch. But it seems not work.

Since I need to collect real-time accelerometer data for 5-10 mins, I need to save those data in a file somewhere for future analytic in Matlab.

If any of you have some resource about android wearable sensor data collection, could you also provide me with some example code?

Thank you guys very much!

Luyang Liu
  • 121
  • 1
  • 7

2 Answers2

0

I used SharedPreferences - as in any other Android device and it worked. I don't know how much data you are looking to save but it should be enough in that case.

Michał Tajchert
  • 10,333
  • 4
  • 30
  • 47
  • Actually I need to collect real-time accelerometer data for 5-10 mins. And after that, I also need to copy this file to matlab to do analytics. I don't think `SharedPreferences` could work in my case. – Luyang Liu Nov 23 '14 at 20:04
0

You can write on the memory of your wearable, yes, but careful about the storage capacity. Just declare the file as you would on any other Android devices, and it should do the trick. However, you will have to work a little on the data given by the sensor, as the results are stored as arrays. Try formating a String with them, or better store them as a JSON File.

Tony Malghem
  • 222
  • 2
  • 11
  • Thank you very much for this answer, I would like to save them as a .csv file. There is still one thing, since MOTO 360 uses wireless charging technique, there's no port on the watch to connect to PC. Do you know how to access to its storage? – Luyang Liu Nov 24 '14 at 22:00
  • I don't think you can access the internal memory of a watch as you do with a regular Android device or an USB stick. The best way may be to forward your file once recorded to your handheld through the Data API, and then retrieve it from your computer. – Tony Malghem Nov 25 '14 at 08:44