2014-04-08 2 views
0

NFC를 사용하는 안드로이드 응용 프로그램을 통해 내 컴퓨터에 암호 필드를 채우려고합니다. 나는 삼성 Galaxy sIII와 ACR122U USB NFC 읽기/쓰기기를 가지고있다. 나는 다수의 가이드를 읽었다. 그러나 나는 그들이 매우 도움이되었다는 것을 발견하지 못했다. (나는 이것에 처음이다.) 이것은 네가 지금까지 가지고있는 모든 iv이다. greate 도움NFC NDEF 메시지

나는 나의 AndroidManifest를 내가 제대로 이해하면, 당신은을 보내려 (I 비밀번호 내가 보내려 암호입니다 말하고이에 유의하시기 바랍니다)

public class NFCHandler extends Activity { 
private NfcAdapter mAdapter; 
private TextView mText; 
private NdefMessage mMessage; 

@Override 
public void onCreate(Bundle savedState) { 
    super.onCreate(savedState); 

    mAdapter = NfcAdapter.getDefaultAdapter(this); 

    // Create an NDEF message a URL 
    mMessage = new NdefMessage(NdefRecord.createMime("text/plain", "Password".getBytes())); 

    setContentView(android.R.layout.activity_list_item); 
    mText = (TextView) findViewById(R.id.loginPassword); 

    if (mAdapter != null) { 
     mAdapter.setNdefPushMessage(mMessage, this); 
     mText.setText("Password"); 
    } else { 
     mText.setText("This phone is not NFC enabled."); 
    } 
} 
} 
+0

여기서 물어보고 싶은 것은 무엇입니까? 전화에서 ACR122U로 NDEF 메시지를 보내는 방법은 무엇입니까? PC sinde에서 암호를 받고 암호 필드에 채우는 방법? –

+0

마이클, 내가 본 가이드는 PC쪽에 대해 의지하지 않고 있으며, 전화 응용 프로그램에 어려움을 겪고 있습니다. – 011011010101110100001010010

답변

0

을 완료하고 있는가 ndef 레코드의 암호. 귀하의 코드는 현재 작성한 NdefRecord와 관계가없는 mText 필드에 암호를 설정하고 있습니다. NdefRecord.createUri 대신 NdefRecord.createMime ("text/plain", "password".getBytes ("UTF-8"))을 사용해야합니다.

관련 문제