• sales

    +86-0755-88291180

Android SDK for NFC-Powered e-Paper

Import the .jar file

  • Download the SDK
    • Download the SDK and unzip it to get the .jar file
    • NFC SDK
  • Copy the Jar file to libs directory of your project.



  • Find the .jar file in your project, right-click it to add it as libraries.
 


  • After adding, the line will bee auto-added to build.gradle.:


Use guide

There are two functions provided, one is send function and any is status function.

Sent function

    Type
    Typee-Paper
    12.13inch
    22.9inch
    34.2inch
    47.5inch
    57.5inch HD
    62.7inch
    Pictures
    Typee-Paperwidthheight
    12.13inch250122
    22.9inch296128
    34.2inch400300
    47.5inch800480
    57.5inch HD880528
    62.7inch264176

    Status function

      • int b()
      • Return:
        • 0-100:The current process of sending.
        • -1:Failed

      Examples

      protected void onNewIntent(Intent intent) {//Recognized the NFC
          if (mWriteMode && NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) {
              detectedTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
              String[] tech = detectedTag.getTechList();//Get the descriptor
              if(tech[0].equals("android.nfc.tech.NfcA")) {//if the descriptor is correct
                  Thread t = new Thread() {//Create an new thread
                      @Override
                      public void run() {
                          Boolean success = false;
                          NfcA tntag;//NFC tag
      
                          final a  a = new a();//Create a new instance.
                          a.a();//初始化发送函数
      
                          Thread thread = new Thread(new Runnable() {//Create thread
                              @Override
                              public void run() {
                                  EPD_total_progress = 0;
                                  while(EPD_total_progress != -1){
                                      EPD_total_progress = a.b();//Read the process
                                      if(EPD_total_progress == -1){
                                          break;
                                      }
                                      setStatusBody(getString(R.string.txing) + EPD_total_progress +"%");
                                      if(EPD_total_progress == 100 ){
                                          break;
                                      }
                                      SystemClock.sleep(10);
                                  }
                              }
                          });
                          thread.start();//start the thread
                          tntag = NfcA.get(detectedTag);//Get the tag instance.
                          try {
                              int whether_succeed = a.a(tntag,Size_Flag, bmp_send);//Send picture
                              if(whether_succeed == 1){
                                  success = true; 
      
                                  runOnUiThread(new Runnable() {
                                      @Override
                                      public void run() {
                                          checkNFCpopwindow.dismiss(); //Tips
      
                                      }
                                  });
                                  Success_Sound_Effects();
      
                              }else{
                                  setStatusBody(getString(R.string.txfail));
                              }
      
                          } finally { 
                              try {
                                  if (success == false) {
                                      setStatusBody(getString(R.string.txfail));
                                      runOnUiThread(new Runnable() {
                                          @Override
                                          public void run() {
                                              checkNFCpopwindow.dismiss();
                                          }
                                      });
                                  }
                                  tntag.close();
                              } catch (IOException e) {//handle exception error
                                  e.printStackTrace();
                              }
                          }
                      }
                  };
                  t.start();//Start thread
              }
          }
      }