App Development and Execution (Android)

App Development Environment Configuration

Nexacro Platform Android apps are developed using Eclipse and the Android SDK. Basic processes are the same as developing Android apps.

Refer to the Google Android webpage for Eclipse and Android SDK installation files and related data.

http://developer.android.com/sdk/installing.html

Since updated versions for Eclipse and Android SDK are released often, you need to install the latest development environment using the above link. Details regarding the installation can differ depending on the updates to Eclipse, ADT (Android Developer Tools) Plug-in, and Android SDK.

The Android development environment is configured using the following process:

  1. JDK(Java SE Development Kit) installation

  2. Eclipse installation

  3. Android SDK installation

  4. ADT plug-in installation

Google released Android Studio in December 2014, new integrated development environment for the Android platform.

https://en.wikipedia.org/wiki/Android_Studio

We have added related contents to this chapter, including how to use Android Studio and how to import an existing Eclipse-based project to Android Studio.

Google ended its support for the ADT in Eclipse from June 2015.

http://developer.android.com/tools/help/adt.html

Therefore, Android Studio may be the only applicable tool depending on development environments.

Because the app development environment is already configured, there is no need to go over it here.

JDK(Java SE Development Kit) Installation

Because Android Studio and Eclipse are based on Java, you need to configure the JDK (Java SE Development Kit) environment. You can download and install the JDK for free.

Download

Download the JDK for your system environment using the site below.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

In this chapter, the jdk-7u17-windows-i586.exe (version 1.7.0_17) file is used. Some of this information may differ based on the version you are installing.

Installation Check

When you run the installation file, it automatically executes the necessary environment settings and installation process. Check that it is successfully installed in the command window after the installation is completed by entering this command:

java -version

If you install JDK 1.5 version or later, you do not need to set an environment variable (JAVA_HOME) since you can access it by copying an execution file to the system path.

Development Tool Installation

Android Studio

The installation file of Android Studio basically includes an SDK (software development kit). You can download an installation file that is appropriate to your development environment by following the below link.

http://developer.android.com/sdk/index.html

If you select the default settings when installing Android Studio, you can proceed to the development stage directly.

The version of the Android Studio described in this chapter is 1.5.1.

Eclipse

Nexacro Platform has ended its support for Eclipse since the version 14.0.1.3000, in which the FCM service was added. You can build an app project only in Android Studio.

The Eclipse ADT plugin has not been supported since 2015 so there have been limitations on using features that have been added from that time.

https://developer.android.com/studio/tools/sdk/eclipse-adt

You can use Eclipse without installing it by simply downloading and unzipping it.

Access the following link and download the Eclipse Standard version, or choose a file appropriate for your development environment.

http://www.eclipse.org/downloads/

Installing Android SDK

For Android projects, you need to install the Android SDK for related API. The relevant file can be downloaded from the Android developer site.

Download the ADT Bundle package which includes Eclipse with the ADT plug-in, or download an SDK installation file separately. To download the SDK installation file separately, visit the site below, select the USE AN EXISTING IDE link from the menu toward the bottom of the page, and click Download SDK Tools for Windows.

http://developer.android.com/sdk/index.html

Run the downloaded installation file.

When the installation is completed, the SDK Manager will run. SDK Manager provides Android APIs required for the development as well as functions to download related tools. Select Tools and Extras, and install the required Android APIs.

If later you need to install additional APIs, you can run SDK Manager again.

It will take a while to install Android APIs depending on your network environment.

ADT Plug-in Installation

After installing Eclipse, please check if the JRE (Java Runtime Environment) version corresponds to the installed JDK version. You can set the JRE using the following menu.

Window > Preferences > Java > Installed JREs

To construct Android projects, you need to install the ADT plug-in. Add developer tools using the following menu.

Help > Install New Software

The menu for installing additional functions can vary according to the Eclipse versions in use. For pre-Eclipse 3.4 versions, use Help > Software Updates.

This chapter illustrates use of the Eclipse 4.3(Kepler) version.

Click the Add button next to the Work with item, and enter the Repository information as follows.

Name: ADT Plugin
Location: https://dl-ssl.google.com/android/eclipse/

To start the installation, select the Developer Tools checkbox among the available items.

After the installation is completed, Eclipse will be restarted.

Eclipse Project Migration

For further information on the migration, click on the below link and read the documentation provided by Google.

https://developer.android.com/sdk/installing/migrate.html

Migration process

