An interesting platform of Java Cards , which runs JVM on smart cards. With the release of Java Cards 3.0, it has it more interesting options.
The two flavors are :
- Classic : The same kind as of the earlier Java Cards. This platform is limited . As it goes, you cannot implement String or floating point numbers.
- Extended or Connected Version: These are powerful smart cards and are more capable in terms of supporting complete implementation of the Java platform. The term Connected refers to the networking capabilities. Thus it supports Servlets natively. And hence, we could write a web application which runs on a smart card.
Now we’ll have the environment setup for of our first application.
We need :
- The Netbeans IDE (6.8 or more)
- A Java Card and a Smart card reader OR the emulator. ( The emulator is available ONLY for Windows and unfortunately not Mac or Linux.)
- Java Card plugins for Netbeans
- Java Development Kit ( Version 6 or more)
- Install the Netbeans IDE. After successful installation, visit Tools and then Plugin menu . Under Available Plugins tab select Java Card and Java Card Runtime Bundle. Restart the IDE for the changes to be effective.
- The runtime bundle can be downloaded from the Plugin Manager( Step 1) or by visiting java.sun.com. If you followed the former option, you can skip this step. If the plugin was download and installed from the site, you need to register the platform. Visit Tools-> Java Platforms and add Java Card Platform to the IDE. to register it. Now you can visit Windows- > Services from the menu and validate if you have the platform registered under Java Card Runtimes.
Different Types of Java Card Projects
Lets build our project. Select File-> New Project from the menu and choose the Java Card category. Now, here we have several kinds of projects.
- Classic Applet Project : This is the traditional Java Card applet for smaller devices like the earlier versions of Java Cards.
- Classic Library Project : This is the library project for the traditional cards. Libraries are without applets and can be the code that resides on the device to be shared between various applets.
- Extended Applet Project: These are the newer Java Card 3.0 projects where you can use more complex java methods.
- Extended Library Project: These are library projects for the extended APIs.
- Web Project : Projects where you can implement Servlets and have full access to Servlet API. Web Projects are cooler as you don’t need any special code on the client to interact with the application running on the device except a web browser.
Lets select Web Project for our further implementation of the tutorial.
On the next screen, give your Project a name and set the project location. Click Finish and we have the skeleton project ready.
Now, you can go ahead and code the servlet. The web app can be run to deploy its result on the web browser. Go ahead, play with your code. Good Luck !