In order to upload applications to server and deploy them successfully on devices, following conditions should be met:
Manifest files should be adjusted to have required metadata
apk files must be signed with appropriate keys
Adjusting the Manifest File
Fields below should be in AndroidManifest.xml, under manifest -> application -> meta-data tags, as name-value pairs.
Name
Type
Length
Description
Example
Required
app_name
String
At most 20
Application name with application type prefix
“LYL_COMPANYNAME”
Yes
app_model_type
String
At most 8
Model type name (should match with model type name in ATMS)
“400TR”
Yes
app_version
Integer
-
Version of the application
"1"
Yes
saleactivity_name
String
not defined
Used by TLauncher App
"MyExampleSaleActivy"
No
Separate apks should be created for 400TR and 1000TR devices. The apk prepared for 400TR should have 400TR information in the XML file. The apk prepared for 1000TR should have 1000TR information.
Example 400TR:
<manifest ... >
...
<application ... >
...
<meta-data android:name="app_name" android:value="LYL_COMPANYNAME" /> // if you are Retail developer then "LYL_COPMANYNAME" , if you are an Bank developer "BNK_COMPANYNAME"
<meta-data android:name="app_model_type" android:value="400TR" /> // For 400TR devices
<meta-data android:name="app_version" android:value="40000110" /> // Change Android Version major/minor/build into integer. We kindly request this change. Version no must start with 400. Example: 40000110.
<meta-data android:name="saleactivity_name" android:value=”MyExampleSaleActivy" /> // For just Retail developers. The purpose of this line is to fork your Sale App from Tlauncher
</application>
...
Example 1000TR:
<manifest ... >
...
<application ... >
...
<meta-data android:name="app_name" android:value="LYL_COMPANYNAME" /> // if you are Retail developer then "LYL_COPMANYNAME" , if you are an Bank developer "BNK_COMPANYNAME"
<meta-data android:name="app_model_type" android:value="1000TR" /> // For 1000TR devices
<meta-data android:name="app_version" android:value="100000110" /> // Change Android Version major/minor/build into integer. We kindly request this change. Version no must start with 1000. Example: 100000110.
<meta-data android:name="saleactivity_name" android:value=”MyExampleSaleActivy" /> // For just Retail developers. The purpose of this line is to fork your Sale App from Tlauncher
</application>
...
Example 330TR:
<manifest ... >
...
<application ... >
...
<meta-data android:name="app_name" android:value="LYL_COMPANYNAME" /> // if you are Retail developer then "LYL_COPMANYNAME" , if you are an Bank developer "BNK_COMPANYNAME"
<meta-data android:name="app_model_type" android:value="330TR" /> // For 330TR devices
<meta-data android:name="app_version" android:value="33000110" /> // Change Android Version major/minor/build into integer. We kindly request this change. Version no must start with 330. Example: 33000110.
<meta-data android:name="saleactivity_name" android:value=”MyExampleSaleActivy" /> // For just Retail developers. The purpose of this line is to fork your Sale App from Tlauncher
</application>
...
To convert version name to manifest data, you can use following example in your build.gradle
apply plugin:'com.android.application'// This section is parsing Android manifest file, reads version in the meta-data tag, writes it into version name in gradle// so that the version shown in the android settinsg is same as version in the meta-tagdef versionFromManifesttask parseManifest() { def manifest =newXmlSlurper().parse(file(android.sourceSets.main.manifest.srcFile)).declareNamespace(android:'http://schemas.android.com/apk/res/android'); println manifest.@packagemanifest.application["meta-data"].each { def m =it.attributes()['android:name'] =~/app_version/if (m.find()) { versionFromManifest =it.attributes()['android:value'].toString() } }}android { compileSdkVersion 28 defaultConfig { applicationId "com.example.atms_alpha" minSdkVersion 26 targetSdkVersion 28 versionCode versionFromManifest.toInteger() versionName "${versionFromManifest}" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"setProperty("archivesBaseName","ATMS_Alpha_"+ versionFromManifest) } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro' } }}