原文地址:http://developer.android.com/reference/android/nfc/tech/MifareUltralight.html


1. MifareUltralight Tag结构:
轻型Tag 共64字节,分为16个page,每个page 4字节,
前4页是存放制造商,和卡片相关信息的地方,有些是一次性写入的,有些是只读的,有些是可以写入的。
剩下的12 page 是用户存放数据的地方,是可读可写的。

2.MIFARE Ultralight C Tag 结构:

一共192字节,分为48 page ,同样是每页4字节,前四页是存放存放制造商,和卡片相关信息的地方,有些是一次性写入的,有些是只读的,有些是可以写入的。接下来的36页是用户数据区域,可读可写,接下来四页是存放验证信息的,只读,最后四页是用来证明身份的key,不可读。
在Android NFC设备上实现MifareUltralight是可选的,如果没有实现,当调用 getTechList()时就不会列举出来,如果列举出来,那么 all MifareUltralight I/O operations都会被支持。所有MifareUltralight Tag 都是 NfcA Tag。

常量:

PAGE_SIZE:每页的大写

TYPE_ULTRALIGHT:A MIFARE Ultralight tag

TYPE_ULTRALIGHT_C:A MIFARE Ultralight C tag

TYPE_UNKNOWN:一个MIFARE Ultralight兼容的但是未知类型的Tag


公有方法:

close() 关闭对Tag的读写,释放资源

connect() 连接Tag,成功连接之后就能进行I/O操作

staticMifareUltralightget(Tagtag) 得到给出Tag的一个MifareUltralight类型的实例。

int getMaxTransceiveLength() 返回能被transceive(byte[])方法发送的最大的字节数

TaggetTag() 获得Tag对象

int getTimeout() 获得当前的transceive(byte[])超时毫秒数

intgetType() 返回MIFARE Ultralight Tag的类型

booleanisConnected() 判断I/O操作是否可以进行。

byte[] readPages(int pageOffset) 从指定的pageOffset处读取四页(16字节的内容)

void setTimeout(int timeout) 设置transceive(byte[])方法的超时时间

byte[] transceive(byte[] data) 发送NFCA 类型的数据到Tag并等待回复。

void writePage(int pageOffset, byte[] data) 写如Tag一页内容(4字节)


通过继承的到的方法:

Object clone() Creates and returns a copy of this Object.
boolean equals( Objecto) Compares this instance with the specified object and indicates if they are equal.
void finalize() Invoked when the garbage collector has detected that this instance is no longer reachable.
final Class<?> getClass() Returns the unique instance of Classthat represents this object's class.
int hashCode() Returns an integer hash code for this object.
final void notify() Causes a thread which is waiting on this object's monitor (by means of calling one of the wait()methods) to be woken up.
final void notifyAll() Causes all threads which are waiting on this object's monitor (by means of calling one of the wait()methods) to be woken up.
String toString() Returns a string containing a concise, human-readable description of this object.
final void wait() Causes the calling thread to wait until another thread calls the notify()or notifyAll()method of this object.
final void wait(long millis, int nanos) Causes the calling thread to wait until another thread calls the notify()or notifyAll()method of this object or until the specified timeout expires.
final void wait(long millis) Causes the calling thread to wait until another thread calls the notify()or notifyAll()method of this object or until the specified timeout expires.

From interfaceandroid.nfc.tech.TagTechnology

abstract void close() Disable I/O operations to the tag from this TagTechnologyobject, and release resources.
abstract void connect() Enable I/O operations to the tag from this TagTechnologyobject.
abstract Tag getTag() Get the Tagobject backing this TagTechnologyobject.
abstract boolean isConnected() Helper to indicate if I/O operations should be possible.

From interfacejava.io.Closeable

abstract void close() Closes the object and release any system resources it holds.
From interface java.lang.AutoCloseable
abstract void close() Closes the object and release any system resources it holds.


更多相关文章

  1. MD2模型結構解釋
  2. Android(安卓)-- 系统结构 /system/ 目录下文件夹功能说明
  3. Android图片加载后变小
  4. [转]微信ANDROID客户端-会话速度提升70%的背后
  5. Android(安卓)Studio 加载 .so库出现couldn't find "*.so"
  6. Android(安卓)App 性能优化之安装包大小
  7. 树莓派---MAC下安装AndroidThings
  8. BlobCache算法详解
  9. android 字节流缓冲区 字节缓冲流 读写SD卡的内容

随机推荐

  1. 用EditText控件的属性inputType
  2. 搞定 Android 布局2:SlidingPaneLayout 侧
  3. android 预定义样式简述
  4. Android Status bar添加耳机图标
  5. Android设备功能之传感器教程篇
  6. Android中控件的隐藏和显示
  7. Android(安卓)SDK目录及版本号区别
  8. 各种控件
  9. Android(安卓)四大组件
  10. res\drawable-hdpi\new.png:0: error: