Splicer Blog

Accelerating Native Mobility

Mobile App SDK and Form Generator for Accessing Relational Data

Announcing our free Enterprise low code solution! This tool allows you to generate an android SDK that correlates to the data structures in your relational database. It includes a server model that you can deploy to any JPA-compliant ORM like Hibernate, along with web and Android forms. With it, you can apply low code efficiencies to open source, java server stacks combined with native mobile clients.

This blog post details how to use Splicer object model and forms generator, which is part of the Splicer low code stack. The generator is on our home page, and works in conjunction with various open source source projects found here.

Demonstration of open source, model-driven design (MDD) for Android
This demonstrates the android form generator, retrieving type-safe model data from a webservice, and storing/fetching model data in the Realm.io mobile database:

  1. Clone our android project.
  2. Clone our sample models project. To view the CAM template (.cam file) in this project, download and install the CAM Editor. General information about CAM is available here.
  3. Import the droid project into Android Studio and run it within an emulator.
  4. Click on the menu, then “fetch json” to view. This demonstrates retrieving data from a RESTful webservice, storing in Realm.io object database upon retrieval, and then the View displaying data the data in that database.
  5. Next, click on dropdown –> “Forms”. This form is dynamic, and based on our model. The project —QMBForm — that draws the forms is fully open source. Hence, this project demonstrates how models defined in CAM drive open source droid forms.
  6. To create your own client/server models, navigate to our home page and upload your cam template. This will return a newly generated model.

Phase 2: Create a custom android SDK that correlates to your relational database schema

  1. You should already have the CAM editor open with the sample template open for editing.
  2. Open the Cam preferences dialog by clicking “CAM Template Editor” menu item, then “Preferences”. Click “CAMEditor” drop-down, then “CAM Editor XSLT Transform”. Scroll to the bottom and you will see the following: Set stylesheet
  3. In that last input box, click “browse” to find CAM-SQL-designer.xsl in our Model-Samples project (under “xsl/tools” dir) as such: Set stylesheet 2 Click “apply” and “OK”.
  4. To create a droid model from your database, connect to your database, then drag-and-drop as outlined in this CAM video1. Make sure to use our working CAM template instead of creating a new one. Also, we need to add an additional step to this process. In the video, David instructs you to click the button to switch into “designer mode”. After you do that, we need to assign a namespace for your database: click the button just to the right of “designer mode”. The following dialog box will appear: Set Namespace 1
  5. Now click “set namespace” and enter the following string into the input box: “splicer=http://splicer.models”. Click “ok”. Next, change the “renaming mode” to CamelCase. The dialog box should look like the following: Set Namespace 2
  6. Click “ok” and then you can proceed to drag-and-drop your table structures into the left-hand-side of the tree. Drop your root elements beneath ModelRoot; here is what my model looks like after I dropped a “Metrics” element from one of my databases: Drag and Drop Sample
  7. Save your cam template (*.cam file), surf to the Splicer home page, and upload your .cam file. Note that the “namespace” input box should contain the “splicer” namespace as we set above. This will dictate the package name of your droid model classes.

This process allows you to create your own custom mobile app SDK for free as part of the Splicer low code stack. The Splicer stack is a practical and light-weight “low code” solution using established open source modules and standards. By propagating the type-safe model out to your clients, you can then leverage the open source form generators to create dynamic forms.

We also support IOS and will provide details on that in a future blog post. Drop us an email in the mean-time if you urgently need help with that.

  1. Note all the CAM-related videos are here