Cyclos App Reference
Cyclos App Reference
Version: 2.12.2
Abstract
This document contains information that will help you to create a personalized mobile
application, the following items can be customized with ease:
• Application name
• Application icons
• Url to connect to
• Default CSS
Also a more detailed installation guide is provided in order to allow a more advanced
customization.
Table of Contents
1. Content of the release ............................................................................................................ 1
2. General ...................................................................................................................................... 2
3. Android platform ..................................................................................................................... 3
3.1. Basic customization ...................................................................................................... 3
3.2. Advanced customization .............................................................................................. 6
3.3. How to create a keystore ............................................................................................. 9
3.4. How to upload a new app with Android Studio ........................................................ 9
3.5. Install Java ................................................................................................................... 10
4. iOS platform ........................................................................................................................... 12
4.1. Customize the application ......................................................................................... 12
4.2. Distribution guide ....................................................................................................... 13
5. General customizations ........................................................................................................ 15
5.1. Customizing the URL scheme ................................................................................... 15
5.2. Customizing the home page ..................................................................................... 15
5.3. Redirecting to a mobile page .................................................................................... 18
5.4. API key for Google Maps ........................................................................................... 21
5.5. Configuring Firebase .................................................................................................. 22
5.6. Printing support .......................................................................................................... 23
Android ........................................................................................................................ 23
iOS ................................................................................................................................ 23
Common for all .......................................................................................................... 23
We have a section with a guide explaining the steps to configure a Firebase project:
Section 5.5, “Configuring Firebase”.
For the rest of this guide, mobile_dir will refer to the directory where you unzipped the
cyclos4-mobile-2.12.2.zip file.
Information:
This program has been marked as containing a trojan by some minor virus scanners. We
have been in touch with the developer and he assured us this is not the case, the major virus
scanners have confirmed this. For more information check this.
Since it is open source and the source is clean we can recommend it.
Other tools that can be used are for example APK Tool.
Starting August 2021, new apps will be required to use the Android App Bundle
publishing format, see Section 3.4, “How to upload a new app with Android Studio”.
if you already have submitted the app, this new format is still not required and you can
continue publishing the APK. Otherwise, if you are publishing for the first time, you can
not use the APK Icon Editor and the customization must be applied through Android
Studio, see Section 3.2, “Advanced customization”
When the app runs in a device with Android 12, a default splash screen is always shown
when the app is launched. To avoid showing two distinct splash screens, the one that
is included in the mobile app is disabled in favour of the default one, on the other
hand, when running in Android 11 or lower, the one included in the app is used. In
case you also need to customize the default splash screen, this must be done through
Android Studio and can not be done with APK Icon Editor, see Section 3.2, “Advanced
customization”
If you just want to test without uploading to Google Play just yet, please make sure the
apk is still signed (with any keystore). Otherwise Android will not allow it to install on your
phone for testing, even if you have all settings enabled to allow apk's from untrusted
sources. Also, if you want to be able to install the original Cyclos app alongside this app
while testing, steps f, g, h and i" must be done, so ensure your app uses a different
identifier.
1. Download and install the program APK Icon Editor 2.2.0 or higher from here.
2. Java is required, if you do not have Java installed see Section 3.5, “Install Java”
3. Open APK Icon Editor and follow these instructions:
a. Go to File → Open apk and select the cyclos4-mobile-2.12.2.apk file.
b. Go to Settings → Repacking make sure Optimize APK and Sign APK are selected
and choose apksigner option
4. Change the "Target SDK" in the "Properties" tab to 31.
5. Now you can change the application name in the "Translations" tab.
6. You can change the application launcher icons in the "Icons" tab.
7. To change the icons used for the push notifications, in File → Explore APK Contents go
to the res folder and replace the ic_stat.png files in all drawable-* folders that it
is present. It is advisable to use only white as the color for the image with transparent
background.
8. To publish the APK on the Google Play™ Store, you need to follow these steps:
a. Generate a keystore. In Settings → Key Manager → Select bullet "KeyStore" → Create
New KeyStore or Alias fill in (and don't forget) all information and press "OK".
b. Save the keystore on a secure location.
c. In Settings → Key Manager make sure "KeyStore" is selected, select the generated
KeyStore and fill in the right password and the alias.
d. Otherwise, If you prefer to create your keystore manually, please go to the section:
Section 3.3, “How to create a keystore”.
e. Change the package name. In File → Explore APK Contents select
AndroidManifest.xml.
f. Replace package="org.cyclos.mobile" with
package="your.app.identifier" whether "your.app.identifier" is the identifier
for Google Play™ Store.
var options = {
version: '2.12.2',
buildNumber : '2022/11/24 10:28',
hostUrl: 'https://demo.cyclos.org' ❶
};
Caution
Please don't change the version number, this can cause conflicts.
When installing the APK on the mobile phone make sure no other version of the Cyclos
mobile app is already installed.
Note
If you do not have configured a Firebase project yet, you can omit this step. Please
take into account that the push notifications will not work until you use a valid file!
Notes
• For the first time, when you open the folder, Android Studio could show the
following error: "Invalid Gradle JDK configuration found" just click on the link
"Use JDK from project structure" and the error should be fixed.
• Ensure Gradle runs using JDK 11: Go to File → Settings → Build, Execution,
Deployment → Build Tools → Gradle and ensure a JDK 11 is selected for the
setting 'Gradle JDK'
• After opening the project, Android Studio will ask you to upgrade the Android
Gradle Plugin, just skip the upgrade to avoid errors at build time.
7. From 2.12.1 onwards the app will listen for NFC cards only when in foreground. If you
want to start the app when an NFC card is next to the device please add the following
lines in the AndroidManifest.xml
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
8. If you wish to publish the apk on the Google Play™ Store please open the
AndroidManifest.xml (Ctrl-Shift+N)
There is more than one AndroidManifest.xml you must open the one that is in
app/src/main
5. alias_name is the alias used for the keystore, please replace it with the name used for
this keystore (e.g. the appname).
6. After executing this command please fill in and write down on paper all passwords and
details provided.
7. Please save the generated keystore on a safe location.
java --version
If you don't have Java 11 or higher installed, proceed with the steps below (if using Java 8 Apk
Icon Editor throw an error when packing the APK).
Linux (Ubuntu)
Windows
• Download and install the last Java SE 11 or higher. Detailed instructions can also be found
here
• Install the program to <install_dir> (for windows users e.g. C:\Program Files\Java\jre11).
• Make sure your system knows where to find JAVA, in Windows you should make an
environmental variable called "JAVA_HOME" which points to the <install_dir>:
• In Windows: Control Panel > System and Security > System > Advanced system settings
> Environmental Variable
echo %CLASSPATH%
echo %PATH%
echo %JAVA_HOME%
Note
If you do not have configured a Firebase project yet, you can omit this step. Please
take into account that the push notifications will not work until you use a valid file!
There is a group of actions for which we already know its classname beforehand, e.g: View
accounts, Agreements, Directory, but there is another group that is data-dependent and
we can not define a fixed classname for them, e.g: operations, records, wizards.
For that cases, the form of the classname would be prefix-{internal_name | id}. That
is, a prefix plus the entity's internal name if defined, otherwise, its id. Also for each action
will be generated a classname of the form prefix-all (this will allow defining a style for all
actions of the same group).
Note
Please take into account that the entity id could be a negative number, causing the
classname to contain two consecutive dashes (the first for the prefix separator and the
second for the sign), thus it is advisable to always define a meaningful internal name.
Customization examples
• Display view / edit profile actions (hidden by default) as top home actions
.ha-viewProfile, .ha-editProfile {
display: inline-block;
order: -1;
}
.ha-receiveQrPaymnet .inputButtonIcon {
visibility: hidden;
font-size: 0;
}
.ha-receiveQrPayment .inputButtonIcon:after {
visibility: visible;
font-size: 30px;
content: "Ý";
}
Pay attention
Android
Android uses Bluetooth classic to connect to the printer. The relevant settings to pay attention
to are the printable width (in dots) and the font width (in dots) required to print text justified.
iOS
iOS uses Bluetooth Low Energy (BLE) to allow the mobile device to connect to the printer. For
that case a Service, a Tx characteristic (used to send data to the printer) and a Rx characteristic
(used to receive data from the printer) must be specified. Those are hexadecimal strings that
depends on the printer, please refer to the printer manual to get those values or contact
your printer provider. Tip: You can install the following application "nRF Connect" (available
in Google Play and Apple Store) to connect to the printer an read those values.