Search This Blog

Saturday, December 1, 2018

WeightLifts 2.2.2

****** WeightLifts 2.2 and 2.1 were experiencing a bug that caused the app to crash if you selected a workout. This seems to be a result of the Units update not getting installed properly, resulting in no units being added. Without a unit, the Do Exercise screen encounters an unexpected "null" value, which causes the app to crash. 

The quick fix is to go to the Settings, then Edit Units, and add a unit. 

This will result in another crash (because it turns out I didn't tell the table how to reload properly), but on reopening the app, the unit will be there and the app should work. 

I'm uploading version 2.2.2 as I type this which should resolve all these issues. 


********** WeightLifts 2.2 +

In this version, I added two big features: syncing workout data with Apple Health, and pairing with a Heart Rate Monitor to...monitor my heart rate....and calculate calories burned during the workout. 

This required a bit of learning on my part (thank you RayWenderlich!) about how to share and access data from Apple Health and how to communicate with bluetooth devices. 

How to sync with Apple Health
Upon launching the app after downloading/updating it, you should be presented with the system screen requesting permission to access apple health. In order to calculate your calories burned, the app needs access to your sex, weight, and age, but you can choose whether or not to let it write your workouts, heart rate and calories burned to Apple Health. 


How to Pair with a Heart Rate Monitor

**I have only been able to test this with a Polar H7 heart rate strap, which it seemed to work rather well with. I'm not sure if it will work with FitBits, wrist-monitors, or the Apple Watch (but I'm hoping to get one so I CAN make it work with it), but please, let me know if it does or doesn't! 

When you start the app, it should already be set to search for heart rate monitors that are already paired to your device. By this, I mean that you have already paired the HR device to your phone BEFORE trying to pair it with the app. Then, make sure the app is set to check for heart rate monitors by going to Settings>HR monitor in the app, and ensuring the MeasureHR item is checked. 

Next, put on your HR monitor and go to the summary screen. A box will appear beneath the "Start Workout" bar when the app has successfully begun communicating with your monitor. 

If it doesn't show up, you may have to shut down and reopen the app.

Once it's paired and the box appears, you'll see your heart rate in BPM in red text. When you start the workout (by pressing on the green Start button and selecting the workout start time), another box should appear that will show your calories burned.

The calories burned are calculated using the formulas below where:

Heart rate is in BPM (taken as the average between two consecutive readings, which are taken every second or so.) 
Weight is in Kg
Age is in Years


Males: Calories = ((-55.0969 + (0.6309 * Heart Rate) + (0.1988 * Weight) + (0.2017 * Age)) / 4.184) * minutes
Females: Calories = ((-20.4022 + (0.4472 * Heart Rate) - (0.1263 * Weight) + (0.074 * Age)) / 4.184) * minutes 

Sources:
http://www.triathloninspires.com/ti_fitness_and_health/calories-burned-by-heart-rate.html
http://fitnowtraining.com/2012/01/formula-for-calories-burned/

** if anyone can point me to a more accurate formula from some trusted resource, please do! I tested the formula for males and the results I'm getting at the end of my workouts seem to match what I was getting from the Polar app. Don't take these as 100% accurate though: no formula can be 100% accurate as everyone burns calories differently based on more factors than just heart rate. 

So every reading of the monitor the app calculates the calories burned using the average heart rate of the two readings, and adds it to the total. 

At the end of your workout, pressing the Stop button will bring up a date picker to let you confirm the time you stopped working, then it will present you with a small summary. At this point you can choose to discard the workout data (which means it won't save it to Apple Health, but you'll still have your WeightLifts record of exercises done), or save it to Apple Health. 

WeightLifts does not save your hr or calorie data within the app. 


Tuesday, September 25, 2018

New App: Holter Buddy

A holter monitor is a device that records the wearer's heart activity for the period in which it is worn (usually 24 hours). Someone might be advised to wear one if they have cardiac issues and their doctor wants to get a better idea of the patients heart activity. They're about the size of a match box and have about 6 leads coming from them which are placed on various locations on the wearer's torso. While wearing one, the patient has to record (usually on a form given by the lab providing the holter) their activities and symptoms during the time they have the holter on. 

Holter Buddy doesn't make wearing the holter monitor any more comfortable, but it it takes the pain out of the note-taking. The user can make a tracker by tapping the + icon in the top right of the screen. They can give the tracker  a name, record it's ID# (if the lab assigned it one), and select the date and time at which the test began and will end. The app will also alert the user when the test is complete. With the tracker created, they simply have to tap the big red button and a screen will pop up allowing the user to record what they were doing, at what time they were doing it, and any symptoms they had.

Tapping on a tracker's row will bring up the history screen, where the user can see all the events they have recorded for a tracker. From the history screen they can also print off (or save to pdf via iOS's built in system) a report for the lab. 

Back at the home screen, the user can fill in their profile information so it will show up on the report. I've put 3 extra data fields for anything else the user wants to share, like any medications they're on. 

The app is available on the app store for free here: Holter Buddy

Monday, January 15, 2018

NwHacks 2018

I had the good fortune of being one of the 850 chosen applicants out of 2150 to attend NwHacks 2018, the largest hackathon in western Canada! The event took place on January 13th and 14th and featured coders from as far south as California and across Canada in attendance. We could work in teams of up to 5 people and we had 24 hours to produce a tech solution. I say tech because you could use raspberry pis, VR headsets, Qualcomm Boards, Arduinos, and whatever else you wanted as long as it was electronic and coding was involved. 

There was no overall theme, but the sponsors had themes they were offering prizes for. There were tech prizes, and membership prizes, and cash prizes, Nintendo Switches, gift cards, Raspberry Pi's, and lots more! The sponsors had booths set up, gave out swag, one sponsor had a TV with a N64 and Smash Bros hooked up for attendees to play. Scotiabank had a cup stacking game set up and a giant Jenga set. Attendees stayed at the event overnight, and at 3AM they had a PiƱata bash. Food was served, mini-contests were held over slack and it was overall a really good time. 

You can read more about the contest here, and you can see the submissions here.

I didn't win anything, unfortunately, but I did get some takeaways, mostly as they pertain to competing in hackathons (in no particular order):


1) Use APIs and 3rd party libraries



Everybody there used some 3rd party library or interface and it made their projects so much better. Learn to use them and use them. 


2) Have a plan



There were a good number of projects there that I have trouble believing were completely assembled in 24 hours. I'm not saying I should have memorized my entire project beforehand then assembled it on site, but I should have had an idea about what I wanted to build and considered the flow of it, what API's I'd want to use, and so on. I went in with only a minor plan (which I didn't use as I ended up following my teams plan anyway). 


3) Sit in the main hall (unless you absolutely can't focus)


My team elected to move to a quieter area in another building, and while that was great for focus, I feel like we missed out on the fun and chaos of the main hall. It's packed, yes, but there's so much else going on you really feel like part of the coder community. 


4) Don't spend so much time planning at the event



Another mistake we made was spending too much time during the planning phase. Nearly the entire first day was spent just coming up with a problem to solve and defining scope. This ties in with the idea to have a plan BEFORE you come, then fully flesh it out on site. I think coding anything before coming is cheating, but coming up with flowcharts and learning HOW to code a project (as in, learning 3rd party APIs, libraries, and languages) is fine. As long as the actual building occurres on-site. 


5) Choose the prize you want to win and build a project around the theme of that prize. 



So, for example, one company was giving away prizes for the best Social Hack. That's a theme. Another one was giving away prizes for the best Accessibility Hack, another for best banking app, and so on. Since the hackathon didn't have an overall theme, picking a sponsors theme will help you narrow down your focus. 


6) Try something new



Unless you're really intent on ensuring you win a prize, I recommend trying something new. I unfortunately used the same knowledge I used in my previous hackathon and feel I missed out because of it. The sponsors at NwHacks held information sessions about using their products and APIs and I wish I attended them. Don't make my mistake, try a new database system, try a new API. You'll come away with new ideas and feeling better about your knowledge base. 

Overall it was a really great experience and probably the first time I felt like I really belonged to part of a group. I loaded up on SWAG, participated in the contests, and although I didn't win anything (seriously, nothing, not even a cinnamon bun!), but I definitely want to try again next year. 

iTunes Apps Back Up

True to their word, Apple got back to me within 3 days and told me to try submitting the tax form again in 2 business days. I did, and it went through and my apps are back up. They're all free for now too!

Monday, January 8, 2018

iTunes Apps Currently Down

Unfortunately, my apps have been pulled from the app store while I sort out the US tax agreement. 

I released the apps while I was living in the states, and since moving back to Canada I've had to move my Apple Developer account back to Canada too. This went smoothly except for the US tax agreement, which iTunes isn't letting me complete due to "An account with that name and social security number" already existing. 

I'm working to sort it out, and this couldn't have happened at a worse time, but here we are. 


Friday, January 5, 2018

My First Hackathon

On December 3rd, I attended my first Hackathon. It was organized by BCIT and ran from 9:00 AM on January 3rd, to 2 pm on January 4th. We were put into randomly assigned groups of 5 students and given a theme to produce a solution for. The theme was "As a BCIT Student I want _____, so that ______". 

My teams solution was "As a BCIT Student I want a more useful and mobile ready MyBCIT homepage, so that I can access the site on my phone and have access to more useful information." 

The MyBCIT website is one of the 3 sites we use as students, but it's the main site we use to get our course schedules, pay our tuition, and email our professors, among many other tasks. Unfortunately, it's not mobile ready, the course schedule is about 4 links deep from the home page, the search doesn't work (it takes you to another search engine where you have to re-enter the search terms again), and the campus map isn't very useful. We sought to produce a vision of what this website could be. 

One of our goals was to integrate a useful course calendar onto the main page. We wanted it to show the current days schedule on mobile, and a week on any larger screen size. As we did not know how to link to the built-in calendar or student course data, we used Google Calendar to simulate what we envisioned. 

The second main goal was to integrate a campus map onto the Campus Life page. BCIT has a clunky but useful campus map here. We tried embed it using an iFrame, but the permissions on the page wouldn't allow us to, so we just put a placeholder pdf map. 

The final goal was to style the pages like the rest of the BCIT website (grey, blue, white, and black), and make it fit neatly on a mobile screen, which we accomplished. 

There were some areas of the original website that we didn't have the time or knowledge to rework (like the groups, email, and help sections), but we felt that our main goal was accomplished. The site even has a working login page (for a fake student). 

To build the site we used HTML, CSS, Bootstrap, PHP, and a bit of jQuery. We didn't face any major challenges, just a few hiccups like getting the login to work, and getting the calendar to resize depending on the screen size. In the end, we were happy with what we produced.