NfcF connect - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for NfcF connect method.

This code example shows how to use the following methods:connect, isConnected, transceive
        if (this.felicaTag == null) {
            throw new NfcException("felicaTag is null!"); 
        } 
 
        try { 
            if (!felicaTag.isConnected()) {
                felicaTag.connect();
            } 
            result = felicaTag.transceive(commandPacket.getBytes());
        } catch (IOException e) {
            throw new NfcException(e);
        } 
        return new CommandResponse(result);
    } 
 
    /** 
     * Pollingを行います。正常に終了した場合、取得したIDmを自身オブジェクト内に保存します。 
     *  
     * @param systemCode 
     *            Pollingを行う対象の systemCode 
5
CodeRank
This code example shows how to use the following methods:close, connect, transceive
    public byte[] executeRawCommand(byte[] rawCommand) throws TagLostException, IOException {
        if (rawCommand == null || rawCommand.length == 0)
            throw new IllegalArgumentException();
 
        try { 
            mNfcF.connect();
            byte[] response = mNfcF.transceive(rawCommand);
            return response;
        } finally { 
            try { 
                mNfcF.close();
            } catch (IOException e) {
                // ignore 
            } 
        } 
    } 
 
    /** 
     * 対応していないタグを渡された際に発生する例外です 
     *  
5
CodeRank
This code example shows how to use the following methods:connect
	/** 
	 * スマートタグに接続します。 
	 * @throws Exception 
	 */ 
	public void connect() throws Exception{ 
		mFelica.connect();
	} 
 
	/** 
	 * スマートタグを閉じます。 
	 * @throws Exception 
	 */ 
	public void close() throws Exception{ 
		mFelica.close();
	} 
 
	/** 
	 * スマートタグかどうかを取得します。 
	 * @return スマートタグである場合はtrue、それ以外はfalse。 
	 */ 
3
CodeRank
This code example shows how to use the following methods:connect
	 * @see		{@link FelicaLite#close()} 
	 */ 
	public static NfcF connect(Tag tag) throws IOException {
		mTag = tag;
		mNfcF = NfcF.get(tag);
		mNfcF.connect();
		return mNfcF;
	} 
 
	 
	/** 
	 * {@link #connect(Tag)}を呼び出したかどうかのチェック 
	 *  
	 * @return	true	呼び出している 
	 */ 
	static boolean check() { 
		return (mTag != null) && (mNfcF != null);
	} 
	 
 
3
CodeRank
This code example shows how to use the following methods:connect
	 * @see		{@link FelicaLite#close()} 
	 */ 
	public static NfcF connect(Tag tag) throws IOException {
		mTag = tag;
		mNfcF = NfcF.get(tag);
		mNfcF.connect();
		return mNfcF;
	} 
 
	 
	/** 
	 * {@link #connect(Tag)}を呼び出したかどうかのチェック 
	 *  
	 * @return	true	呼び出している 
	 */ 
	static boolean check() { 
		return (mTag != null) && (mNfcF != null);
	} 
	 
 
3
CodeRank
connect Method Overview
Enable I/O operations to the tag from this TagTechnology object.
See Code Examples for other Android NfcF Methods: