StringHandlingApp Sample
The StringHandlingApp
sample demonstrates how annotations and string utility methods for the Java Card platform are used and showcases the use of:
Annotations in
javacardx.annotations.StringDef
andjavacardx.annotations.StringPool
String utility methods defined in
javacardx.framework.string.StringUtil
This sample also demonstrates how two applets can have different contexts but both access the same string constant from a library.
The sample is composed of two applets (StringHandlingApp
and StringUtilApp
) and two libraries (StringHandlingLib
and StringHandlingLibLocal
). The libraries use string annotations to define string constants. The two applets use annotations to define their own set of string constants and to import string constants from the libraries.
In this sample, an applet such as StringHandlingApp
uses string constants that it imports from one library, StringHandlingLibLocal
, that are in turn imports of constants from another library, StringHandlingLib
.
Follow one of these sets of instructions to run this sample: