Tizen Daylight App
Here is my first app to be written on the Tizen OS for wearables. The purpose of this post is to share the story of how I came up with this idea and also all the valuable lessons learned in the process of development.
1. Component reusability:
Always design software to be as generic and reusable as possible. Remember my blog post about the time-lapse video taken using the raspberry pi?. I utilised both the same API’s and code from that program. Using the devices IP address I could fetch the time the sun was going to set/rise. I chose not to use the inbuilt GPS radio on the device for power efficiency and user privacy. Plus there was no need for such great accuracy in the user’s location for this use case.
2. Don’t reinvent the wheel:
Modern software development is very community focused and thanks to the information super-highway it is easy to keep track of the best practises and techniques. Always remember whenever you face an issue don’t forget to check out how the community reacts to it. because it is very likely that someone somewhere would have faced or even solved the exact same issue. In this app I started by following the guides and writing primitive XHR requests that didn’t have promises or follow the reactive programming pattern. This is what the apps code base looked like originally.
The problem I was facing was that I was trying to do things synchronously in the land of asynchronous functional programming. I was assuming things would happen in the same sequence they were written in. But then it struck me that the app is basically javascript running in a browser so I decided to go the angular js way.
3. Always have fun:
Not all things are built with purpose. I found this app to be highly impractical and certainly not profitable. Which is why I have decided to open source it. But I learned a lot of things in the process and had a lot of fun during the development. I learned a lot about the Tizen ecosystem and wearable design in general. There is always something to be learnt.
Scope for improvement.
- Add the ability to set an alarm for sunrise or sunset.
- Change background color of the app to represent the sun’s current state (like f.lux)
- Provide more valuable information such as UV index.
I might be taking a small break from my blog as I am working on bigger things with my undergrad friends. Watch this space for more soon. Feel free to clone/contribute to this project on Github
Update (9/27/16): There was a daylights savings time bug where the times shown were off by one hour since they did not account for DST adjustments. This has been fixed by importing and using moment.js which does a good job handling anything time related.