uMobile PhoneGap Exploration
Overview
- Looking at a PhoneGap wrapped HTML5 solution as a way to build once and deploy native applications to both Android and iOS platforms.
- uMobile is currently built on jQuery, jQuery Mobile, Backbone and Underscore (older versions).
- A user is provided with 3 views: Home, Module and Preferences (Login screen).
- All three views always exist and live in the index.html. View visibility is toggled off and on.
- Portlet web views or modules are loaded into an iframe in the Module view.
- Local and CAS authentication have been implemented. Experiencing some issues with Local and CAS authentication.
Completed
- Reviewed the existing codebase.
- Documented the uMobile code base with the yuiDoc tool.
- Updated documentation for Android development environment.
- Updated documentation for Web or HTML5 development environment.
- Updated documentation for iOS development environment.
- Cleaned up project files and directory structure.
- Added basic markup to mocked modules (i.e., Courses, Calendar, News).
- Separated out Backbone implementation into separate files (i.e., Models, Collections, Views and Services).
- Implemented automated build script for the front-end.
- HTML is complied.
- CSS is minified.
- JavaScript is linted, optimized and minified.
- Cordova (PhoneGap) files are programmatically added to the application based upon environment (i.e., iOS, Android, Web).
Recommend Improvements
- Create a separate JIRA for the uMobile project.
- Foster community support and discussion around recommendations and roadmap.
- Improve existing screens and screen work flow.
- What types of screens or views do we want to offer?
- Develop wireframes for proposed screens and solicit feedback.
- Develop responsive screens for both tablet and smartphone.
- Add logout / login access to all screens and not just the preference screen.
- Fix styling issue with the guest login button.
- Add native support for more portlets or mocked modules (i.e., Courses, Calendar, News).
- Current implementations for mocked modules are empty except for the Map module.
- Improve the login screen.
- Provide better error handling and client side validation.
- Implement application localization.
- Develop an overall approach to error handling.
- How should the UI respond to a failed request?
- How should the UI respond to failed login attempts?
- How should the UI respond to a failed request for user layout data?
- Upgrade libraries and technology stack for better application scalability and maintainability (See: Proposed Technology Stack).
- Implement automated JavaScript unit tests for more complete code coverage.
- Implement a CI environment for the uMobile project.
- Resolve issues with Local & CAS login implementation.
- Portal and portlet icons for display on Retina displays.
- Implement Shibboleth authentication.
- Implement inter-module linking.
- Implement native map and directory functionality.
- Implement back button for external modules.
- Consider offline functionality approach.
Proposed Technology Stack
The uMobile PhoneGap implementation, in its current state, is just a prototype and additional work is needed to increase the application's maintainability and scalability. The below technology stack aims to modernize the uMobile application as well make the code base as easy to use and accessible to wide range of development skills. The recommendations listed below seek to create a code base that is modular, documented, testable through automated build tools and able to be integrated into a CI build environment.
*Note: Recommendations assume that portlets and modules will be loaded into an iframe and that the uMobile application owns and controls routes and can freely manage the application url. In addition, some of the technologies and statements listed below are the opinion of two developers currently working on this code base. Statements are open for discussion.
- Upgrade to the latest PhoneGap version.
- Upgrade to the latest jQuery version.
- Update to the latest Underscore version.
- Remove the fluid library from the technology stack.
- Remove jQuery Mobile from the technology stack.
- Only using jQuery Mobile to manage views & provide out of the box styling.
- Implement a responsive approach instead for tablet and smartphones (i.e., Bootstrap).
- Implement Require.js.
- Require.js is script loader for JavaScript applications.
- Allows script tags to be loaded in parallel.
- Ships with r.js, a build tool that minifies and optimizes JavaScript code.
- Integrates with grunt.js, front-end build tool.
- Migrate code base from Backbone.js to Angular.js.
- Backbone is more of a toolset than framework.
- Must piecemeal application framework together with Backbone.
- Angular is built by google & updated often.
- Vibrant community with a lot of documentation and video tutorials.
- Google is actively addressing developer pain points.
Provides clear separation of code (i.e., Controllers, Services, Resources, Directives & Filters).
- Implement angular router to manage page views.
- Implement Testing framework.
- Leverage Grunt.js, PhantomJS, Jasmine.js libraries.
- Consider using Yeoman.js.
Project Setup
- iOS Development Environment
- Android Development Environment
- Web Development Environment
- BlackBerry Development Environment
- Windows Development Environment
Project Architecture
Proposed Roadmap
The S (small), M (medium) and L (large) letters at the end of each item signify the amount of effort to complete the task. The below tasks have been color coded based upon there current progress.
- Not Started
Completed- In Progress
- Issue Reported
March 2013
- Temporarily disable PhoneGap Session Tracking. (S)Â
- Upgrade to latest PhoneGap version. (S)
- Update community documentation with upgrade information. (S)
- Clean up application CSS layer. (S)
- Resolve login issues with Login implementation.(M)
- The mock and local implementations are all functional.
- There is an issue with the CAS implementation.
- Provide error handling and client side validation for Login. (S)
April 2013
- Upgrade to latest jQuery version. (S)
- Upgrade to latest Underscore version. (S)
- Upgrade to latest Backbone version. (S)
- Remove fluid from the technology stack. (S)
- Implement the require.js & r.js library and build tools. (M)
- Remove jQuery mobile view management and replace with Backbone view management. (M)
- Remove jQuery mobile theme (css) and replace with twitter bootstrap for responsive design (i.e., Tablet & Smartphone display). (M)
- Implement lightweight CSS layer with Less framework (i.e., Tablet & Smartphone display). (M)
- Add additional support, where needed, to mobilize existing portlets and modules. (M to L)
June 2013 and Beyond (After the conference)
- Improve existing screens and screen work flow (i.e., wireframes).
- Re-implement the PhoneGap Session Tracking.
- Port application from Backbone to Angular.
- Implement application localization.
- Implement automated JavaScript unit tests.
- Implement a CI environment for the uMobile project.
- Portal and portlet icons for display on Retina displays.
- Implement Shibboleth authentication.
- Implement inter-module linking.
- Implement native map and directory functionality.
- Implement back button for external modules.
- Implement offline functionality approach.