Getting Started
The following is recommended to get up and running quickly:


goals


Important tips for starters

Represent your data in Documents

MOBBL Documents are fast, flexible and provide a range of services out of the box. They are backed by NSDictionaries and include validation, sorting, difference calculation and deep copy. Every objc class you write to represent data will have to be re-written on other platforms. Furthermore you will have to implement all supporting services yourself. Stay away from handwritten data objects. They are a path towards the dark side. Check our the sample apps for examples of using MOBBL Documents.

Core-data is not portable

Core-data is an object-relational mapping tool for iOS apps. However there is no equivalent on other platforms. So anything you write in Core-Data will have to be written by hand on other platforms. If you have a little knowledge of sql*lite, core-data is probably not worth the hassle anyway. Much easier to write your own persistence code. Which is what we have done in MOBBL, so you don't have to. And it ports easily.

Nib files and Storyboards

Nib files (extension .xib) allow developers to develop screens with a graphical WYSISWYG ditor. Nib files can easily be incorporated into a MOBBL based app which is in fact a recommended practice. There is no substitute for Nib files for efficient development of iOS views. The sample apps have examples of how to use a Nib in a MOBBL based app. Storyboards (from xcode 4 and up) however replace the Controller layer in MOBBL and have no equivalent on other platforms. Which means the navigation will have to be re-written on other platforms.

Prerequisites

To use MOBBL and its dependency libraries for your iOS development you will need

Installing custom template

  1. git clone -b mk7 https://github.com/kstenerud/iOS-Universal-Framework.git
  2. cd "iOS-Universal-Framework/Real Framework"
  3. sh install.sh

Creating a new Mobbl project

Installing the project generator

If you haven't installed the Mobbl project generator yet, here's how to do this:

  1. Download and install NodeJS, if you do not have it installed yet. It is available for Windows, Mac OS X and Linux
  2. Install the project generator tool by executing the following command in your terminal (you probably need to use sudo, with the standard install):
    $ npm install -g mobbl-generator

Using the project generator

These are the steps you need to take, if you want to create a new iOS project with Mobbl:

  1. Perform the steps described in preparing your Eclipse workspace, if you haven't done so already.
  2. Open a terminal and execute the following command:
    $ mobbl-generator
  3. The project generator will ask you a few questions about the project(s) you're about to create. Let's create a project with the following details:
    • Platform: Option 1, iOS
    • Project name: my-new-ios-app (we type "*" for where we want "ios" or "android' to appear)
    • App title: My New App
    • Bundle identifier: my.new.app
    • Project location: current directory
    • Class prefix: XYZ
    $ mobbl-generator
    prompt: Which platform do you want to generate a project for?
    1. iOS
    2. Android
    3. iOS & Android
    :  (1) 1
    prompt: Project name (* will be substituted with ios or android):  my-new-*-app
    prompt: The display name of the app:  My New App
    prompt: Bundle Identifier / Package name:  my.new.app
    prompt: At what location should the project directories be created? (Current directory is /Users/mobbl/Developer):  (.) 
    prompt: Class prefix:  XYZ
  4. Change into the directory of the downloaded template app project and download the project's dependencies using maven:
    $ cd my-new-ios-app
    $ mvn initialize
  5. Open the Xcode project file located in src/xcode using Xcode
  6. Customize the project to your liking
  7. Build and run the app

Using our template app

We have an app template on GitHub for you to customize and use as a base to start working with Mobbl. Here's how you use it:

  1. Get the source code of our template app from GitHub.
  2. Open a terminal, change into the directory of the downloaded template app project and download the project's dependencies using maven:
    $ cd /path/to/project
    $ mvn initialize
  3. Open the Xcode project file located in src/xcode using Xcode
  4. Customize the project to your liking
  5. Build and run the app

Sample apps

To get inspired, sample apps are available here:https://github.com/ItudeMobile/itude-mobile-samples

Adding Mobbl to your existing project

These are the steps you need to take, if you want to use the Mobbl products for your own project:

  1. The supported way to use Mobbl is by using Apache Maven to manage software dependencies. Because of this, your project needs to be mavenized. This means it should build with Maven, and have a maven structure. Have a look at the template or sample applications on how this works.
  2. Change/add Maven settings in your project pom.xml
    • Add dependency: mobbl-core-framework:
      <dependency>
          <groupId>com.itude.mobile.ios.mobbl</groupId>
          <artifactId>mobbl-core-framework</artifactId>
          <version>${core.framework.version}</version>
          <type>xcode-framework</type>
      </dependency>
    • Include ItudeMobile Repo
      <repositories>
          <repository>
              <id>itudemobile-github-repository</id>
              <name>ItudeMobile Github repository</name>
              <url>http://mobbl.org/maven-repository/releases</url>
          </repository>
      </repositories>
    • Include ItudeMobile Plugin Repo
      <pluginRepositories>
          <pluginRepository>
              <id>itudemobile-github-repository</id>
              <name>ItudeMobile Github repository</name>
              <url>http://mobbl.org/maven-repository/snapshots</url>
          </pluginRepository>
      </pluginRepositories>
  3. Open a Terminal and go to the folder containing the pom.xml.
  4. Run the following command: mvn initialize
  5. Include the LICENSE file in your project
  6. Open XCode and navigate to Build Settings tab.
  7. Add the next lines to the header search path:
    "${PROJECT_DIR}/../../target/xcode-deps/frameworks/${BUILD_STYLE}/com.itude.mobile.ios.mobbl/mobbl-core-framework/mobbl-core-framework.framework/Versions/A/Headers"
    "${PROJECT_DIR}/../../target/xcode-deps/frameworks/${BUILD_STYLE}/com.itude.mobile.ios.mobbl/mobbl-core-framework/mobbl-core-framework.framework/Versions/A/PrivateHeaders"
  8. Add the next line to the framework search path:
    "${PROJECT_DIR}/../../target/xcode-deps/frameworks/${BUILD_STYLE}/com.itude.mobile.ios.mobbl/mobbl-core-framework"
  9. Go to your default target > Build Phases > Link Binary with Libraries > click +
  10. Click "Add Other..."
  11. Add mobbl-core-framework.framework
  12. Now add the following lines to your pch file (no more #import "MB*.h" needed!)
    #ifdef __OBJC__
      #import <Availability.h>
      #import <mobbl-core-framework/mobbl_core_framework.h>


Sample apps

Sample apps are available here:https://github.com/ItudeMobile/itude-mobile-samples

Generate appledoc

The MOBBL library includes appledoc documentation. You can add that to your XCode installation to help you during development.

The MOBBL API documentation is contained in the source code (.h files). While the documentation is readable by looking at the .h files directly, it is possible to generate formatted documentation from the source code comments and installing it in XCode. The advantages are that

  • it looks better
  • it is more readable
  • the documentation can be searched
  • the documentation on a class or method of the framework can be inspected using the familiar XCode key bindings
To get this documentation in XCode, you need to generate and install it using the Appledoc tool. After this, the framework documentation is available in the XCode Organizer. Appledoc reads the configuration options from the file AppledocSettings.plist in the root directory of itude-mobbl-core.

Additional documentation

Further documentation available are: