Skip to content

Commit

Permalink
feat: add new remote services in the server app to enhance keyple-les…
Browse files Browse the repository at this point in the history
…s clients capabilities (#25)

---------

Co-authored-by: Andrei Cristea <[email protected]>
  • Loading branch information
jeanpierrefortune and andrei-cristea authored Oct 22, 2024
1 parent 4c15fc3 commit 34cdf2f
Show file tree
Hide file tree
Showing 151 changed files with 7,100 additions and 37 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
steps:
- name: Check out repository code from ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
- name: Set up Node JS
uses: actions/setup-node@v4
with:
Expand All @@ -29,7 +29,7 @@ jobs:
dotnet-version: 6.0.x
- name: Update permissions
working-directory: .
run: chmod +x ./client/android/gradlew ./server/gradlew ./.github/scripts/*.sh
run: chmod +x ./client/android/gradlew ./client/android-light/gradlew ./server/gradlew ./.github/scripts/*.sh
- name: Check version client Android
working-directory: ./client/android/
run: ../../.github/scripts/check_version.sh
Expand All @@ -45,11 +45,14 @@ jobs:
dotnet test --no-build --verbosity normal
- name: Build and Test client Android
working-directory: ./client/android/
run: ./gradlew build test --info --stacktrace
run: ./gradlew clean build test --info --stacktrace
- name: Build and Test client Android Light
working-directory: ./client/android-light/
run: ./gradlew clean build test --info --stacktrace
- name: Build and Test server
working-directory: ./server/
run: |
cd ./dashboard-app
npm install
cd ..
./gradlew build test --info --stacktrace
./gradlew clean build test --info --stacktrace
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
### Added
- Added a new Android client application to demonstrate the use of the **Keyple Distributed JSON API** and without the
need of the `keyple-card-calypso-java-lib` on terminal side. The corresponding code is located in the folder named
`android-light`.
- Added new remote services in the server app to enhance keyple-less clients capabilities.
### Changed
- Rename repository from `keyple-java-demo-remote` to `keyple-demo-ticketing-reloading-remote`
- Rename Android artifact from `keyple-demo-remote-client-android` to `keyple-demo-ticketing-reloading-client-android-app`
Expand Down
92 changes: 92 additions & 0 deletions client/android-light/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Built application files
*.apk
#*.aar For ".aar" files in "libs" directory
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
/.idea
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

# Android Profiling
*.hprof

/LICENSE_HEADER
/signing.properties
56 changes: 56 additions & 0 deletions client/android-light/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Keyple Reload Demo - Android Light Client's repository

This is the repository for the Android Client of the Keyple Reload Demo application.

This demo is an open source project provided by the [Calypso Networks Association](https://calypsonet.org) implementing
the [Eclipse Keyple SDK](https://keyple.org) in a typical use case that can serve as a basis for building a ticketing
ecosystem based on contactless cards and/or NFC smartphones.

The source code and APK are available
at [calypsonet/keyple-demo-ticketing-reloading-remote/releases](https://github.com/calypsonet/keyple-demo-ticketing-reloading-remote/releases)

This version differs from the other Android demo, where the card selection is handled directly by the client terminal.
In this application, the card selection process is delegated to the server, demonstrating the "keyple-less" capabilities
of the server protocol. As a result, it is no longer necessary to have the Calypso card extension on the client
terminal, making it more lightweight and further simplifying client-side operations. This modification allows the server
to manage the card selection logic, reducing the dependency on local configuration and improving central control over
card interactions.

The code can be easily adapted to other cards, terminals and business logic.

It shows how to load contracts into a Calypso card, the whole ticketing process being managed remotely.
Following the contract loading the card can pay presented to a validator running the
[Keyple Demo Validation](https://github.com/calypsonet/keyple-demo-ticketing-validation-app) application and then checked with the [Keyple Demo Control](https://github.com/calypsonet/keyple-demo-ticketing-control-app) application.

Read the main [README](https://github.com/calypsonet/keyple-demo-ticketing-reloading-remote#readme) to understand the purpose of this application.

## Screens

- Main screen (`MainActivity`): Setup Screen.
- Home (`HomeActivity`): Display a menu allowing to choose the Calypso card type to read and load.
- 'Contactless support': works with the native Android NFC reader and is available for any android smartphone.
- 'SIM Card': works with the native Android OMAPI reader and is available for any android smartphone. (Work in
progress)
- 'Embedded Secure Element': works with the Wizway plugin to access to eSE. (Work in progress)
- Settings (`SettingsMenuActivity`):
- Server (ServerSettingsActivity): Settings for server connexion.
- Configuration (ConfigurationSettingsActivity): Activate/Deactivate each plugin availability in the android
smartphone.
- Personalization (PersonalizationActivity): Reset a card (clean contracts).
- Card Reader (`CardReaderActivity`): Launches the flavour associated Keyple plugin. It will try to read Card using
selected card reader.
- Initialize Keyple plugin regarding selected Calypso card type.
- Connect to remote server.
- With remote server connected to a Calypso SAM, proceed to a secured reading of card content.
- Card Summary (`CardSummaryActivity`): displays the card content.
- Card content can be season pass and/or multi-trip ticket.
- Select Tickets (`SelectTicketsActivity`): The remote server will return a list of available products (Season Pass and
Multi-trip ticket) to buy for this card. This list presented in this view.
- Checkout (`CheckoutActivity`): Simulates a payment done with a credit card.
- Payment Validated (`PayementValidatedActivity`): Simulates the payment validation.
- Charge (`ChargeActivity`): Presents the process of loading the product selected.
- Block loading if card has been swapped.
- Initialize Keyple plugin regarding selected Calypso card type.
- Connect to remote server.
- With remote server connected to a SAM, proceed to a card writing.
- Charge Result (`ChargeResultActivity`): Displays if loading was successful or failed.
Loading

0 comments on commit 34cdf2f

Please sign in to comment.