When you create your mobile applications they are accessed through a mobile browser such as Safari – just like non-mobile applications. Starting from Aware IM version 5.9 Aware IM supports the capability of building native mobile applications that can be uploaded to a mobile device and run without having to start a mobile browser and specify the URL of the application.
There are several steps involved in creation of native mobile application for mobile phones or tablets:
You should create your native mobile application when your standard browser-based Aware IM application has been developed and tested. The first step is then to create a zip file that can be imported into Monaca. To do this select the business space version and then select the “Build native mobile application” command from the Version menu of the Configuration Tool. Then provide the following information:
When using Monaca you can import a project from a zip file and then open the project in the Monaca IDE. From the IDE you can perform a build for either iOS or Android or both.
Before building a Monaca project for iOS:
Application Icons
If you don’t provide your own application icons the default ones will be generated. To specify your own icons in Monaca select Configure/App Settings for iOS (or Andoid) and upload your icons from there.
There are two files in your project that are very important – index.html and config.xml
The former defines the first HTML page that will be displayed when the application runs. The latter contains all configuration options of the build. You can modify these two files to customize the look and feel of the first page or to customize build configuration.
In Monaca you can change these files directly from the Monaca IDE.
For example, you can change the theme of the index.html file or add “forgotten password” or “Sign Up” functionality.
This video tutorial explains how to build native mobile applications using Monaca technology
Before running native applications you need to make some changes to Aware IM Tomcat files on the server:
1. The following change will make sure that calls to the Aware IM Server from the native application are not interpreted as “cross-origin” calls and rejected. Modify the file AwareIM/Tomcat/webapps/AwareIM/WEB-INF/web.xml to include the following:
<filter>
<filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> <init-param> <param-name>cors.allowed.origins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.allowed.methods</param-name> <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value> </init-param> <init-param> <param-name>cors.exposed.headers</param-name> <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Methods,Access-Control-Allow-Credentials</param-value> </init-param>
</filter> <filter-mapping> <filter-name>CorsFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
2. The following change will disable using cookies by Aware IM as they cause security problems when running mobile native applications. Modify the file AwareIM/Tomcat/webapps/AwareIM/WEB-INF/web.xml and change <web-app> to <web-app xmlns=“https://jakarta.ee/xml/ns/jakartaee”
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" version="5.0">
- Then add this:
<session-config>
<cookie-config> <http-only>true</http-only> <secure>false</secure> <name>JSESSIONID</name> <path>/</path> <max-age>-1</max-age> </cookie-config> <tracking-mode>URL</tracking-mode> </session-config>