ADS Development Guide Smart
ADS Development Guide Smart
ADS Development Guide Smart
DEVELOPMENT
GUIDE
ADS-SMART-TEAM
Revision1.0
2018-7-10
www.nexgo.cn
ADS DEVELOPMENT GUIDE
Content
CONTENT ................................................................................................................................................................ 2
SCOPE ....................................................................................................................................................................... 4
1 ENVIRONMENT ............................................................................................................................................. 5
2 DEBUGGING ................................................................................................................................................... 7
2
ADS DEVELOPMENT GUIDE
Revision History
3
ADS DEVELOPMENT GUIDE
Scope
The purpose of this document is to provide a quick start for Android developers to build the
Application Development Environment (ADE) and run an application on the POS terminal with
The XGD-ADS (Application Development Suit of NEXGO) includes the following resource, all
Guide Conventions
Various conventions are used to help you quickly identify special formatting. Table 1 describes these
conventions and provides examples of their usage.
Table 1
4
ADS DEVELOPMENT GUIDE
Getting Started
Before starting a project based on NEXGO SDK, make sure you are
using the DEBUG mode device to develop.
For the sake of security, the APKs are not allowed to be installed and run on the POS terminal
with RELEASE mode before being signed correctly. Generally, if a project is at development
period, we suggest you ask NEXGO for a DEBUG mode device, which will help you to simplify
the development.
The DEBUG mode device will accept any APK without signature. That is, the DEBUG mode
device allows developers to do anything like other Android devices. Meanwhile, it cannot be
used in production because of its insecurity.
The RELEASE mode device will only accept the APKs which are signed correctly. The
signature certificate is authorized by NEXGO, for more details, referring to Chapter 4. APK
Signature, Chapter 5. Certificate Installation and Chapter 6. APK installation. Only
RELEASE mode devices can be used in production.
1 Environment
1.1 IDE
It is strongly recommended to use Android Studio with the version bigger than 2.2.0. By
checking here to download the latest Android Studio.
5
ADS DEVELOPMENT GUIDE
dependencies{
6
ADS DEVELOPMENT GUIDE
2 Debugging
NEXGO smart POS uses the standard USB cable to connect PC, which is same as most of
Android phones.
7
ADS DEVELOPMENT GUIDE
NEXGO smart POS supports ADB debugging, which is same as universal Android devices.
Install universal ADB driver by checking here.
Use the debugging program from Android Studio. By checking the official web site of
Android Studio to start debugging.
8
ADS DEVELOPMENT GUIDE
By reading the source code of project SampleCode-x.x.x to understand how to use NEXGO SDK
API to develop.
9
ADS DEVELOPMENT GUIDE
4 APK Signature
An online system named as Security system is used by NEXGO to sign APKs for the smart POS
using the NEXGO’s signature strategy.
……………………………………………………………………………………………………….……………
Attention: All the description about signature mentioned in this document is NOT the
standard APK signature which is carried out by Google. A separate signature strategy
is used by NEXGO to prevent installing other APKs which are not signed correctly.
NEXGO’s signature strategy is totally separate from the standard APK signature. That is, if
you are trying to install an APK on NEXGO’s RELEASE mode device, make sure it should
have both standard signature and NEXGO’s signature.
……………………………………………………………………………………………………………..………
Security system is used to managing the important private operations such as signature,
switching device mode. All the operations will be safe by using this system.
Security system account allows users to log in the NEXGO system. In general, the
administrator will only authorize the permission for the users to sign APK by using the
corresponding certificate.
10
ADS DEVELOPMENT GUIDE
The certificate provided by NEXGO is customized for different customers, and it should be
installed to the terminal, which will verify the legality of the APK’s signature. That is, only
the signed APK by the corresponding certificate can be installed to the RELEASE mode
devices. To understand how to install certificate, refer to the Chapter 5. Certificate
Installation.
To apply for the Security system account and certificate, some information is required to help
us customizing for users.
The complete name of your company.
The abbreviated name of your company.
Your name and E-mail address.
For example:
Shenzhen Xinguodu Technology Co., Ltd.
NEXGO
Brad Hong, xxxxxxxxx@xgd.com
Send the information as the example above to the business man by e-mail and we will feed
back the Security system account and certificate.
11
ADS DEVELOPMENT GUIDE
5 Certificate Installation
Step 1. Connect PC and POS terminal by the USB cable. The PC will recognize it and could have
access to the internal storage of POS terminal.
Step 2. Copy the certificate file(xgd_cert.zip) to the internal storage of POS terminal.
Step 3. Find the certificate file (xgd_cert.zip) on POS terminal by the following steps:
Setting---Security---SmartPOS Trusted credentials---ADD CERTIFICATE---sdcard
Step 4. Click the certificate file (xgd_cert.zip) to load and check the certificate information.
12
ADS DEVELOPMENT GUIDE
13
ADS DEVELOPMENT GUIDE
6 APK Installation
Step 3. Select File Manager on POS terminal, and find the APK file, then click it to install.
Step 2. Using Android Studio to install APK directly, which is same as standard Android
development.
14
ADS DEVELOPMENT GUIDE
Step 1. Connect PC and POS terminal by the USB cable. The PC will recognize it and could have
access to the internal storage of POS terminal.
Step 3. Select File Manager on POS terminal, and find the APK file, then click it to install.
15