You can migrate a project from Eclipse ADT to Android Studio. The migration is conducted in the below order.

  1. Execute [Import project]

    If there is no opened project, make a new project through Quick Start and then select Import project (Eclipse ADT, Gradle, etc.), as shown in the below picture. If you want to create a new project while you are working on another project, access [File > New > Import Project].

  1. Select a project to import

    Select an existing project folder located under the Eclipse's workspace folder.

  1. Click Finish button after selecting a path and options

    Create a project folder whose name corresponds with the relevant application. If there is existing folder with the same name, you can change the name.

build.gradle

Sometimes, you may fail to build a project after migration. In this case, you need to adjust the settings of the build.gradle file. Among the error-prone options are the SDK version and dependencies.

The below code is just a sample. Please, note that the settings can differ according to your development environment.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.tobesoft.sampleproject"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:22.2.1'
	compile 'com.android.support:support-v4.20.0.0'
	compile 'com.google.android.gms:play-services:+'
    compile files('libs/nexacro14.jar')
}

If you want to learn about the entire settings of the build.gradle file, click on the below link and see the documentation provided by Google.

http://developer.android.com/tools/building/configuring-gradle.html

AndroidManifest.xml

The AndroidManifest.xml file in Android Studio is different from the one in Eclipse ADT in terms of Google Play services. You can maintain the AndroidManifest.xml file. However, you need to adjust the options in the file as presented in the below sample code if it causes an error.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.tobesoft.sampleproject"
    android:versionCode="1"
    android:versionName="1.0" android:installLocation="auto">
...
	<meta-data android:name="com.google.android.gms.version" 
		android:value="@integer/google_play_services_version" />
    </application>
</manifest>

Google Play services is applicable from version 5 while version 7.5.0 or later can be included as dependencies in the build.gradle file of Android Studio. In AndroidManifest.xml, therefore, you must establish settings that can fetch the version of play_service from the SDK.

Caution

Among the APIs provided by Nexacro Platform, the Map object may fail to run properly after migration. This issue is under examination currently. Therefore, we recommend you to postpone migration if your service includes a Map object.

App Project Development

Once the application development environment is configured, you can develop apps running on the Android OS using Android Studio or Eclipse.

Before you start app projects, archive files generated by applications developed on Nexacro Studio will be located in the designated path.

Creating Projects

Android Studio

If there is no opened project, create a new project by accessing Quick Start and then selecting Start a new Android Studio project, as shown in the below picture.

If you want to create a new project while you are working on another project, access the below menu.

File > New > New Project

Item

Description

1

Application Name

Name of an app to create

2

Company Domain

If you input your company's domain, Android Studio will create a package name based on it.

3

Package Name

Android Studio will create a package name automatically based on the company domain you input.

4

Project location

Location to save a project

Set the minimum SDK. Whenever you change the version of SDK, you can check how various devices your app will be able to support.

After selecting Blank Activity and entering further information, click the Finish button to get a new project created.

Eclipse

You need to create Android projects which include applications developed by Nexacro Platform and to set the basic environment. You can create a new project using the menu below.

File > New > Android Application Project

If you can't see the Android Application Project item, the ADT plug-in was not installed successfully. Check the installation of ADT plug-in again.

Project settings can differ based on the version of Eclipse or Android SDK.

Callout

Item

Description

1

Application Name

It requires a name of an app to be created.

2

Project Name

It requires a name of a project to be created. The project name shall be a sole name in the workspace in use.

3

Package Name

It requires a domain-type name of a package

4

Minimum Required SDK

Nexacro Platform supports Android 2.3(Gingerbread) or later.

For Android 4.4 (Kitkat) or later SDK the appcompat_v7 project is automatically created for downward compatibility if the Minimum Required SDK is set below 3.2 (Honeycomb). Refer to

http://developer.android.com/tools/support-library/features.html.

However, this setting does not have any effect when you create Nexacro Platform applications. Therefore, it is not recommended to create the project. To deal with this situation, you can set the Minimum required SDK to 4.0(IceCreamSandwich) and create a project. You can then designate a downward version as you want when setting AndroidManifest.xml.

Nexacro Platform Library Settings

To optimize the Android project environment for XPLATFORM, you need to configure additional Nexacro Platform libraries:

The libnexacro14.so file is a library developed in the C/C++ language.

Android Studio

To begin with, change the view option to Project by opening the drop-down list on the top of the project pane, as shown in the below picture. The default value of the view option is Android.

Copy existing library files to your project folder. First, copy nexacro14.jar to [app > lib]. As for libnexacro14.so, copy the file to the path presented in the below table. Your project folder will be structured as shown in the below picture.

File

Path

Java archive (nexacro14.jar)

[project path]\app\libs\

32-bit shared library (libnexacro14.so)

[project path]\app\src\main\jniLibs\armeabi-v7a\

64-bit shared library (libnexacro14.so)

[project path]\app\src\main\jniLibs\arm64-v8a\

Resources file (icudtl.dat)

[project path]\app\src\main\assets\

The files in the x86 folder, which is included in the distributed file, are shared library files used to develop an app targeting devices powered by specific Intel CPUs. Therefore, you should carefully use those files only for supporting the x86 architecture.

You can add the assets folder by right-clicking app and go to [New > Folder > Assets Folder] in the context menu.

According to the Google's policy starting August 1, 2019, apps published on Google Play will need to support 64-bit architectures.

https://developer.android.com/distribute/best-practices/develop/64-bit


A 64-bit shared library does not work in mobile devices with 32-bit CPU architectures. If there are both a 32-bit and a 64-bit shared library, the latter will be used first.


64-bit apps can run under Android 5.0 or later.

When you add a file, you can change the file name and directory through the window as shown in the below picture. Click the OK button while maintaining the default values.

Add the Nexacro Platform library to your project library so that your project use it as reference. Right-click the nexacro14.jar file and choose Add As Library from the context menu.

If you want to check whether the library has been added successfully, right-click the app folder and select Open Module Settings.

Access [Modules > app] and click the Dependencies tap. Then, you can see whether the library has been added.

Eclipse

Nexacro Platform has ended its support for Eclipse since the version 14.0.1.3000, in which the FCM service was added. You can build an app project only in Android Studio.

Moreover, Eclipse does not support 64-bit libraries. However, this article is preserved for the users who still use Eclipse.

  1. Copy the provided library files to the libs folder subordinate to the project folder.

  2. Copy the nexacro14.jar file subordinate to the libs folder.

  3. Create a new folder subordinate to the libs folder and name it armeabi-v7a, and

  4. Copy the libnexacro14.so file into the new folder

The folder structure should now resemble the following.

Set Java Build Path to refer to the added Nexacro Platform libraries on the project:

  1. Access File > Properties > Java Build Path.

  2. Select the Libraries tab.

  3. Click the Add JARs button.

  4. Select the nexacro14.jar file in the libs folder.

Resource Settings

Configure the images, icons, messages and layouts that will be used by the project applications. The folder structure will resemble the following.

Image Settings

Designate the loading images and app icons in the drawable-mdpi folder subordinate to the res folder.

Applied image files can be adjusted to the resolution supported by apps. Please refer to the Android manual for details.

http://developer.android.com/guide/practices/screens_support.html

Item

Description

icon.png

Icon image installed in the backround of an application

The designated file name can be changed in the AndroidManifest.xml file

splashimage_phone_landscape.png

Horizontal splash image for the Android phone (all lowercase)

splashimage_phone_portrait.png

Vertical splash image for the Android phone (all lowercase)

splashimage_pad_landscape.png

Horizontal splash image for the Android tablet (all lowercase)

splashimage_pad_portrait.png

Vertical splash image for the Android tablet (all lowercase)

A file name that starts with text_select_handle~ corresponds to an image to be used to handle a specific area when selecting text. In the current version, you need to designate the relevant image.

You can modify icon files after creating a project.

Image Settings | Android Studio

Right-click the app folder and select [New > Image Asset] from the context menu. Then, you can change settings related to icon files through the opened Asset Studio window.

http://developer.android.com/intl/ko/tools/help/image-asset-studio.html

Image Settings | Eclipse

Open a wizard by right-clicking your project and then selecting [New > Other] from the context menu. Enter "android icon set" as search words and then select Android Icon Set.

In Configure Icon Set, you can change settings related to icon files.

Message Settings

Configure settings for messages used when running apps. Revise the strings.xml file, generated when the project was created, located in the values folder subordinate to the res folder.

