IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Applets Java Discussion :

applet java card


Sujet :

Applets Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Candidat au Club
    Inscrit en
    Septembre 2010
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Septembre 2010
    Messages : 2
    Par défaut applet java card
    Bonjour,

    J'ai besoin de faire un appel à une midlet installée dans un téléphone.

    Lors de la compilation elle m'affiche plusieurs erreurs.

    Voici le code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    package demo_applet_apdu;
     
    import uicc.toolkit.*;
    import uicc.usim.access.USIMConstants ;
    import uicc.access.*;
    import javacard.framework.*;
    import javacard.security.*;
    import javacardx.crypto.*;
     
    public class example_applet_apdu extends javacard.framework.Applet implements ToolkitInterface,uicc.toolkit.ToolkitConstants 
    {
     // variables obligatoires
     private ToolkitRegistry reg ;
     final byte DCS_8_BIT_DATA =0x04 ;
     private FileView uiccView ;
     private byte[] messageToDisplay = { (byte) 0x61,(byte) 0x62,(byte) 0x63,(byte) 0x64,(byte) 0x31,(byte) 0x32,(byte) 0x33,(byte) 0x34 };
     
     /**
     Constructeur de l’applet
     */
     public example_applet_apdu ( byte[] bArray,short bOffset,byte bLength ) 
    {
     // Enregistrement de l’applet
     register(bArray,(short)(bOffset+1),(byte) bArray [bOffset]);
     // Référence de l’applet
     // avec l’objet ToolkitRegistry
     reg=ToolkitRegistrySystem.getEntry();
     tempBuffer =JCSystem.makeTransientByteArray(( short ) 155,JCSystem.CLEAR_ON_RESET );
     // référence de l’objet File View
     uiccView = UICCSystem.getTheUICCView (JCSystem.CLEAR_ON_RESET);
     }
     
     /**
     Methode d’installation invoquée par le JCRE à l’installation
     @param bArray tableau d’octet pour l’AID
     @param bOffset début de l’AID
     @param bLength longueur de l’AID
     */
     public static void install ( byte [] bArray ,short bOffset , byte bLength ) {
     // création de l’applet Java SIM toolkit
     applet_test StkCommandsExampleApplet = new
     example_applet_apdu(bArray,bOffset,bLength);
     }
     
     /**
     Methode invoquée par la plateforme GSM
     */
     public Shareable getShareableInterfaceObject (AID clientAID,byte parameter ) 
    {
     if ((parameter==(byte) 0x01 )&&(clientAID == null )) {
     return ((Shareable) this );
     }
     return null ;
     }
     
     /**
     Method invoquée par la plateforme SIM tollkit
     @param event représentation en octets
     de l’événement déclenché
     */
     public void processToolkit ( short event ) {
     if ( event ==EVENT_PROACTIVE_HANDLER_AVAILABLE )
    {
     reg.clearEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE );
     displayText ();
     }
     }
     
     /**
     Methode invoquée par le JCRE
     @param apdu objet APDU entrant
     */
     public void process ( APDU apdu ) {
     // ignore la commande
     // de sélection de l’applet
     if ( selectingApplet ()) {
     return ;
     }
     reg.setEvent(EVENT_PROACTIVE_HANDLER_AVAILABLE);
     
     }
     
     public void displayMessage ( ProactiveHandlerproHdlr,byte [] messageBuffer,boolean flag ) {
     // reconstruction du proactive handler
     //et affichage du message défini
     proHdlr.initDisplayText(( byte ) 0,DCS_8_BIT_DATA,messageBuffer,( short ) 0, ( short ) ( messageBuffer.length ));
     proHdlr.send ();
     // arrêt de l’exécution de l’applet
     if ( flag ) {
     ToolkitException.throwIt (( short ) 0x0000 );
     }
     }
     
     private void displayText () {
     ProactiveHandler proHdlr = ProactiveHandlerSystem.getTheHandler ();
     displayMessage(proHdlr,messageToDisplay,false );
     }
    }
    Quelqu'un saurait-il m'indiquer comment les corriger ?

    Merci d'avance pour votre aide.

  2. #2
    Membre Expert
    Avatar de slim_java
    Homme Profil pro
    Enseignant
    Inscrit en
    Septembre 2008
    Messages
    2 272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Septembre 2008
    Messages : 2 272
    Par défaut
    Bienvenue
    Citation Envoyé par aamine6 Voir le message
    lors de la compilation elle m affiche plusieurs erreurs merci d avance .
    il faut nous montrer ces erreurs pour qu'on puisse t'aider.

  3. #3
    Candidat au Club
    Inscrit en
    Septembre 2010
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Septembre 2010
    Messages : 2
    Par défaut
    Merci pour votre réponse.

    Je précise que je ne suis pas développeur Java mais plutôt spécialisé en Telecom et j'ai un PFE en STK (Sim Tool Kit), donc programmation des cartes SIM qui peut se faire sous Eclipse, à l'aide de la bibliothèque APDU.

    Voici les erreurs de compilation :
    Description Resource Path Location Type
    AID cannot be resolved to a type example_applet_apdu.java /test/src line 52 Java Problem
    APDU cannot be resolved to a type example_applet_apdu.java /test/src line 77 Java Problem
    applet_test cannot be resolved to a type example_applet_apdu.java /test/src line 45 Java Problem
    EVENT_PROACTIVE_HANDLER_AVAILABLE cannot be resolved to a variable example_applet_apdu.java /test/src line 66 Java Problem
    EVENT_PROACTIVE_HANDLER_AVAILABLE cannot be resolved to a variable example_applet_apdu.java /test/src line 68 Java Problem
    EVENT_PROACTIVE_HANDLER_AVAILABLE cannot be resolved to a variable example_applet_apdu.java /test/src line 83 Java Problem
    FileView cannot be resolved to a type example_applet_apdu.java /test/src line 19 Java Problem
    FileView cannot be resolved to a type example_applet_apdu.java /test/src line 34 Java Problem
    javacard cannot be resolved to a type example_applet_apdu.java /test/src line 14 Java Problem
    JCSystem cannot be resolved example_applet_apdu.java /test/src line 32 Java Problem
    JCSystem cannot be resolved to a variable example_applet_apdu.java /test/src line 32 Java Problem
    JCSystem cannot be resolved to a variable example_applet_apdu.java /test/src line 34 Java Problem
    ProactiveHandler cannot be resolved to a type example_applet_apdu.java /test/src line 99 Java Problem
    ProactiveHandlerproHdlr cannot be resolved to a type example_applet_apdu.java /test/src line 87 Java Problem
    ProactiveHandlerSystem cannot be resolved example_applet_apdu.java /test/src line 99 Java Problem
    Shareable cannot be resolved to a type example_applet_apdu.java /test/src line 52 Java Problem
    Shareable cannot be resolved to a type example_applet_apdu.java /test/src line 55 Java Problem
    Syntax error on token "ProactiveHandlerproHdlr", VariableDeclaratorId expected after this token example_applet_apdu.java /test/src line 87 Java Problem
    tempBuffer cannot be resolved to a variable example_applet_apdu.java /test/src line 32 Java Problem
    The declared package "demo_applet_apdu" does not match the expected package "" example_applet_apdu.java /test/src line 2 Java Problem
    The import javacard.framework cannot be resolved example_applet_apdu.java /test/src line 10 Java Problem
    The import javacard.security cannot be resolved example_applet_apdu.java /test/src line 11 Java Problem
    The import javacardx cannot be resolved example_applet_apdu.java /test/src line 12 Java Problem
    The import uicc.access cannot be resolved example_applet_apdu.java /test/src line 9 Java Problem
    The import uicc.toolkit cannot be resolved example_applet_apdu.java /test/src line 7 Java Problem
    The import uicc.usim cannot be resolved example_applet_apdu.java /test/src line 8 Java Problem
    The method register(byte[], short, byte) is undefined for the type example_applet_apdu example_applet_apdu.java /test/src line 28 Java Problem
    The method selectingApplet() is undefined for the type example_applet_apdu example_applet_apdu.java /test/src line 80 Java Problem
    ToolkitInterface cannot be resolved to a type example_applet_apdu.java /test/src line 14 Java Problem
    ToolkitRegistry cannot be resolved to a type example_applet_apdu.java /test/src line 17 Java Problem
    ToolkitRegistry cannot be resolved to a type example_applet_apdu.java /test/src line 31 Java Problem
    ToolkitRegistry cannot be resolved to a type example_applet_apdu.java /test/src line 68 Java Problem
    ToolkitRegistry cannot be resolved to a type example_applet_apdu.java /test/src line 83 Java Problem
    ToolkitRegistrySystem cannot be resolved example_applet_apdu.java /test/src line 31 Java Problem
    uicc cannot be resolved to a type example_applet_apdu.java /test/src line 14 Java Problem
    UICCSystem cannot be resolved example_applet_apdu.java /test/src line 34 Java Problem

  4. #4
    Membre Expert
    Avatar de slim_java
    Homme Profil pro
    Enseignant
    Inscrit en
    Septembre 2008
    Messages
    2 272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Septembre 2008
    Messages : 2 272
    Par défaut
    Bonjour,

    As-tu bien ajouté cette bibliothèque APDU à ton projet car les packages sont-ils connus d'Eclipse ?

Discussions similaires

  1. applet java
    Par radi dans le forum Applets
    Réponses: 1
    Dernier message: 08/06/2005, 16h00
  2. Bordures autour d'un applet java sous firefox
    Par laloi dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 03/05/2005, 15h23
  3. [Conversion]Applet Java Vers Java Web Start
    Par robin206 dans le forum JWS
    Réponses: 2
    Dernier message: 20/04/2005, 09h28
  4. flash & applet java
    Par subzero82 dans le forum Flash
    Réponses: 3
    Dernier message: 23/01/2005, 17h04
  5. [VB.NET] Passage de parametres à une Applet Java
    Par AntiSAL dans le forum ASP.NET
    Réponses: 4
    Dernier message: 18/08/2004, 11h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo