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

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

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

origin: RickyYu/Nfc-Android

  public String readTag(Tag tag) {
    MifareUltralight ultralight = MifareUltralight.get(tag);
    try {
      ultralight.connect();
      byte[] data = ultralight.readPages(4);
      return new String(data, Charset.forName("GB2312"));
    } catch (Exception e) {
    } finally {
      try {
        ultralight.close();
      } catch (Exception e) {
      }
    }
    return null;
  }
}
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) {
      }
    }
  }
}
origin: skjolber/external-nfc-api

  bout.write(mifareUltralight.readPages(i));
mifareUltralight.close();
android.nfc.techMifareUltralightclose

Popular methods of MifareUltralight

  • get
  • connect
  • getType
  • readPages
  • transceive
  • writePage

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top PhpStorm plugins
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