Android�A�v����NFC�^�O��ǂݏ������邽�߂̊�b�m���FAndroid�œ����g��Java�A�v���쐬����i38�j�i1/3 �y�[�W�j

Android ��API���g����Suica�^Edy�^�^�]�Ƌ��؂Ȃǂ�IDm��ǂޕ��@�ANFC�^�O�ɏ���ǂݏ���������@�ɂ‚��ĉ�����܂�

» 2012�N11��27�� 18��00�� ���J
[�������C�C�[�t���[]

���p�i�K�ɓ�����NFC���A�v���Ŏg���Ă݂悤

�@Android�̓o�[�W����2.3����NFC�iNear Field Communication�F�ߋ��������ʐM�j���T�|�[�g���Ă��܂��BAndroid 2.3��2010�N12�����\�Ȃ̂ŁA�o�ꂵ�Ė�2�N�ł��B�s��ɂ�NFC���T�|�[�g�����X�}�[�g�t�H�����o���A���[�U�[�̎�ɂ��s���n��A���낻����p�i�K�ɓ������̂ł͂Ȃ��ł��傤���B

�@�����Android NFC��API���g�p����Suica�^ICOCA�^PASMO�^Edy�^�^�]�Ƌ��؂Ȃǂ�IDm�i�J�[�h�ŗL�̔ԍ��j��ǂݍ��ޕ��@�ANFC�^�O�ւ̏��̏������݁E�ǂݏo�����@�ɂ‚��ĉ�����܂��B

�@NFC�̊�{�I�ȏ��͋L���uNFC�͎�����ߋ����ʐM�̃f�t�@�N�g�ƂȂ邩�v���Q�Ƃ��Ă��������B

�@����̃T���v���A�v���͈ȉ���2�‚ł��B

�A�v����NFC�^�O���g�p���邽�߂�

�@�A�v����NFC���g�p���邽�߂ɂ́AAndroidManifest.xml�ɂ����‚��̐錾���K�v�ł��BNfcDiscover��AndroidManifest.xml���ɐ������܂��B

<?xml version="1.0" encoding="utf-8"?>
<manifest
  xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.android.nfc.discover"
  android:versionCode="1"
  android:versionName="1.0" >
 
  <uses-feature
    android:name="android.hardware.nfc"
    android:required="true" /> �y1�z
  <uses-permission
    android:name="android.permission.NFC" />�y2�z
  <uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="17" />
 
  <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
      android:name="com.example.android.nfc.discover.MainActivity"
      android:label="@string/app_name"
      android:permission="android.permission.NFC" > �y3�z
      <intent-filter>
        <action android:name="android.nfc.action.TAG_DISCOVERED" /> �y4�z
 
        <category android:name="android.intent.category.DEFAULT" />
      </intent-filter>
 
      <meta-data
        android:name="android.nfc.action.TAG_DISCOVERED"
        android:resource="@xml/nfc_filter" /> �y5�z
    </activity>
  </application>
</manifest>

�@NFC���g�p����ɂ́A�y1�z�̂悤��<uses-feature>�Ɓy2�z�̂悤��<uses-permission>��錾���܂��i�T���v���A�v��NfcDiscover�ł́A<uses-feature>��<uses-permission>��K�v�Ƃ���API�͌Ăяo���Ă��Ȃ����߁A�K�v����܂���B�ǂ�API���錾���K�v�ł��邩��Javadoc�̊e���\�b�h�ɋL�ڂ���Ă��邽�߁A�J���̍ۂɂ͂�������Q�Ƃ��Ă��������j�B

�@<activity>�́y3�z�̃p�[�~�b�V������`�́A���̃A�N�e�B�r�e�B�̋N������NFC�̃p�[�~�b�V������ێ����Ă��邱�Ƃ�v��������̂ł��B����͓��ɕK�v�ł͂���܂��񂪁AEclipse�̌x�����Ȃ������߂ɕt���Ă��܂��B

�@<intent-filter>�́y4�z�̃A�N�V�����ɂ́A�u"android.nfc.action.TAG_DISCOVERED"�v�݂̂��Z�b�g���Ă��܂��B����ŁA�����`���[�ɂ̓A�C�R���͍쐬���ꂸ�ANFC�^�O��ǂݍ��񂾏ꍇ�ɂ̂݋N�����܂��B�y4�z�Ɓy5�z�̃A�N�V�����͍��킹��K�v������܂��B

�@<meta-data>�́y5�z�ɂ́A�N������A�N�V�����ƋN������g���K�[�ƂȂ�NFC�^�O�̎�ނ��t�B���^�Ƃ��Đݒ肵�܂��B

NFC�Ɋւ���A�N�V����

�@�A�N�V�����͈ȉ��̒ʂ�A�D�揇�ʂ�����܂��B

  • android.nfc.action.ACTION_NDEF_DISCOVERED

�@�ǂݍ��񂾃^�O��NDEF�iNFC Data Exchange Format�j�y�C���[�h�����ꍇ�A���̃A�N�V��������`���ꂽ�A�N�e�B�r�e�B��Intent���ʒm����܂��B�D�揇�ʂƂ��Ă͈�ԍ����A�g���K�ƂȂ�^�O�͕����o�^����̂ł͂Ȃ��P��ɂ���̂��]�܂����ł��B���̃A�N�V�����ŃA�N�e�B�r�e�B���N�������ꍇ�AACTION_TECH_DISCOVERED�܂���ACTION_TAG_DISCOVERED�œo�^����Ă���A�N�e�B�r�e�B�������Ă��A�N������邱�Ƃ͂���܂���B

  • android.nfc.action.ACTION_TECH_DISCOVERED

�@ACTION_TAG_DISCOVERED�����D�揇�ʂ������A�N�V�����ł��B���̃A�N�V�����ŃA�N�e�B�r�e�B���N�������ꍇ�AACTION_TAG_DISCOVERED�̃A�N�e�B�r�e�B�͋N�����܂���B�t�B���^�Œ�`�������ׂẴ^�O��and�����ŋN�����܂��B

  • android.nfc.action.ACTION_TAG_DISCOVERED

�@�ł��D�揇�ʂ��Ⴂ�A�N�V�����B�t�B���^�Œ�`�������ׂẴ^�O��or�����ŋN�����܂��B

NFC�̃t�B���^

�@�t�B���^�͈ȉ��̂悤��xml���L�ڂ��܂��B

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" >
 
  <tech-list>
    <tech>android.nfc.tech.IsoDep</tech>
    <tech>android.nfc.tech.MifareClassic</tech>
    <tech>android.nfc.tech.MifareUltralight</tech>
    <tech>android.nfc.tech.Ndef</tech>
    <tech>android.nfc.tech.NdefFormatable</tech>
    <tech>android.nfc.tech.NfcA</tech>
    <tech>android.nfc.tech.NfcB</tech>
    <tech>android.nfc.tech.NfcBarcode</tech>
    <tech>android.nfc.tech.NfcF</tech>
    <tech>android.nfc.tech.NfcV</tech>
  </tech-list>
 
</resources>

�@<tech>�^�O�̒��ɂ́A����������ނ�android.nfc.tech�p�b�P�[�W�̃N���X�����L�ڂ��܂��B

NFC�ݒ��ʂ�ON�ɂ��Ȃ��Ǝg���Ȃ�

�@�Ȃ��ANFC�͐ݒ��OFF�ɂȂ��Ă���Ǝg�p�ł��܂���BNFC��Bluetooth��GPS�̂悤��API����ON�^OFF��؂�ւ����Ȃ����߁A�K�v�Ȃ�Έȉ��̗v�̂�NFC�ݒ��ʂ��J���ă��[�U�[�ɕς��Ă��炤�Ƃ悢�ł��傤�B

startActivity(new Intent(Settings.ACTION_AIRPLANE_MODE_SETTINGS));
// API Level 16�ȍ~�̏ꍇ�͈ȉ�
startActivity(new Intent(Settings.ACTION_NFC_SETTINGS));
�@�@�@�@�@�@ 1|2|3 ���̃y�[�W��

Copyright © ITmedia, Inc. All Rights Reserved.

'; this.insertTarget = document.querySelector('#cmsBody .subscription') || document.querySelector('#cmsBody .inner'); }; BodyAdIMSWithCCE.prototype = Object.create(BodyAdContent.prototype); BodyAdIMSWithCCE.prototype.activate = function () { refreshGam('InArtSpecialLink'); } // global reference window.itm = itm; //entry point BodyAdEventBase.polyfill(); const bodyAdManager = BodyAdManager.getInstance(); bodyAdManager.addEventListener(BodyAdManager.EVENTS.READY, function (ev) { bodyAdManager.loadAdvertise(); }); bodyAdManager.init(); })();
�X�|���T�[����̂��m�点PR

���ڂ̃e�[�}

Microsoft  WindowsőO2025
AI for GWjAO
[R[h^m[R[h Zg by IT - ITGWjArWlX̒SŊ􂷂gD
Cloud Native Central by IT - XP[uȔ\͂gD
�V�X�e���J���m�E�n�E �y�����i�r�zPR
���Ȃ��ɂ������߂̋L��PR

RSS�ɂ‚���

�A�C�e�B���f�B�AID�ɂ‚���

���[���}�K�W���o�^

��IT�̃��[���}�K�W���́A �������A���ׂĖ����ł��B���Ѓ��[���}�K�W�������w�ǂ��������B