To develop Mobiliti apps, you must install the following:


Mobiliti employs a web browser metaphor where the mobile app connects to a web server during startup to get configurations and schemas of the content it will display on the device.  Included in this architecture are additional application servers and/or database servers for handling content.  The installation steps outlined here will set up those servers and prepare the development environment for creating apps and corresponding server components.


Android development is done with the Eclipse IDE.  Install Eclipse and the Android SDK according to their respective installation guides onto your development machine.  Also install Java and Tomcat on your server.  When finished, create two Eclipse projects to hold your Android app and the server code.  You can create the projects by importing Mobiliti provided stub projects.

Create an Android project in Eclipse

Before creating an app, you must set up an Android project in Eclipse. Start by importing the supplied MobilitiAndroid project into Eclipse.  After it is imported, you can refactor/rename the project for your own Android project.

After the import, open up the project properties and be sure the jars shown below are selected for the build path.

Create a Server project in Eclipse

Next, create a Java project in Eclipse to contain your server programs. Start by importing the supplied MobilitiServer project into Eclipse.  After it is imported, you can refactor/rename the project for your own server project.

After the import, open up the project properties and be sure the jars shown below are selected for the build path.


Once the Eclipse projects are created, you will need to configure and modify them to support your particular application.

Update the Android project

Every Android app has an AndroidManifest.xml file that presents essential information about the application to the Android system, information the system must have before it can run any of the application’s code.  Please review the Android Developer’s Guide documentation to understand the structure and content of the manifest.  Mobiliti requires specific manifest settings to remain as provided, but the following need to be updated for your app:

  • package=”yourPackageNameSpace”
  • android:label=”Your App Name”
  • android:icon=”@drawable/yourAppIcon”
  • android:theme=”@style/yourAppTheme”
  • <meta-data android:name=”mapsKey” android:value=”yourGoogleMapsKey” /> (optional)
  • <meta-data android:name=”facebookKey” android:value=”yourFacebookKey” /> (optional)

Mobiliti is designed to use Google Maps and Facebook.  They are optional so if your app doesn’t need these services, you can remove the respective manifest entries.  See the sample manifest below with the XML areas to be changed highlighted in bold.

<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”;





android:label=”Your App Name



<activity android:name=”” android:screenOrientation=”nosensor” >


<action android:name=”android.intent.action.MAIN” />

<category android:name=”android.intent.category.LAUNCHER” />



<activity android:name=”” android:screenOrientation=”nosensor” />

<activity android:name=”” android:screenOrientation=”nosensor” />

<activity android:name=”” android:screenOrientation=”nosensor” />

<uses-library android:name=”” />

<meta-data android:name=”contentURL” android:value=”http://your/contentDir” />

<meta-data android:name=”mapsKey” android:value=”yourGoogleMapsKey” />

<meta-data android:name=”facebookKey” android:value=”yourFacebookKey” />


<uses-permission android:name=”android.permission.INTERNET” />

<uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” />

<uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION” />





android:anyDensity=”true” />

<uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”8″ />

<uses-configuration android:reqTouchScreen=”finger” />


Note:  The framework provides built-in support for Google Maps and Facebook.  Supply your respective keys in the meta-data properties of the manifest to turn those features on.

Update the Server project

The server project contains several configuration files found in the WEB-INF directory.  The open source logging facility log4j is used for server logging.  Update the file as needed for your environment.

If you will be connecting the server to a relational database, you must modify the persistence.xml file.  Mobiliti uses the Java Persistence API (JPA) and Hibernate for database access and persistence.  Mobiliti is pre-configured to use the optional c3p0 connection pooling software. There are other Hibernate subcomponents you may install for your particular needs if you wish. You may alter other parameters in the persistence.xml and files to fit your server’s environment.  At a minimum, change the parameters shown in bold below:

<?xml version=”1.0″ encoding=”UTF-8″?>
<persistence version=”1.0″ xmlns=”; xmlns:xsi=”; xsi:schemaLocation=””&gt;

<persistence-unit name=”ServiceFactory” transaction-type=”RESOURCE_LOCAL”>



<property name=”hibernate.archive.autodetection” value=”class”/>

<property name=”hibernate.format_sql” value=”false”/>

<property name=”hibernate.show_sql” value=”false”/>

<property name=”hibernate.dialect” value=”org.hibernate.dialect.MySQLDialect” />

<property name=”hibernate.connection.driver_class” value=”com.mysql.jdbc.Driver” />

<property name=”hibernate.connection.url” value=”jdbc:mysql://databaseURL” />

<property name=”hibernate.connection.username” value=”username” />

<property name=”hibernate.connection.password” value=”password” />

<property name=”” value=”update”/>

<property name=”hibernate.order_updates” value=”false”/>

<property name=”hibernate.generate_statistics” value=”false”/>

<property name=”hibernate.connection.provider_class” value=”org.hibernate.connection.C3P0ConnectionProvider” />

<property name=”hibernate.c3p0.acquire_increment” value=”3″ />

<property name=”hibernate.c3p0.min_size” value=”3″ />

<property name=”hibernate.c3p0.max_size” value=”15″ />

<property name=”hibernate.c3p0.max_statements” value=”0″ />

<property name=”hibernate.c3p0.idle_test_period” value=”300″ />

<property name=”hibernate.c3p0.timeout” value=”600″ />




Note: the web.xml file is used by Mobiliti and should not be altered!

Generate keystore

Android apps require a keystore file that is used during app generation for signing the app.  Please review the Android developer documentation here for more information.  You can create the keystore manually or use the sample Ant build.xml shown below.

Create Ant build.xml (optional)

Ant can be used to automate many tasks for building and deploying code within Eclipse.  You can use the sample below to help create a build script for your projects.

<project name=”Ant tools” default=”deploy”>

<property name=”workspace” value=”/your/workspace/path” />

<property name=”alias” value=”yourAlias” />

<property name=”keystore” value=”your.keystore” />

<property name=”password” value=”yourPassword” />

<target name=”deploy”>

<echo message=”Building the war file”/>

<war destfile=”${workspace}/yourAppDir/yourApp.war

webxml=”${workspace}/yourAppDir/WEB-INF/web.xml” update=”false”>

<zipfileset dir=”${workspace}/yourAppDir/content” prefix=”content”/>

<classes dir=”${workspace}/yourAppDir/WEB-INF/classes” />

<classes dir=”${workspace}/yourAppDir/bin” />

<lib dir=”${workspace}/yourAppsDir/lib” />



<target name=”keystore”>

<echo message=”Generating keystore”/>

<delete file=”${keystore}” quiet=”true” failonerror=”false”/>

<genkey alias=”${alias}” keyalg=”RSA” keypass=”${password}” storepass=”${password}” keystore=”${keystore}” validity=”10000″ dname=”cn=???, ou=???, o=???, c=??“/>





%d bloggers like this: