SlideShare a Scribd company logo
Android で
IDm読み取ってみた

    平田 大介
  (@daichan4649)
自己紹介
○ 平田大介
○ @daichan4649
○ プログラマ(Java/Android)



blog
プログラマってこんなかんじ??
http://daichan4649.hatenablog.jp/
本日の流れ
1. NFCタグ検知してアプリ起動
2. アプリ起動中にタグ検知+解析
1. NFCタグ検知してアプリ起動
キーワード

● AndroidManifest.xml
uses-permission
 NFCを使用するためのpermission。
 これを記載しないと NFC機能 使用不可。

 <uses-permission
  android:name="android.permission.NFC" />
uses-sdk
 アプリで使用するSDKのversionを指定。
 NFCを使用するためには APILevel10 以降。
 (9でも使えるけどAPIが貧弱なので実質10以上)

 <uses-sdk
   android:minSdkVersion="10" />
uses-feature
 market から DLするときに、
 NFC搭載機種 にしかインストールできないようにする。

 <uses-feature
  android:name="android.hardware.nfc"
  android:required="true" />
IntentFilter

 Activity の起動条件。

    ● ACTION_NDEF_DISCOVERED
      ○ NDEFフォーマットタグ

    ● ACTION_TECH_DISCOVERED
      ○ NDEFフォーマットタグ以外
      ○ タグの種類でフィルタリング

    ● ACTION_TAG_DISCOVERED
      ○ それ以外
2. アプリ起動中にNFCタグ検知+解析
キーワード

● NFCタグ検知用filter の動的登録/解除
● NFCタグ検知時callback
NFCタグ検知用filter の有効化
(NfcAdapter#enableForegroundDispatch)

● パラメータ
  ○ PendingIntent
    ■ タグ検知時に発行する intent

   ○ filters / techLists
      ■ 組み合わせで指定したタイプにのみ反応するように
          できる(みたい)
NFCタグ検知用filter の無効化
(NfcAdapter#disableForegroundDispatch)

● filter の解除
NFCタグ検知時callback

● Activity#onNewIntent(Intent)
  ○ NFCタグ検知時に呼び出される。

  ○ パラメータ
    ■ enableForegroundDispatch で登録したintent

  ○ Activity のライフサイクル
    ■ onPause
    ■ onNewIntent
    ■ onResume
コード(gist)
デモ
参考サイト
公式
http://developer.android.com


ブリリアントサービス NFC技術ブログ
http://d.hatena.ne.jp/bs_nfc/


hiro99ma
http://hiro99ma.blogspot.jp/


アトリエのどか(@treby006)
http://www.atelier-nodoka.net/
ご清聴ありがとうございました

More Related Content

PDF
一人でもNFC開発
PDF
Hosting Your Own OTA Update Service
PDF
Android OS Porting: Introduction
PPTX
Windows 10 mobileでnfc~suica・edy対応編~(公開用)
PDF
30分で分かる!OSの作り方 ver.2
PDF
Improve Android System Component Performance
PDF
Pythonでの開発を効率的に進めるためのツール設定
PDF
一人でもNFC開発
Hosting Your Own OTA Update Service
Android OS Porting: Introduction
Windows 10 mobileでnfc~suica・edy対応編~(公開用)
30分で分かる!OSの作り方 ver.2
Improve Android System Component Performance
Pythonでの開発を効率的に進めるためのツール設定

What's hot (20)

PDF
Android's HIDL: Treble in the HAL
PPTX
急速に進化を続けるCNIプラグイン Antrea
PPTX
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
PDF
App center an overview
PDF
Android's Multimedia Framework
PDF
#jjug_ccc #ccc_f1 広告システム刷新の舞台裏 - PHPからJavaに変えてみました
PDF
月刊NDEF 2013年 1、2、3月号
PDF
Android for Embedded Linux Developers
PPTX
3GPP F1インターフェース(TS38.470-f50)の概要
PDF
その ionice、ほんとに効いてますか?
PDF
Wireshark だけに頼らない! パケット解析ツールの紹介
PDF
DevConf 2014 Kernel Networking Walkthrough
PDF
Android起動周りのノウハウ
PDF
ABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
PDF
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
PDF
Android device driver structure introduction
PDF
私たちはRESTCONFでネットワーク自動化的に何が嬉しくなるのか考えてみた
PDF
Java開発の強力な相棒として今すぐ使えるGroovy
PDF
今話題のいろいろなコンテナランタイムを比較してみた
PPTX
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Android's HIDL: Treble in the HAL
急速に進化を続けるCNIプラグイン Antrea
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
App center an overview
Android's Multimedia Framework
#jjug_ccc #ccc_f1 広告システム刷新の舞台裏 - PHPからJavaに変えてみました
月刊NDEF 2013年 1、2、3月号
Android for Embedded Linux Developers
3GPP F1インターフェース(TS38.470-f50)の概要
その ionice、ほんとに効いてますか?
Wireshark だけに頼らない! パケット解析ツールの紹介
DevConf 2014 Kernel Networking Walkthrough
Android起動周りのノウハウ
ABS 2013: Dive into Android Networking - Adding Ethernet Connectivity
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Android device driver structure introduction
私たちはRESTCONFでネットワーク自動化的に何が嬉しくなるのか考えてみた
Java開発の強力な相棒として今すぐ使えるGroovy
今話題のいろいろなコンテナランタイムを比較してみた
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol
Ad

Viewers also liked (20)

PDF
関西支部 第二回 NFCLab勉強会 
PPTX
UNEP Plan
PPT
Adjectives and adverbs
PPTX
Yeni microsoft office power point sunusu
PPT
Pp Lect7 1
XLS
testing _idea
PDF
Jquickprofileupload
PPTX
Semana cultural
PPT
Pp Lect4
PDF
EveryOtherDay NCR Entertainment Hub
PPTX
Masa Depanku Aqsa 6 B
PPTX
Komputerku Irsyad 5 B
PPTX
VidInc Sydney - The Evolving Digital Eco-System
PPT
Präsentation schule
PDF
E xplorer day
PPT
Pp Lect9 10 1
PPT
first pitch
PPT
Komputerku Rana 4c
PPT
Komputerku Ivena 4 B
PPT
Greenathan
関西支部 第二回 NFCLab勉強会 
UNEP Plan
Adjectives and adverbs
Yeni microsoft office power point sunusu
Pp Lect7 1
testing _idea
Jquickprofileupload
Semana cultural
Pp Lect4
EveryOtherDay NCR Entertainment Hub
Masa Depanku Aqsa 6 B
Komputerku Irsyad 5 B
VidInc Sydney - The Evolving Digital Eco-System
Präsentation schule
E xplorer day
Pp Lect9 10 1
first pitch
Komputerku Rana 4c
Komputerku Ivena 4 B
Greenathan
Ad

Similar to AndroidでIDm読み取ってみた (6)

PPTX
NFC元年 ~AndroidからみたNFCについて~
PDF
Android NFCアプリハンズオン
PPTX
IDm Snatcher
PDF
3.17 第1回nfc勉強会
PDF
Nfcのアプリつくってみる
PDF
Windows8 x NFC - Windows8 Developers カンファレンス Vol2.0 -
NFC元年 ~AndroidからみたNFCについて~
Android NFCアプリハンズオン
IDm Snatcher
3.17 第1回nfc勉強会
Nfcのアプリつくってみる
Windows8 x NFC - Windows8 Developers カンファレンス Vol2.0 -

AndroidでIDm読み取ってみた