$r_title(strings.xml)

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Nexacro 14</string>
	<string name="action_settings">Settings</string>
    
    <!-- Clipboard -->
    <string name="copy">Copy</string>
    <string name="paste">Paste</string>
    <string name="cut">Cut</string>
    <string name="close">Close</string>
    <string name="selectall">Select All</string>
    <string name="selectword">Select Word</string>
 
    <string name="needupdate">It is need to update. \r\nAfter completing, Please restart.</string>
    <string name="loadingFail">First loading is fail. \r\nPlease restart.</string>
    <string name="updateFail">Update is fail. \r\nPlease restart.</string>
    <string name="notexist">Start file is NOT exist. \r\nPlease restart.</string>
    <string name="BeingUpdated">Being updated.</string>
    <string name="wantreplace">There is a file of the save name. Do you want to replace? </string>
    <string name="ok">OK</string>
    <string name="cancel">Cancel</string>
    <string name="move">Move</string>
    <string name="upper">Upper</string>
    <string name="filter">Filter</string>
    <string name="home">Home</string>
    <string name="nofilename">No File Name.</string>     
	<string name="checkforupdates">Check for updates.</string>   
	<string name="installforupdates">Install for updates.</string>  
	<string name="downloadingforupdates">Downloading for updates.</string>    
	<string name="force_close">Update is Completed.</string> 
	<string name="LoadingPleaseWait">Loading&#8230; \r\nPlease Wait&#8230;</string> 
	
    <!-- Accessibility widget role -->
    <string name="alert">alert</string>
    <string name="pushbutton">pushbutton</string>
    <string name="combobox">combobox</string>
    <string name="checkbutton">checkbutton</string>
    <string name="radiobutton">radiobutton</string>
    <string name="text">text</string>
    <string name="list">list</string>
    <string name="listitem">listitem</string>
    <string name="statictext"></string>
    <string name="graphic">image</string>
    <string name="spacebar">space bar</string>
    <string name="textdeleted">deleted</string>
    
    <!-- Accessibility widget statue -->
    <string name="checked">checked</string>
    <string name="unchecked">unchecked</string>
    
    <!-- Accessibility reaction -->
    <string name="click">click</string>
    
    <!-- Splash message  -->
    <string name="start_initialize">Start Initialize</string> 
    <string name="check_license">Check License</string>
    <string name="load_frameworkmodule">Load Framework Module</string>
    <string name="load_extendmodule">Load Extend Module</string>
    <string name="execute_frameworkscript">Execute Framework Script</string>
    <string name="load_application">Load Application</string>
    <string name="load_failapplication">Load Fail Application Initialize. Click And Close</string>
    
</resources>

If you want to add messages in other languages, such as Korean or Japanese, add corresponding folders, such as values-ko and values-ja, subordinate to the res folder, and add a strings.xml file to each.

The <string name="app_name"> value defines the icon name actually installed on the device. Change the icon name by revising this value.

Add a bool.xml file.

$r_title(bool.xml)

<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<bool name="is_jellybean_or_higher">false</bool>
</resources>

Layout Settings

Define the display layouts of apps on devices. Set the layout as default since it is for covering Nexacro Platform applications.

Create nexacro_app.xml in the layout folder subordinate to the res folder as listed here.

$r_title(nexacro_app.xml)

<?xml version="1.0" encoding="utf-8"?>
<!-- nexacro_app.xml -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/nexacro_activity"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    tools:context=".deviceAPI.FileDialogActivity" >

    <com.nexacro.view.NexacroLayout
        android:id="@+id/nexacro_layout"
        android:background="@android:color/transparent"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </com.nexacro.view.NexacroLayout>

</FrameLayout>

Build Environment Settings

Make adjustments to the MainActivity.java and AndroidManifest.xml files as described in this section. These files were created when you added Android projects to the Nexacro Platform environment.

MainActivity.java

When you create a project, you will designate an activity name. It shall be created as MainActivity.java unless you change the name. Select the MainActivity.java file, which resides in the src folder subordinate to the designated package, and revise it as follows.

In the file, the highlighted setBootstrapURL parameter defines a server URL where the start_android.json file created on Nexacro Studio is distributed. And a parameter included in the setProjectURL method defines the path up to /.

$r_title(MainActivity.java)

package com.tobesoft.sampleproject;

import com.nexacro.NexacroUpdatorActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends NexacroUpdatorActivity {

	public MainActivity() {
		super();
		setBootstrapURL("http://172.10.10.10:8080/nexacro/start_android.json");
		setProjectURL("http://172.10.10.10:8080/nexacro/");		
	}

	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		Intent intent = getIntent();
		if(intent != null) {
			String bootstrapURL = intent.getStringExtra("bootstrapURL");
			String projectUrl = intent.getStringExtra("projectUrl");
			if(bootstrapURL != null) {
				setBootstrapURL(bootstrapURL);
				setProjectURL(projectUrl);
			} 
		}
		
		super.onCreate(savedInstanceState);		
	}
	
	@Override
	public void setContentView(View view) {
		super.setContentView(view);
	}
}

