I am posting today because i think i was able to do something pretty impressive using no programming at all (as i said in an earlier post, i like to tweak around) but instead using Tasker and Google Spreadsheet. I've built a spreadsheet which enables me to track my android battery draining problem. That will hopefully in the end enables me to fix it!.
Without further due, here is what it looks like:
1: Creating the Google Spreadsheet with a Google Form
Then, once you have the form, you need to retrieve the names of the input HTML elements (to do this i used Google Chrome's inspect element functionality (in that case it was entry.2.single (i had 4 actually, going from 0 to 3))
On the android phone, the task was a bit more complicated, i had to create a tasker profile that started when I disconnected my phone from a charger, and ended when i reconnected it.
For the profile to do what i wanted, I then needed to create a task that recorded the battery charge when entering the profile as well as the time, and then another task that did the same when leaving the profile, that is when i reconnected the phone to the charger.
On the profile exit task, i then needed to be able to send the data to Google data and that's where the Google form came in useful. Tasker has a really nice feature which makes it possible to interact with the Google form, it can actually send HTTP Post Requests! I found a really nice page that helped me with the creation of the request, but since this page was written, some things changed and the way to do it isn't exactly the same, i had to experiment a bit there, but you won't have to since i did it for you!
this part was a pain and not fun at all. I'm a programmer at heart and this just felt like the wrong way to do stuff.
i had to use a complicated combination of split() function, time(), date(), if() and other stuff in order to get the number of hours the phone was disconnected, i had to take into account the date and the time, this way if the phone was disconnected one day and only reconnected the next, the number of hours would still be accurate.
after that, the creation of the graph was really simple, just had to use the appropriate function in Google Spreadsheet.
It's only been 2 days since i created this, so i am not entirely sure if it works correctly all the time, but i will report back when i know more.


