Tag Archives: cordova

Strategies for Managing App Versions & Updates With IBM MobileFirst Foundation (aka Worklight)

IBM MobileFirst Foundation provides two mechanisms to manage app versions and updates.  Neither requiring you to write any additional code!

The first is app versioning; MobileFirst Foundation tracks each version of an app that you deploy, and gives you the ability govern or restrict access to specific platforms and versions. App versioning applies to all apps, native or hybrid, on any platform that MobileFirst Foundation supports. The second is Direct Update, which allows you to push new HTML/CSS/JavaScript (web) resources to a MobileFirst hybrid app. Direct Update only applies to hybrid apps, but it works for any platform that MobileFirst supports.

App Version Management

When you deploy an app to the MobileFirst Foundation server, the server will automatically track versions based on the version number specified in you application-descriptor.xml file.

Set Application Version
Set Application Version

When you load the MobileFirst Foundation Server Console, you’ll be able to view all of the deployed app platforms and versions.

The screenshot below shows a hybrid app deployed for both Android and iOS platforms. You would also be able to see the exact same version and platform information for native apps that leverage IBM MobileFirst Foundation.

Managing Versions in the MobileFirst Console (click to enlarge)
Managing Versions in the MobileFirst Console (click to enlarge)

You’ll notice in the MobileFirst console that next to each platform/version you can set the status for that version. This makes it possible to set notification messages for users on specific platforms and versions, or even restrict access to specific platforms and versions.

For example, look at the screenshot above… Version 1.0 on Android is active. Version 1.2 on iOS is active. Version 1.1 on iOS is notifying, and Version 1.0 on iOS is disabled.

There are 3 statuses that can be set for each platform and version combination.: Active, Active Notifying, and Access Disabled.

Set Platform/Version Status
Set Platform/Version Status

When you set the status of a platform/version, this status is only for that specific platform/version pair. This enables you to selectively notify users of specific versions, or even block access to specific versions if they are outdated and no longer supported.

“Active” means that the application is active. Services to this version will operate normally, and no messages will be presented to the user.

“Active Notifying” means that the application is active, services will continue to work, but a message will be presented to the user when the app becomes active, or when a service request is made to the MF server.

Setting Active Notification Message
Setting Active Notification Message

This can be used to send any text-based message to the app users. This could be a deprecation notice, service maintenance notice, or any other general notice.

Within the app, the user will see a message when the app becomes active, or when a request is made to the server. This message can be dismissed, and the app functionality is not impacted in any way.

In-App Active Notification Experience
In-App Active Notification Experience

“Access Disabled” means that access to the application is disabled. In this state, a notification message will be presented to the user, and access from the app version will be disabled. The user will also be presented with an “Upgrade” button, which will redirect the user to any URL, which presumably will be for an updated version of the app.

Setting Disabled Status
Setting Disabled Status

In this state, the app will not be granted access to the MobileFirst/Worklight server. So, if your app requests data from a data adapter, all requests to the adapter from this platform/version will be blocked. If your app initialization code is inside of the Worklight client’s connect:onSuccess handler, then this can prevent your app from loading at all.

In-App Disabled Experience
In-App Disabled Experience

Again, When you set the status of a platform/version, this status is only for that specific platform/version pair.

You can learn more about managing applications through the MobileFirst/Worklight Console using the Administering Worklight applications with Worklight Console online documentation.

Direct Update

MobileFirst hybrid applications leverage Apache Cordova plus MF-specific APIs as a foundation to deliver hybrid apps. Apache Cordova enables developers to build natively-installed cross platform apps using web technologies.

Direct Update is a feature for MobileFirst hybrid apps, which enables you to push updated app content (HTML, CSS, & JavaScript) without the user having to deploy a new version of the app through the app store.

Direct Update is considered an additional security feature b/c it enforces users to use the latest version of the application code. However, when an app uses Direct Update, it *only* updates the web resources.  No native changes or version # changes will be applied. However, it should not be abused. In particular this will bypass the Apple’s app store approval process. You should not overhaul the entire UI and break Apple’s Human Interaction Guidelines, otherwise you could be kicked out of the app store.

Direct Update User Experience
Direct Update User Experience

By default, the update’s user experience is a modal overlay that shows download and installation progress. The updater’s UX can be configured to use silent updates that do not block the user’s experience, can be a completely custom user experience, or can be disabled altogether.  Updates can also be paused or resumed using the JavaScript API so that it does not block the user from performing a critical task, however this would require a custom UI – the default UI does not enable pause/resume.