If you want to access the server directly without creating a project archive file, add setStartupURL method designating xadl.js as below. At this point, only the engine item shall be set to start_android.jsonfile.

super();
setBootstrapURL("http://172.10.10.10:8080/nexacro/start_android.json");
setStartupURL("http://172.10.10.10:8080/nexacro/HBDeviceTest/HBDeviceTest.xadl.js");

AndroidManifest.xml

The AndroidManifest.xml file is located in the project root, and includes the basic application information as well as the information required to execute certain features. Revise the file as illustrated below. The information about the highlighted package and MainActivity should be designated according to the project settings.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="com.tobesoft.sampleproject"
	android:installLocation="auto"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />
   
<!--This portion can be deleted if you use the asset/archive feature. Otherwise, you must not delete this portion-->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
  
    <application
        android:allowBackup="true"
        android:hasCode="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="com.tobesoft.sampleproject.MainActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name="com.nexacro.NexacroActivity"
            android:alwaysRetainTaskState="true"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:launchMode="singleTop"
            android:theme="@android:style/Theme.NoTitleBar"
            android:windowSoftInputMode="adjustResize" >
        </activity>
     
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="google_play_services_version" />
    </application>
</manifest>

If you want to maintain HTTP communications when the version of targetsdk is 28 or higher, you should set the usesCleartextTraffic attribute to “true”.

If you do not set usesCleartextTraffic by yourself, HTTP communications will not be allowed because the attribute defaults to “false”.

https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic


<application

android:allowBackup="true"

android:usesCleartextTraffic="true"

Depending on the features of an application, you need to designate additional information such as permission. For instance, you will be required to insert the below code if you intend to use the camera feature.

...
<uses-permission android:name="android.permission.CAMERA" />
<activity android:name="com.nexacro.deviceAPI.CameraListener"
	android:screenOrientation="landscape">
	<intent-filter>
   		<category android:name="android.intent.category.LAUNCHER" />
	</intent-filter>
</activity>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus"
	android:required="false"/>
...

The following sections present you with available features and their syntax rules. Copy and paste necessary items into the AndroidManifest.xml file.

DeviceAPI

<!-- AudioPlayer, AudioRecorder -->
<uses-permission android:name="android.permission.RECORD_AUDIO" /> 
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<!-- Camera -->
<uses-permission android:name="android.permission.CAMERA" /> 
<activity android:name="com.nexacro.deviceAPI.CameraListener" android:screenOrientation="landscape">
	<intent-filter>
    	<category android:name="android.intent.category.LAUNCHER" />
	</intent-filter>
</activity>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>

<!-- Contact -->
<uses-permission android:name="android.permission.READ_CONTACTS" /> 
<uses-permission android:name="android.permission.WRITE_CONTACTS" />    

<!-- ExternalAPI -->
<uses-permission android:name="android.permission.GET_TASKS" />

<!-- Geolocation, Map -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> 

<!-- Map -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-library android:name="com.google.android.maps" /> 
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="user value" />

<!-- SMS -->
<uses-permission android:name="android.permission.SEND_SMS" /> 
<uses-permission android:name="android.permission.RECEIVE_SMS" /> 
<uses-permission android:name="android.permission.READ_SMS" /> 
<uses-permission android:name="android.permission.WRITE_SMS" />

<receiver android:name="com.nexacro.deviceAPI.SmsRecv">
	<intent-filter>
		<action android:name="android.provider.Telephony.SMS_RECEIVED" />
	</intent-filter>
	<intent-filter>
		<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
		<data android:mimeType="application/vnd.wap.mms-message" />
	</intent-filter>
</receiver>"

<!-- Vibrator -->
<uses-permission android:name="android.permission.VIBRATE" />

<!-- FileDialog -->
<activity android:name="com.nexacro.deviceAPI.FileDialogActivity" android:screenOrientation="sensor">
	<intent-filter>
		<category android:name="android.intent.category.LAUNCHER" />
	</intent-filter>
</activity>

To use Google maps, you need to get an API KEY and enter the key. Refer to the link below for details.

https://developers.google.com/maps/documentation/android/start#obtain_a_google_maps_api_key

GlobalAPI

<!-- Accounts -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

<!-- Phone numbers -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<!-- Phone calling -->
<uses-permission android:name="android.permission.CALL_PHONE" /> 

