In a previous article titled Mobile Apps and the Web
, I talked about how there are various approaches to Mobile:
- Mobile Web
- Hybrid Apps
- Native Apps
The Web 2.0 and Mobile Feature Pack
gives you the components needed to build a Mobile Web Solution. However, as I discussed, there are cases when you need Hybrid solutions. Examples of requirements are:
- App Store Deployment.
- Access to Native Features like the Camera or contact list.
- Offline capabilities
There are a few solutions out there. One open source solution is PhoneGap
. There are various ways you can use the Feature Pack with PhoneGap to address some Hybrid scenarios.
- You can package your HTML web mobile app within PhoneGap.This would include creating a Dojo Build specific for your mobile app. That app would run completely local. (You can make REST calls for Data). In this scenario, your application upgrades require full deployment to the App Store.
- You can logically split your components as well, running some of your artifacts from the app and loading some web content from your server. In this way, you can have more control of your upgrades.
Some techniques you can apply: Loading Dojo From Remote Source:
Navigating to remote function:
<li id="policyMenu" dojoType="dojox.mobile.ListItem" url="http://myServer/Insurance/service/service.html" transition="slide" sync="false">
Manage Your Policy
Capture Dojo Transition event and check for network before loading remote view.
//Use PhoneGap API to check for network connection, if not there, return false.