Getting Started: Learn

Mobile apps built on Akula are comprised of two components:

  • Akula services that run on the Akula server -  These services, called app scopes, enable functionality around data integration, authentication, authorization, credential storage, policy enforcement, data routing, and business logic. As part of building your mobile app, you develop Akula app scopes to perform tasks such as accessing your back end data, handling client data sync, and enforcing security.
  • Client apps that run on a mobile device – Implement user access through a log in/log out mechanism, interact with the Akula server and services through REST endpoints to access backend data sources, and provide support for offline functionality.

This document contains an overview of how to build both types of components and includes the following sections:

Building app scopes for the Akula Server

Build app scopes for the Akula Server by using XML files to configure built-in modules that are supplied with Akula and by using the Akula Server SDK, a Java SDK that lets you build custom modules as part of the app scope. This document describes the general process of how to build an app scope.

Design your app scope

When designing an app scope, consider the following:

  • Gather information about the backend resources that you want to access from the app scope, such as URLs, database names, SQL queries used to access the database, and any credentials required to access these resources. You need this information to define the routes of an app scope.

  • Define the endpoints and HTTP access methods required by a client app to access your back end data through the app scope. For example, for a read of a back end database, you can define an endpoint on the app scope accessed with a GET HTTP request. To write to the database, you can define a different endpoint that supports a PUT request, or define a single endpoint that supports both a GET and a PUT request.

  • Determine if you can access your back end resources by using a prebuilt module supplied with Akula, or if you have to create a custom module. Akula ships with a SQL module that lets you connect the app scope to a JDBC database, and an HTTP module that lets you connect the app scope to HTTP-based services, such as REST and SOAP. If your data source is not supported by a prebuilt module, you can develop a custom module to access it.

  • Define the routes for each endpoint. Routes define one or more modules used to process a request from a client to an endpoint or to process the response from an endpoint to the client. Your app scope can have any number of routes.

Notice that this simple design does not include any discussion on security or access control on the endpoints. To get you started building apps, you build your first app with no security in place. As you work through the app development process, you can add additional features such as security, offline support, and other features. For an introduction to offline apps, see Developing Offline Apps. For an introduction to security, see Applying Security.

Build and deploy your app scope

An Akula app scope is defined by an AKZ file, which is an archive file that you deploy to the Akula Server. You create an AKZ file from an Akula project by using the Java jar utility. Akula projects are logical structures of files that you typically organize within your IDE's workspace.

For more information on creating app scopes

This document introduces you to the process of creating app scopes. For detailed information, see:

Building client apps

Build client apps that run on a mobile device and connect to the Akula Server over HTTP(S) by using the SDKs supplied with Akula for Android, iOS, and JavaScript. Each of the Akula client SDKs defines the classes and interfaces that you use to build a client app that can connect to the Akula Server. These SDKs are designed to simplify the process of building a request to the server and handling a response. By using these SDKs, you can focus your development resources on other areas of your app.

Design your client app

When designing a client app, consider the following:

  • What types of mobile devices will you support? For example, do you have to support Android, iOS, and JavaScript apps, or just a subset? Akula supplies an Android, iOS, and JavaScript SDK. Alternatively, you can make direct HTTP(S) requests to the Akula Server without using any Akula SDK.

  • What app scope endpoints does the client app use to log in, access data, or access other back end resources? Each endpoint on an app scope is defined by the URL of the endpoint, an HTTP request method (GET, PUT, POST, DELETE), a request object, and a response object. As an example of the type of information required by a client app to access an endpoint, see REST API Reference. This reference describes the information required to access every endpoint built into the Akula Server.

  • What security restriction have been applied to the endpoints? For example, are all endpoints available to all users, or are some endpoints restricted to a subset of users? The Akula security mechanism can validate user access to an endpoint to ensure that only authorized users are allowed to access it.

  • How does the server represent backend data? Much of the work of a client app is the downloading of data from the server, and the uploading of data back to the server. The client app must know how the server represents the data. The Akula SDKs include classes that let you model backend data, and to represent groups of models in collections.

  • Will your app work when the mobile device is offline? Akula contains several features designed to support offline data access, but you must built that functionality into your client app.

Build and deploy your client app

Client apps connecting to the Akula Server typically perform the following actions:

  1. Ensure that you have the correct SDK installed for the type of client app that you are building. For example, make sure that you have the JAR file for the Akula Android SDK installed if you are building an Android client app.

  2. Initialize a connection to the app scope running on the Akula Server.

    Call the init() method (Android and JavaScript) or the the initialize: (iOS) method of the AK class to initialize the connection. Pass the URL of the app scope running on the Akula Server. For example, for the HelloWorld.akz file described above, pass the URL:

    http://localhost:8080/akula/HelloWorld

  3. If the app scope uses the Akula authentication mechanism, prompt the user to log in to the app. The server is typically configured to authenticate users against an enterprise authentication service, such as Active Directory or LDAP.

  4. After successfully logging in, the app can make HTTP(S) requests to the endpoints defined by the app scope to access the backend resources.

    The Android and iOS SDKs provide the AKServerAgent class that you typically use to make requests. The JavaScript SDK includes the AK.ServerAgent class. These classes let you make GET, PUT, POST, and DELETE requests to an endpoint.  For more information, see API References.

Deploy your client apps on mobile devices in the way that best fits your environment. You can use over-the-air download, an app store, or other mechanism.

For more information on creating client apps

This document contains only an introduction to creating client apps. For detailed information, see: