- Development Kit User Guide
- Setup, Samples and Tools
- Running the Samples
- Running the classic_applets Samples
- StringHandlingApp Sample
- Running the StringHandlingApp Sample from Eclipse
Running the StringHandlingApp Sample from Eclipse
The StringHandlingApp sample consists of three Java Card projects: StringHandlingApp
, StringHandlingAppLib
, and StringHandlingAppLibLocal
.
Start Eclipse. Sample_Platform and Sample_Device must already be created.
- Import the following Java Card projects into your workspace:
StringHandlingApp
,StringHandlingAppLib
, andStringHandlingAppLibLocal
. If the builds don't start automatically, start them manually.About the build order: theStringHandlingApp
project depends on bothStringHandlingAppLib
andStringHandlingAppLibLocal
.StringHandlingAppLibLocal
depends onStringHandlingAppLib
. These dependencies define the order in which the projects are built by Eclipse: firstStringHandlingAppLib
, thenStringHandlingAppLibLocal
, and finallyStringHandlingApp
. In theStringHandlingApp
project, the packages are built in order of their AID values: firstcom.sun.jcclassic.samples.stringapp
, thencom.sun.jcclassic.samples.stringutilapp
. - Perform the following steps for the
StringHandlingApp
project:- In the Package Explorer view, click the StringHandlingApp project.
- Right-click on the Java Card project and select Java Card and CAP Files Settings.
- Select a CAP file from the list that appears in the Java Card CAP Files page.
- Click StringHandlingApp1 and select Edit.
- In the Edit mode, select Compact CAP File.
- Click Next>.
- Select ScriptGen slide and select the Supress "PowerUp; APDU command at the beginning of CAP script and Supress "PowerDown; APDU command at the end of CAP script check boxes.
- Click Finish.
- Repeat Steps a to c.
- Click StringHandlingApp2 and select Edit.
- Repeat Steps e to g.
- Click Finish, and select Apply and Close.
- Perform the following steps for the
StringHandlingAppLib
project:- In the Package Explorer view, click the StringHandlingAppLib project.
- Right-click on the Java Card project and select Java Card and CAP Files Settings.
- Select a CAP file from the list that appears in the Java Card CAP Files page.
- Click StringHandlingAppLib and select Edit.
- In the Edit mode, select Compact CAP File.
- Click Next>.
- Select ScriptGen slide and select the Supress "PowerDown; APDU command at the end of CAP script check box.
- Click Finish, and select Apply and Close.
- Perform the following steps for the
StringHandlingAppLibLocal
project:- In the Package Explorer view, click the StringHandlingAppLibLocal project.
- Right-click on the Java Card project and select Java Card and CAP Files Settings.
- Select a CAP file from the list that appears in the Java Card CAP Files page.
- Click StringHandlingAppLibLocal and select Edit.
- In the Edit mode, select Compact CAP File.
- Click Next>.
- Select ScriptGen slide and select the Supress "PowerUp; APDU command at the beginning of CAP script and Supress "PowerDown; APDU command at the end of CAP script check boxes.
- Click Finish, and select Apply and Close.
- Rebuild the modified projects: select Project and Clean, and from the Clean dialog, select the three projects that you just modified. Eclipse builds the projects again.
- In Java Card View, double-click on Sample_Device. In the Properties for Sample_Device dialog, select the CREF tab:
- Clear the Input file with EEPROM data, the Output file for EEPROM data, and the Combined (input and output) file for EEPROM data fields.
- Clear Do not open APDU console.
- Click OK.
- In Java Card View, right-click on Sample_Device and select Start.The simulator starts and you can see that Sample_Device console is created.
- Execute the scripts in the following order:
cap-StringHandlingApp
cap-StringHandlingAppLibLocal
cap-StringHandlingApp1
cap-StringHandlingApp2
stringhandlingapp
Now you can compare the console output with the contents of
test.expected.output
file.