DEVELOPERS BLOG

UCOSP 2013 Wrap Up and Looking Ahead

EVENTS / 02.03.14 / timwin1

UCOSP_image

Photo by Mike Baird used under Creative Commons

This past fall the BlackBerry WebWorks community worked with the UCOSP program again, which engages four students from different universities in Canada to work on Cordova Plugins. Together, we added three more plugins which work with both Cordova and WebWorks 2.0. One of those students, Alex from the University of Toronto, wrote a follow up piece on the work done and his experience this term:

This semester I was given the opportunity to contribute to the BlackBerry WebWorks Community API with two Cordova/PhoneGap plugins under the umbrella of UCOSP. Working with fellow UCOSP’r Jasmin Auger on both of these plugins, I learned the importance of reading a massive codebase and of developing code incrementally.

Developing PhoneGap/Cordova plugins gave me the chance to create something that could be of use to other developers. As Javascript wrappers for native plugins, Cordova plugins allow anyone to develop mobile applications. They would only need to know Javascript, which is easier to pick up than other programming languages usually needed for mobile development (such as Java and C++). It’s a great way to democratize development. In particular, I worked on developing two plugins for BB10 devices using Cordova: the MessageBox plugin and the BarcodeScanner plugin. The MessageBox plugin allows BB10 developers to display alert messages in their applications with only eight lines of code. The BarcodeScanner plugin allows users to scan barcodes and obtain information from the barcodes. Since this was a pre-existing plugin from a previous UCOSP project, our goal was to re-write parts of the plugin so that it adheres to PhoneGap/Cordova standards.

Learning the importance of reading a massive codebase, and developing code incrementally, went hand in hand with project development during the semester. The eight lines of code of the MessageBox plugin appeared only after reading hundreds of lines to code. From this I understood the “philosophy” of PhoneGap/Cordova and we discovered an already coded solution (in particular, the Notification object of PhoneGap) which was used to arrive at our small treasure. The BarcodeScanner took the bulk of the semester, and that is where I learned that developing code incrementally could save hours of time. I admit to committing a rookie mistake: considering how relatively quickly the MessageBox plugin was developed, I estimated that porting the BarcodeScanner plugin would take a short amount of time. So I coded everything at once, and thought that everything would work just fine. Wrong! I got inexplicable errors. So I went back to the drawing board and decided to build everything piece by piece, finally paying heed to what I was taught during introductory CS courses: “Develop your code incrementally. Constantly test.” Not only did the plugin come along quickly, I felt a degree of attachment to the code I was writing: I was understanding it, and everything flowed logically.

There is nothing like reinforcing the lessons learned in CS courses with real world experience. It is even better when you can do it while contributing to the democratization of mobile development. The UCOSP experience has provided me with both.

Besides the BarcodeScanner and MessageBox plugins, another student ported the ExtractZipFile. The new term has already started for the four Canadian students, and they have started on porting some of our WebWorks 1.0 Community Extensions to the Cordova/WebWorks 2.0 plugin format. They are working on DeviceInfo, Thumbnail, GSECrypto, and Vibration.

Three students from American schools will be joining the team in February, and our kickoff Sprint will be held at Facebook HQ again in Palo Alto, California on February 7-9. If you’re interested in following along with the code being written, we’ll be tweeting with the hashtag #bbucosp at times, and all the code will be going into the public BlackBerry repositories on GitHub. We’d also appreciate your input and contributions to our open source projects. Contact me to get started: @timothywindsor on twitter or on GitHub.

About timwin1