Java Code Examples for android.nfc.tech.IsoDep#close()

The following examples show how to use android.nfc.tech.IsoDep#close() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AndroidCard.java    From nordpol with MIT License 7 votes vote down vote up
public static AndroidCard get(Tag tag) throws IOException {
    IsoDep card = IsoDep.get(tag);

    if(card != null) {
        /* Workaround for the Samsung Galaxy S5 (since the
         * first connection always hangs on transceive).
         * TODO: This could be improved if we could identify
         * Samsung Galaxy S5 devices
         */
        card.connect();
        card.close();
        return new AndroidCard(card);
    } else {
        return null;
    }
}
 
Example 2
Source File: AndroidCard.java    From GreenBits with GNU General Public License v3.0 6 votes vote down vote up
public static AndroidCard get(Tag tag) throws IOException {
    IsoDep card = IsoDep.get(tag);

    /* Workaround for the Samsung Galaxy S5 (since the
     * first connection always hangs on transceive).
     * TODO: This could be improved if we could identify
     * Samsung Galaxy S5 devices
     */
    card.connect();
    card.close();

    if(card != null) {
        return new AndroidCard(card);
    } else {
        return null;
    }
}
 
Example 3
Source File: AndroidCard.java    From WalletCordova with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static AndroidCard get(Tag tag) throws IOException {
    IsoDep card = IsoDep.get(tag);

    /* Workaround for the Samsung Galaxy S5 (since the
     * first connection always hangs on transceive).
     * TODO: This could be improved if we could identify
     * Samsung Galaxy S5 devices
     */
    card.connect();
    card.close();

    if(card != null) {
        return new AndroidCard(card);
    } else {
        return null;
    }
}
 
Example 4
Source File: NfcManager.java    From nfcspy with GNU General Public License v3.0 5 votes vote down vote up
static void disconnect(IsoDep tag) {
	try {
		if (tag != null)
			tag.close();
	} catch (Exception e) {
	}
}