Hi Jaikumar,
First of all, thanks a lot for all your responses so far, it was also
very usefull for me.
For my part, I'm trying to perform a SIM access with AT commands. As
you advised, I used the RIL interface of the Telephony Manager
package.
Indeed I have no choice but to modify the Telephony Manager Java class
of the Android framework.
Here is a sample of my code included in my custom
TelephonyManager.java :
public String simAccess() {
String rand = "testrand";
// Check is the SIM card is ready to use
String prop = SystemProperties.get
(TelephonyProperties.PROPERTY_SIM_STATE);
if ( "READY".equals(prop) ) {
// Build RIL & Message objects
RIL rilInterface = new RIL(this.mContext);
Message APDUResponse = Message.obtain();
// My custom request
String[] ADPURequest = { APDU_CLA, APDU_INS, APDU_P1, APDU_P2,
APDU_SIZE_DATA, mRAND, APDU_SIZE_DATA_EXPECTED };
// Launch the request => this is where it fails !!
rilInterface.invokeOemRilRequestStrings(ADPURequest,
APDUResponse);
// Handle the results
return (String) APDUResponse.getData().getKey("mykey");
}
}
with :
private static final String APDU_CLA = "A0";
private static final String APDU_INS = "88";
private static final String APDU_P1 = "00";
private static final String APDU_P2 = "00";
private static final String APDU_SIZE_DATA = "10";
private static final String APDU_SIZE_DATA_EXPECTED = "";
=> This code doesn't work & raise an exception.
That is why I need to pick your brain ;-).
- Are the creation of RIL & Message objects correct or should I use
other constructor / factory ?
- I wonder how to properly handle the result "Message.getData()" ... ?
Could you please clarify those points, or forward to documentation on
this subject ?
Thanks & Regards,
Gildas.
On 17 sep, 17:33, jaikumar Ganesh <
jaikum...@gmail.com> wrote:
> Hi James:
> SIM records are read using AT commands. None of the APIs mentioned in
> telelphony layer deal with AT commands directly, the RIL translates the RIL
> commands to AT commands.
>
> Currently, there is no way for applications to talk to the SIM directly. We
> are working on exposing telephony APIs soon.
>
> Thanks
> Jaikumar
>
> On Thu, Sep 10, 2009 at 5:48 PM, Zhihong GUO <
gzhh...@gmail.com> wrote:
> > Hi jaikumar,You mean we can send AT command to SIM directly, right? Even
> > the command is not registered in ril_commands.h? How to send AT command in
> > application, how can I test it.
> > Thank you so much!
>
> > James
>
> > 2009/7/1 jaikumar Ganesh <
jaikum...@gmail.com>
>
> > Hi Gayle:
>
> >> Unfortunately, due to resource constraints we don't plan to expose
> >> TelephonyManager APIs for direct SIM access during Eclair time frame (end of
> >> 2009).
> >> We do plan to expose some APIs but we we working on the specifics. It
> >> would be great if you could contribute and so send us a plan and we can work
> >> on the code using the open source system.
> >>
http://source.android.com/submit-patches
>
> >> Accessing the SIM - it would be better if its through the TelephonyManager
> >> API; if done directly throught the RIL your app might not work in future
> >> releases due to changes in the framework.
>
> >> I don't think anyone has used AT+APDU command directly. Again, please send
> >> a patch or a plan and we can work along with you to add a AT command module.
>
> >> Thanks
>
> >>> 1.
http://www.nextinnovation.org/doku.php?id=android_ril
> >>> 2.
http://www.nextinnovation.org/doku.php?id=android_telephony
>
> >>> Regards
>
> >>> Thierry GAYET
> >>> NextInnovation.org
> >>> +33(0)663.849.589
>
> >>> ------------------------------
> >>> *De :* GAYET Thierry <
thierry_ga...@yahoo.fr>
> >>> *À :* jaikumar Ganesh <
jaikum...@gmail.com>
> >>> *Envoyé le :* Mardi, 30 Juin 2009, 18h01mn 26s
> >>> *Objet :* Re : Re : [android-platform] SIM Access
>
> >>> Hi, some time ago you told me that you need time to reply two of my
> >>> questions (1 and 2).
>
> >>> I am expected the description of the Telephony API because i need to
> >>> develop one application with this one. I also need the date of their
> >>> delivery in the roadmap.
>
> >>> Will you extend the number of AT command supported ? If so may we know
> >>> which one ?
>
> >>> About my request i can help you to develop those points, because i will
> >>> do it on my side so maybe i could be nice to work on the same way as yours
> >>> but for that i need some more information.
>
> >>> Does this evolution will be available in the version 2.0 of Android ?
> >>> when the 2.0 will be officially released ?
>
> >>> Regards
>
> >>> Thierry GAYET
> >>> NextInnovation.org
> >>> +33(0)663.849.589
>
> >>> ----- Message transféré ----
> >>> *De :* jaikumar Ganesh <
jaikum...@gmail.com>
> >>> *À :*
thierry_ga...@yahoo.fr
> >>> *Envoyé le :* Mercredi, 24 Juin 2009, 1h21mn 39s
> >>> *Objet :* Fwd: Re : [android-platform] SIM Access
> >>> equivalent of *STK for 3G* networks). In fact i need to access the sim
> >>> card not just for unlocking the usim/isim card, but to access some crypto
> >>> function (need for a 3GPP Generic Bootstraping Architecture). Will you
> >>> include sooner or later USAT on the thephony framework part ?
>
> >>> Thanks in advance for your reply.
>
> >>> Best regards
>
> >>> Thierry GAYET
> >>> NextInnovation.org
> >>> +33(0)663.849.589
>
> >>> ------------------------------
> >>> *De :* GAYET Thierry <
thierry_ga...@yahoo.fr>
> >>> *À :*
android-...@googlegroups.com
> >>> *Envoyé le :* Mardi, 9 Juin 2009, 12h08mn 43s
> >>> *Objet :* Re : SIM Access on ADP1
> >>> ------------------------------
> >>> *De :* jaikumar Ganesh <
jaikum...@gmail.com>
> >>> *À :*
android-...@googlegroups.com
> >>> *Envoyé le :* Mercredi, 3 Juin 2009, 6h47mn 32s
> >>> *Objet :* Re: SIM Access on ADP1
>
> >>> Hey Meni:
> >>> Currently there is no public API to access the SIM cards - we are
> >>> planning to adding public APIs soon.
>
> >>> You can look at SimRecords.java and TelephonyManager code to see how to
> >>> access the SIM.
>
> >>> Thanks
> >>> Jaikumar
>
> >>> On Sun, May 31, 2009 at 1:40 AM, meni <
menili...@gmail.com> wrote:
>
> >>>> Hi all,
>
> >>>> I know there's no API to access the SIM card to run commands on it.
> >>>> Nontheless, does anyone know if the SIM card can be accessible on the
> >>>> low
>
> ...
>
> plus de détails »