Tabnine Logo
MifareUltralight.writePage
Code IndexAdd Tabnine to your IDE (free)

How to use
writePage
method
in
android.nfc.tech.MifareUltralight

Best Java code snippets using android.nfc.tech.MifareUltralight.writePage (Showing top 1 results out of 315)

origin: RickyYu/Nfc-Android

  public void writeTag(Tag tag) {
    MifareUltralight ultralight = MifareUltralight.get(tag);
    try {
      ultralight.connect();
      //写入八个汉字,从第五页开始写,中文需要转换成GB2312格式
      ultralight.writePage(4, "北京".getBytes(Charset.forName("GB2312")));
      ultralight.writePage(5, "上海".getBytes(Charset.forName("GB2312")));
      ultralight.writePage(6, "广州".getBytes(Charset.forName("GB2312")));
      ultralight.writePage(7, "天津".getBytes(Charset.forName("GB2312")));
      Toast.makeText(this, "写入成功", Toast.LENGTH_SHORT).show();
    } catch (Exception e) {
    } finally {
      try {
        ultralight.close();
      } catch (Exception e) {
      }
    }
  }
}
android.nfc.techMifareUltralightwritePage

Popular methods of MifareUltralight

  • get
  • close
  • connect
  • getType
  • readPages
  • transceive

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JCheckBox (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now