Updates in the current version of Worklight (6.2) are complete updates containing the entire application (www) code, however MobileFirst Foundation 6.3 (coming this month) will have a Differential Direct Update feature that includes only the changed files. More detail will be posted once this is available.

Direct Update can also be disabled if you don’t want your hybrid apps to update automatically.

For more information on Direct Update, be sure to check out these additional resources:

Additional note:  If you’re wondering by I interchange MobileFirst and Worklight in this post, it’s because Worklight is now MobileFirst Platform Foundation

Embarking Upon A New Adventure

I’m excited to finally announce that I have embarked upon a new adventure!  Today marks my first day as a MobileFirst Developer Advocate for IBM!

IBM

So, what does that mean?

It is very similar to what I was doing back at Adobe focusing on developers.  I’m excited to engage with the development community around building mobile apps and leveraging cloud services to meet critical business needs.  I’ll be focused on IBM’s MobileFirst platform, including Worklight – a platform for building and delivering mobile applications leveraging Apache Cordova (PhoneGap), and Bluemix – IBM’s scalable cloud computing platform, which can be used for everything from hosted services, “big data”, security, back-ends for mobile apps, Java, node.js, ruby, and much, much more… Seriously, check out everything that Bluemix has to offer.

It is my mission to help you, the developer or business decision maker be successful, and now I have access to IBM’s tools, knowledge and services to back me up!

Will I still be building apps and services?

  • YES – stay tuned for more info

Will I still be helping you build apps, and writing about development tools, paradigms, and best practices?

  • YES – it’s my mission to help you make the right decisions and be successful

Will I see you at the next development conference, hackathon, or meetup?

  • YES, and I can’t wait to show you everything IBM has to offer.  

Will I still be flying drones?

  • Of course! However, I won’t be blogging about drones and creative tools quite so much. Follow me on Flickr to see images from my latest flights, and feel free to ask me questions.

I had a great run with Adobe, and am thankful for all of the opportunities while there.  I worked on many amazing projects, worked with a lot of great (and very, very smart) people, and was able to continually push the envelope on both the development and creative/media sides. For which I am grateful.

Now, let the next adventure commence!

Your business has tough questions? Let’s ask Watson.

DevNexus 2014 PhoneGap Presentations

I’ve just wrapped up my presentations for this year’s DevNexus event in Atlanta – it has been a great event, filled with tons of information on web, mobile, and back-end development. I had 3 sessions on PhoneGap – One intro, one advanced, and one a mobile frameworks panel.

Below are my presentations.  I didn’t record them this time, since they were being recorded by the conference organizers, so expect to see a video once they’re released.

Just press the space bar, or use the arrow keys to view the presentation in your browser.

Getting Started with PhoneGap and Cross Platform Mobile Development

View Presentation …

intro_2_pg

(Lesson learned, never make changes to you presentation/environment after midnight when you have the first session of the day – it will always bite you)

Designing & Architecting for PhoneGap & the Mobile Web

View presentation …

architecture_pg

Enjoy, and feel free to reach out with any questions!

Automating PhoneGap Builds

I’ve recently had several conversations with PhoneGap users around processes for automating the compilation of PhoneGap apps.  This could be either in automated tasks using GruntAntMaven, or any other task manager, or could be in continuous integration environments like Jenkins CI.

If you’re interested in this, here are a few options… First of all, PhoneGap Build has a REST API. You can use this to programmatically create new projects, update projects, trigger new builds (even just for specific platforms), etc… This can integrate with your build scripts and tie into any workflow.

If you’re using GitHub, it is possible to tie into hooks triggering PhoneGap Build to recompile every time you commit your code.  Here’s an example of it in action, or you can just use this service which is already setup: http://autobuild.monkeh.me/ (from the same author) – Just be careful with your user/pass in plain text. Update: You can also use the Autobuild service using a clientID variable instead of sending through username and password details via HTTP.

If you aren’t using PhoneGap Build, you’re not out of luck.  All PhoneGap CLI commands are based on scripts, which themselves can be scripted.  You could use ANT’s exec command, the Maven exec plugin, Grunt exec or Grunt shell plugins, Jenkins execute shell, or any other task runner to manually invoke the PhoneGap CLI. You just need to make sure all your environment and path variables are correct to access SDKs and required programs. However, there’s one caveat… iOS builds require Xcode/Apple developer tools, which have to be run on a Mac.

If you’re using Jenkins, this might be a good one to check out: Jenkins CI + PhoneGap & Cordova