Using a MobileFirst Hybrid application as a container for server-generated pages
This tutorial covers the following topics:
- Migrating applications to IBM MobileFirst Platform Foundation
- Running your application on the Android emulator
- Running your application on the iOS emulator
- Sample application
Migrating applications to IBM MobileFirst Platform Foundation
- By using mobile web technology, you can deploy applications to the widest variety of devices.
- The existence of public application stores, such as Apple iTunes and Google Play, changes the way applications are hosted and marketed. These changes make traditional methods of distribution less relevant.
- IBM MobileFirst Platform Foundation provides the solution to build cross-platform applications that can be distributed through the application stores by using the hybrid application programming model.
Creating MobileFirst applications
From a terminal window, use the following CLI commands to add a project and application:
Next, add a required environment, for example Android:
In MobileFirst Studio, create a new project, "UsingApplicationAsAContainer"
A project might host multiple applications. However, in this tutorial, you use only one app:
You can set the target environments either while you are working in the MobileFirst Project wizard, or later.
IBM MobileFirst environments
- IBM MobileFirst Foundation provides a model for organizing the application project structure for each target environment (for example, Android, iPhone, iPad).
- You select your target environment through the MobileFirst Environment wizard.
IBM MobileFirst Common environment
- The simplest way to use MobileFirst apps as containers for server-generated pages is through the Common environment.
- Open the
application-descriptor.xmlfile and edit the
mainFiletag to point to
Running your application on the Android emulator
- Build the Android environment.
- Deploy the application.
- Right-click the generated Android project and click Run As > Android Application.
You can see that the
http://m.ibm.com URL is displayed in your Android emulator.
Running your application on the iOS emulator
- Deploy the application to your iOS emulator.
- Right-click the IOS environment and click Run As > Xcode project.
Click to download the sample.▲
Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.