Convert BasicCardString to Java String


[ Follow Ups ] [ BasicCard User Forum ]

Posted by njouda (2.91.83.76) on October 14, 2013 at 12:33:04:

Hello,

I'm a basic card beginner.I was learning the basic card language. and I create a small program with java using basic card java library. But I have a problem with converting Basic String to java String. I tried every thing but nothing worked !
=============Application output==========
Please insert a BasicCard To test program
Data From Card is:
====================
There is no string !!!!

could you please could help me, I spent hours trying to solve it.

This is my java code:

Main.class:

String data;
data=helooservice.CardData();
System.out.println("Data From Card is:" + data);
===

HelooService.java
public String CardData()throws CommsException, UnsupportedEncodingException
{BasicCardCommand cmd = new BasicCardCommand(0x88, 0x00);
BasicCardResponse rsp = doCommandAndResponse(cmd);
rsp.checkSW1SW2();
BasicCardString b1 = new BasicCardString ();
b1 = rsp.fetchBasicString();
String s;
s= b1.toString(STRING_ENCODING);
return s;
}




Follow Ups:


[ Follow Ups ] [ BasicCard User Forum ]