Wednesday, June 12, 2013

Enterprise Mobile App: Mobilizing a MySQL database

At OpenMobster, we have laser sharp focus on mobility for Enterprise information systems. Our entire architecture is designed from the ground up to mobilize data stored in various Enterprise backends. We enable mission-critical apps that have the type of features mentioned in this detailed blog entry. With that in mind, I thought to myself, wouldn't it be a good idea to develop an App that possesses all the above features and can be used as a tool for developers to learn how to build such an App. Hence, I have built an Enterprise App that shows end-to-end integration with a MySQL database backend. This App is built on top of the OpenMobster Mobile Backend Platform and has the following characteristics:
  • Enterprise integration using the Sync Channel Framework
  • Offline Support and Fast Data Access
  • Continuous Backend Scanning and Data Push from the Cloud
Before we start dissecting the code for this App, I would like to walk you through the Build, Deploy, and Run Phases of the App so you can use the App yourself and see what it can do. Here are the steps to use the App.

Video
The instructions that will follow in this blog entry are also executed in a video available on YouTube. To skip the instructions and jump to the App in Action jump to the 13:00 minute of the video. It will show how the App can be used including CRUD operations and Push Notifications from the Cloud.

Setting up the Development Environment
Part of getting your environment ready to run the App (both Android and Backend side), you must have the following installed:
  • Android SDK
After installing these systems, you have to register appropriate environment variables with the OS. For more details about setting up your OpenMobster environment please look at: https://code.google.com/p/openmobster/wiki/Build_OpenMobster_Development_Windows. Take a look at Step 5 to make sure your environment variables are set according to what is mentioned.

Get the source code for the MySQL App
The command to checkout the source code for this project is:
svn checkout http://openmobster.googlecode.com/svn/samples/mysqlapp

Build the project
To make sure everything is environmentally correct you should do a full build using the command:
mvn -DskipTests install

Prepare the MySQL database
You must prepare the MySQL database that will be used to integrate with this App. You can do this using the standard mysql command line tool that ships with all MySQL distributions. From the tool to create a database named mysqlapp issue the following command:
create database mysqlapp;

Run the OpenMobster Cloud Server
At this point, you are ready to run the OpenMobster Cloud Server that provides the Mobile Backend for the Android App. When you start the server, it will setup the rest of the MySQL database by adding the necessary table. The command to start the Cloud Server is as follows:
cd mysqlapp/cloud
mvn -PrunCloud integration-test

Install the App on an Emulator or a Real Device
Once, the Cloud Server is running, you are ready to use the App. To install the App on an emulator or a real device issue the following command:
cd mysqlapp/app-android
mvn -Papp-hot-deploy install

Start using the App
You are ready to use the App. You can perform all CRUD operations in the App and have the data synchronized with the backend in online or in offline state. Also, any data inserted into the database will be pushed to the App using the Push Notification Engine. To see this in action, you can insert data into the table using the following command:
insert into data_object (syncId,field1,field2,field3,field4) values ('1','test1','test2','test3','test4');

I hope these instructions allow you to Build, Deploy, and Run the App with end-to-end integration with a MySQL database. In the next few entries, we will dissect the code behind the App. Until then please take the App for a spin and let us know how we can keep improving!!!!

Update: A deep dive into the Backend integration code for this project is now published at: http://openmobster.blogspot.com/2013/06/mobilizing-mysql-api-based-backend.html.

Please stay tuned for the Android App deep dive in our next post. I would check back early next week. Have a great weekend!!!!

Thanks
Sohil
CEO, OpenMobster, Open Source MBaaS Platform
ShareThis

3 comments:

  1. Your so helpful for me thanks for sharing good content on this blog.
    App Monetization Strategy


    ReplyDelete
  2. ppcelerator survey also shows most enterprises don't have internal chief of mobile development, despite rising number of OSes. For more information on mobile apps, check out my site: http://www.simplymobileapps.co.uk/

    ReplyDelete
  3. There are various online sources to provide you informative details on this topic, but this is one is very helpful.

    Mobile Enterprise Service

    ReplyDelete