In this article you will learn how to use the Swissbit TSE on Android in a nuget implementation.
For the use of the Swissbit hardware TSE with the help of the Rest service (currently not yet available), you must consider other topics.
Preparation
You will need the following:
- nuget package RetailForce.
Fiscalisation V1.2.8 (beta) or higher - Android Swissbit implementation (DLL) SwissbitAndroid.dll
Available at www.retailforce.cloud/downloads in the respective version (from 1.2.8) under implementation - Xamarin .net environment
- Development skills in .net
- Development skills in Xamarin and Android
Target operating systems (Android)
- Currently Android 9 to 10 is supported.
- Android 11 support is being worked on (Google Bugfix)
Resetting the TSE
Resetting the TSE is also possible using Android (only for DEV TSEs). This can be addressed programmatically:
WormStore swissbitTse = WormStoreAndroidCompat.CreateWormStore(Application.Context);
swissbitTse.Tse_factoryReset();
The Application.Context is available, for example, in the MainActivity of a Xamarin application.
Settings under Android
Mounting the swissbit-micro-sd card
It can happen from time to time that the swissbit card is not correctly mounted (provided). Then you have no access to this card. In this case, eject the card under Settings/Memory and mount it again.
File access to the Swissbit hardware TSE
Communication with the Swissbit hardware TSE is via file communication, therefore it is recommended to make the following settings in the application:
- In the Android Manifest you need
- READ_EXTERNAL_STORAGE
- WRITE_EXTERNAL_STORAGE
- as of Android 10:
android:requestLegacyExternalStorage="true"
More information is also available at: https://developer.android.com/training/data-storage/use-cases.
Implementation notes
The implementation of the fiscalisation environment is done via nuget as written above.
After adding the nuget packagee RetailForce.
General advice for nuget implementation can be found in the following article: First steps in nuget implementation.
In order to use the Swissbit TSE under Android, you must execute the following commands in addition to the standard nuget implementation:
FiscalModulCreator.ObjectCache.Add(SwissbitAndroidCommunication.CONTEXT_OBJECT_CACHE_IDENTIFIER, new SwissbitContextCreator());
FiscalModulCreator.ObjectCache.Add(SwissbitHardware.CREATOR_OBJECT_CACHE_IDENTIFIER, new SwissbitAndroidCreator());
IMPORTANT: These two commands must be executed BEFORE the fiscal module is created with CreateFiscalModuleForClient. And these two commands must be executed in the Xamarin environment (e.g.: in the MainActivity) (access to Application.Context is needed).
Comments
0 comments
Please sign in to leave a comment.