Red Hat Mobile Cheat Sheet
The Basics
The Red Hat Mobile Application Platform is a platform for building, deploying and managing mobile applications & their backend integrations. It supports flexible development models, and allows developers to use tooling of their choice. Source code is integrated using Git, and the platform is agnostic to client-side mobile technology stack. The platform categorises its features in the following structure:
Projects |---Client Apps: Anything which will be deployed on a mobile phone device |---Cloud Apps: Node.js microservices used for all server-side logic specific to this project. Services & APIs: Re-usable node.js microservices to be used by multiple projects. Drag & Drop Apps (D&D herein): Forms-based rapid mobile app development functionality |---Forms: Develop forms with no coding needed. Forms get associated projects. |---Themes: Style D&D forms with an interactive theme builder. Themes get associated with projects.
Comparing Client Apps, Cloud Apps & Services
Client App |
Cloud App |
mBaaS Service |
|
|---|---|---|---|
![]() |
![]() |
![]() |
|
| Purpose | Building mobile phone apps | Project-specific serverside logic & APIs | Creating re-usable integrations for projects to consume |
| Programming language | Various (JS, ObjC, Java, Swift, ...) |
Node.js | Node.js |
| Runs on | Mobile phones | Server side | Server side |
| Project specific? | Yes | Yes | No Re-usable across projects |
| Storage |
|
|
|
Client SDKs & APIs
The client SDK is used to build logic which runs on the mobile phone device. Typically, developers will build user interface manipulation on the client device, and use the $fh.cloud SDK to integrate with the server-side logic they have built.
Client SDKs available
Here's a quick description of the different supported client-side technologies, along with the tooling developers can expect to use with each.
| Javascript | Android | iOS | .NET | |
|---|---|---|---|---|
| Technology/Language | Apache Cordova, Appcelerator & other web | Java | Objective C & Swift | .net, Xamarin |
| Build farm support | Yes | Yes | Yes | No |
| Dependency system | NPM (Usage optional) |
Gradle (Usage optional) |
CocoaPods (Usage optional) |
|
| Auto-init Does the SDK initialize itself automatically? |
Yes | No (Call $fh.init manually) | ||
| Config file Each SDK needs this file to tell it how to initalise |
www
|--fhconfig.json
|
$PROJECT
|--fhconfig.plist
|
assets
|--fhconfig.properties
|
$PROJECT
|--$PROJECT.Shared
|--fhconfig.json
|
Available APIsWhat APIs are available on what platforms? |
||||
| $fh.cloud Call a cloud app & execute server-side logic |
Yes | Yes | Yes | Yes |
| $fh.init initialize the SDK |
Yes (But happens automatically) |
Yes | Yes | Yes |
| $fh.sync | Yes | Yes | Yes | Yes |
| $fh.push Register & receive device-level push notifications |
Yes | Yes | Yes | Yes |
| $fh.auth | Yes | Yes | Yes | Yes |
| $fh.sec | Yes | No (Native alternatives exist) | ||
| $fh.hash | Yes | No (Native alternatives exist) | ||
| $fh.forms | Yes | No | No | No |
JavaScript Client SDK
Here are some of the most frequently used JavaScript client SDKs. The full list is available, along with examples for other client technologies (Java, Swift, etc) by reading the client API documentation
| Function | Code snippet |
|---|---|
| $fh.cloud |
|
| $fh.push | Remember to first set one, two, threein fhconfig.json.
|
| $fh.sync |
initialize the sync service - call this first.
Then, tell the sync service what dataset(s) to manage. Here, we're registering a dataset called shopping. The Options, Query Params and Metadata can just be empty objects {}, but they need to be provided in order.
Now that we've registered a dataset, we need to listen to sync events. It's here we'll trigger UI updates to reflect our changes.
Now that we know what events are important to trigger UI update events, let's see what a list operation looks like. This operation does not always trigger a serverside call, so can return very fast with data from the local store. Let's do a list operation on our shopping list dataset.
We can also create records in our shopping dataset.
Update, read and delete operations are similar, we just need to provide a record UID after the dataset name:
|
| $fh.auth | Remember to first set one, two, threein fhconfig.json.
|
Node.js Cloud & mBaaS Service SDK
As we mentioned above, the cloud application is used for server-side business logic specific to a project. The mBaaS Services are re-usable components which these Cloud Apps talk to. Both are written using a server-side JavaScript technology called Node.js. The Node.js SDK is published to NPM (Node's dependency management solution) as fh-mbaas-api. You can include it in your cloud apps & mBaaS Services by doing the following:
var $fh = require('fh-mbaas-api');Some of the most common Cloud API calls follow, but you can see the full list by visiting our Cloud API documentation.
| Function | Code snippet |
|---|---|
| $fh.service |
Call another mBaaS Service. Can be used to call cloudapp-to-service, or service-to-service.
|
| $fh.cache |
Cache data in the redis key-value store.
|
| $fh.db |
Store data in the platform MongoDB. You can also use the MongoDB Node.js Driver directly, but depending on your version of the platform, you may need to "upgrade" your database.
|


