Getting Started With Mobile Development and IBM MobileFirst 7.1
With the recent release of IBM MobileFirst 7.1, learn how to install the platform and set up a local server for testing.
Join the DZone community and get the full member experience.Join For Free
a few days ago i blogged about the release of mobilefirst 7.1 . at the time, i really didn’t have a lot of time so i didn’t say much outside of, well, that it was released. now that i’m back home (for a few days anyway), i thought i’d write a bit more about mobilefirst 7.1 and how hybrid mobile developers can make use of it. this is going to stretch out over a few posts, mostly written today, so for now i’m just going to cover installation and basic setup.
before i get into installation, i know some of my readers still don’t quite get what mobilefirst is. hitting the home page will give you a bunch of pretty pictures and good information for managers, but as developers, we typically like things a bit more boiled down. what follows is my personal take on what mobilefirst is and why it is cool. obviously i’m not a marketer so you will forgive me if what follows is a bit more casual than typical ibm marketing.
at a high level, mobilefirst is a support system for mobile apps. it is a server product that integrates with your mobile app (and to be clear, this doesn’t impact offline support at all) and provides various different services. the server can run in multiple locations (more on that later) and includes a cli for working with mobile projects. in terms of how your mobile app is built, mobilefirst supports native, hybrid (cordova), and mobile web sites. the services mobilefirst provides includes:
- the ability to provide proxies for http, sql, and other services. so imagine your application makes use of an api that returns weather information. in a typical mobile app, your app makes a http request to the api, parses the response, and then does something with it. in mobilefirst, i can create an “adapter” that represents that api. my mobile app calls the adapter on the mobilefirst service which then proxies the call to the remote api. right away i get some freaking cool benefits. one, if the remote api returns a bunch of crap i don’t need, i can reduce the result payload to just what i want. along with reducing the result, i can do whatever i want. imagine the weather api only returns data in that weird format the rest of the planet uses. i could ‘fix’ that bug by returning fahrenheit instead. along with acting as a proxy, i also get reporting on the back end server so i can see how often the api is being called and how much data is going back and forth. finally, i can completely replace my api provider on a moments notice by updating the adapter. my mobile app wouldn’t need to know at all.
- the ability to setup android/ios push for your application. a rest api is also provided to so you can dynamically send push notifications to your mobile apps. oh, and full reporting on your use of push as well.
- the ability to manage multiple versions of your application as well as deploy new ones. so being able to deploy an update without going to the app store is pretty cool. but you can also do things like send an application message (for example, warning folks if part of your app will be down, or if a new version is coming soon, etc) as well as disable a version (imagine version 1.1 has a bad bug fixed in 1.2, you can disable and warn folks on 1.1).
- the ability to send logs to a central server (with awesome support for handling your app being offline) so that you can search them later. so if all of a sudden folks on android begin complaining about bugs, you can go to your mobilefirst server and begin searching on android logs to see if you can figure it out.
- you get a set of utilities to use within your mobile application. these utilities cover various things that might be useful. so for example, geolocation related utilities like “am i in a polygon” or “how far am i from a polygon”. or setting badge icons. or detailed network information (like is airplane mode on). these utilities aren’t something you would use on every project. they aren’t “oh my god, i’ve waited all my life for these” type things, but they are useful items that you’ll use from time to time and appreciate they exist.
- i’ve already mentioned analytics in regards to the adapters, but you get more much more analytics of course.
- support for working with existing security systems. this lets you tie in things like adapter calls to an authentication framework. i’ll be honest and say i’ve not yet played with this aspect of mobilefirst.
- finally, you can also use mobilefirst to handle your enterprise app store.
so that’s what mobilefirst is to me, and to be clear, there’s more i haven’t covered, but these are the aspects that have most interested me as a developer. if you want to check it out, note that you can do so for free. this isn’t a “trial” edition that times out, but a complete developer edition that you can use forever while testing/learning/etc.
so let’s talk installation.
working with mobilefirst requires two things – a server and a command line interface. there is one main download for mobilefirst and it includes both the server and cli, so whether you plan to run the server on your local machine or not, you’ll download the same package.
start off here: get the developer edition . you’ll need to register with ibm, but this is a one time thing and we won’t spam you. (in fact, i’m proud to say we seem to default the ‘can we send you crap’ email stuff to off , which is rare for companies.) once past the registration you’ll end up on the download page:
click the “command line interface” tab and then select the binary for your platform.
once downloaded, just run the installer and you’ll be good to go. when it is done, open up terminal or cmd and ensure things are kosher by typing
note – if you don’t prefer the cli, you can also get an eclipse add on called “mobilefirst studio”.
ok, now you have a choice. you can set up a local server for – well – local testing. (the local server can’t be used in production of course.) or you can use the new bluemix support to run a server on the cloud. you would consider the bluemix route if you wanted to demonstrate something to a client or coworker. to set up a local server, simply decide on a particular folder, and run:
mfp create servername
this is a one time command. to fire it up, you’ll do:
to stop it, do:
and finally, to get to the web based console, just do:
as for using mobilefirst with bluemix, i was planning on walking folks through that here, but we’ve got an excellent guide already online: evaluate ibm mobilefirst platform foundation on ibm containers . if any of my readers try this guide and have issues, just let me know and i’ll flesh out any confusing bits.
this post talked about what mobilefirst is, and discussed the installation and setup of an initial server. in my next post, i’ll tell you how to build a hybrid app, and discuss how the “workflow” is handled for working on your app. i’ll also discuss how you would move an existing application into mobilefirst.
Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.