Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7965659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:13:12+00:00 2026-06-04T06:13:12+00:00

Im new to UICC and Secure Elements and I tried to do a simple

  • 0

Im new to UICC and Secure Elements and I tried to do a simple android
application using this tutorial (http://code.google.com/p/seek-for-
android/wiki/UsingSmartCardAPI) to connect the Secure Elements. When I
run the application it throw an java.lang.SecurityException:
Connection refused !!!. PLease help.
Thanks

code

public void onCreate(Bundle savedInstanceState) { 
          final String LOG_TAG = "HelloSmartcard";     
          super.onCreate(savedInstanceState);     
          LinearLayout layout = new LinearLayout(this); 
          layout.setLayoutParams(new LayoutParams( 
                  LayoutParams.WRAP_CONTENT, 
                  LayoutParams.WRAP_CONTENT)); 

          Button button = new Button(this); 
          button.setLayoutParams(new LayoutParams( 
                  LayoutParams.WRAP_CONTENT, 
                  LayoutParams.WRAP_CONTENT));     
          button.setText("Click Me"); 
          button.setOnClickListener(new OnClickListener() { 
            public void onClick(View v) { 
                try { 
                      Log.d(LOG_TAG, "Retrieve available readers..."); 
                      Reader[] readers = seService.getReaders(); 
                      if (readers.length < 1) 
                         return;     
                      Log.d(LOG_TAG, "Create Session from the first reader..."); 
                      Session session = readers[0].openSession();     
                      Log.d(LOG_TAG, 
                      "Create logical channel within the session..."); 
                      Channel channel = session.openLogicalChannel(new 
byte[] { 
                      (byte) 0xD2, 0x76, 0x00, 0x01, 0x18, 0x00, 0x02, 
                      (byte) 0xFF, 0x49, 0x50, 0x25, (byte) 0x89, 
                      (byte) 0xC0, 0x01, (byte) 0x9B, 0x01 });     
                      //Log.d(LOG_TAG, "Send HelloWorld APDU command"); 
                      byte[] respApdu = channel.transmit(new byte[] { 
                      (byte) 0x90, 0x10, 0x00, 0x00, 0x00 });     
                      channel.close();     
                      // Parse response APDU and show text but remove SW1 SW2 first 
                      byte[] helloStr = new byte[respApdu.length - 2]; 
                      System.arraycopy(respApdu, 0, helloStr, 0, 
respApdu.length - 2); 
                      Toast.makeText(MainActivity.this, new 
String(helloStr),   Toast.LENGTH_LONG).show(); 
                   } catch (Exception e) { 
                      Log.e(LOG_TAG, "Error occured:", e); 
                      return; 
                   } 
            } 
          }); 

          layout.addView(button); 
          setContentView(layout); 
          try { 
                Log.i(LOG_TAG, "creating SEService object"); 
                seService = new SEService(this, this); 
              } catch (SecurityException e) { 
                Log.e(LOG_TAG, "Binding not allowed, uses-permission org.simalliance.openmobileapi.SMARTCARD?"); 
              } catch (Exception e) { 
                Log.e(LOG_TAG, "Exception: " + e.getMessage()); 
              } 

    } 

logcat

05-22 08:11:49.669: E/HelloSmartcard(6691): Error occured:
05-22 08:11:49.669: E/HelloSmartcard(6691): java.lang.SecurityException: Connection refused !!!
05-22 08:11:49.669: E/HelloSmartcard(6691):     at org.simalliance.openmobileapi.SEService.checkForException(SEService.java:611)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at org.simalliance.openmobileapi.SEService.openLogicalChannel(SEService.java:479)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at org.simalliance.openmobileapi.Session.openLogicalChannel(Session.java:143)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at com.gieseckedevrient.android.hellosmartcard.MainActivity$1.onClick(MainActivity.java:50)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at android.view.View.performClick(View.java:2485)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at android.view.View$PerformClick.run(View.java:9080)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at android.os.Handler.handleCallback(Handler.java:587)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at android.os.Looper.loop(Looper.java:130)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at android.app.ActivityThread.main(ActivityThread.java:3768)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at java.lang.reflect.Method.invokeNative(Native Method)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at java.lang.reflect.Method.invoke(Method.java:507)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
05-22 08:11:49.669: E/HelloSmartcard(6691):     at dalvik.system.NativeStart.main(Native Method)

Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gieseckedevrient.android.hellosmartcard"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />
    <uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD"/>
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
         <uses-library android:name="org.simalliance.openmobileapi" android:required="false" />
    </application>

</manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:13:13+00:00Added an answer on June 4, 2026 at 6:13 am

    //Define the permission in the AndroidManifest.xml file

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to javascript, but I'm sure this is easy. Unfortunately, most of the google
New to ASP.NET MVC 3. This seems like it should be a really simple
new to python. This is probably simple but I haven't found an answer. rndStr
New to javascript/jquery and having a hard time with using this or $(this) to
New programmer here, I am trying to understand and break down this code below
New to all this so forgive my ignorance. I am trying to figure out
new to JBoss and am configuring some applications. I know how to do this
New to Quartz and I am curious on the drawing speeds of simple shapes,
NEW EDIT: I have narrowed my problem to this - i have a view
New to WPF so I'm sure it's an easy one this; for every control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.