<!-- Device names -->
<uses-permission android:name="android.permission.BLUETOOTH"/>

Asset/archive feature

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

Cache feature

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />

Notification feature (since the version 14.0.1.3000)

You should use the Firebase Cloud Messaging (FCM) service since the version 14.0.1.3000.

About FCM messages

https://firebase.google.com/docs/cloud-messaging/concept-options

You can use the FCM service stably in Android 4.0 (API 14) or higher. In the lower versions, FCM may fail to work properly.

<!-- Adding NexacroNotificationService -->
<service android:name="com.nexacro.notification.NexacroNotificationService">
	<intent-filter>
		<action android:name="com.google.firebase.MESSAGING_EVENT" />
	</intent-filter>
</service>

<!-- Adding NexacroActivity intent-filter -->
<activity android:name="com.nexacro.NexacroActivity"
	android:launchMode="singleTask"
	android:noHistory="false"
	android:hardwareAccelerated="true"
	android:windowSoftInputMode="adjustResize"
	android:configChanges="orientation|keyboard|keyboardHidden|screenSize|navigation|uiMode">
	<intent-filter>
		<action android:name="OPEN_NEXACRO_ACTIVITY_EXAMPLE" />
		<category android:name="android.intent.category.DEFAULT" />
	</intent-filter>
</activity>

To use the FCM service, you need to add the below codes to the build.gradle file. If this setting is not done automatically in Android Studio, you should do it manually. Then, you need to copy the google-services.json file, which is created in the Firebase console, to the path to the module.

Add Firebase to Your Android Project

https://firebase.google.com/docs/android/setup

buildscript {
	// Adding repositories 
	repositories {
		google()  
		jcenter()
	}
	dependencies {
		classpath 'com.android.tools.build:gradle:3.2.1'
		// NOTE: Do not place your application dependencies here; they belong
		// in the individual module build.gradle files
		// Adding google service
		classpath 'com.google.gms:google-services:4.0.1'
	}
}

allprojects {
	// Adding repositories 
	repositories {
		google()
		jcenter()
	}
}

task clean(type: Delete) {
	delete rootProject.buildDir
}

dependencies {
	implementation fileTree(include: ['*.jar'], dir: 'libs')
	implementation 'com.android.support:appcompat-v7:27.1.1'
	implementation 'com.android.support:support-v4:27.1.1'
	implementation 'com.google.android.gms:play-services-maps:16.0.0'
	implementation 'com.google.android.gms:play-services-location:16.0.0'
	implementation 'com.google.firebase:firebase-core:16.0.6'
	implementation 'com.google.firebase:firebase-messaging:17.3.4'
	implementation files('libs/nexacro14.jar')
}
apply plugin: 'com.google.gms.google-services'

Notification feature (since the version 14.0.1.2802)

A notification feature can be implemented as below in the versions earlier than 14.0.1.2802.

<!-- Notification -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<receiver
	android:name="com.nexacro.notification.NexacroNotificationReceiver"
	android:permission="com.google.android.c2dm.permission.SEND" >
	<intent-filter>
		<action android:name="com.google.android.c2dm.intent.RECEIVE" />
		<category android:name="com.nexacro" />
	</intent-filter>
	<intent-filter>
		<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
		<category android:name="com.nexacro" />
	</intent-filter> 
</receiver>
<service android:name="com.nexacro.notification.NexacroNotificationService" />

Build

App Test

  1. Test your applications directly by connecting an Android device to a PC using USB cable. When you connect the device directly, you will need to set the Application > Development > USB debugging item, which is an application development option, and also install a driver appropriate for the device.

  1. You will use the Run menu on Android Studio or Eclipse to create an APK and install/run the APK on the device. You need to select which device your app will run on.

Run > Run

For a Nexus One or Optimus One, if there is insufficient memory, the application will not be installed normally unless the user adds an external storage drive.

Android does not support testing by using a virtual device.

Android Studio

Eclipse

For creating keystores and signed APK, refer to the Google webpage.

Creating Installation Files

To distribute completed apps, you need to create keystores which acknowledge apps and signed APK files. Keystore files will be created once for the first time, and the initial keystore files will be used for updates.

Refer to the Google webpage for creating keystores and signed APK.

http://developer.android.com/guide/publishing/app-signing.html

Android Studio

Access [Build > Generate Singed APK] from the menu bar.

Eclipse

Choose the project and select the Android Tools > Export Signed Application Package item on the context menu.