Blame view

PremiereActivite/app/src/main/java/com/example/app_10p5/NFC.java 780 Bytes
6ff8ec9b   JLo'w   Système d'héritag...
1
2
3
4
5
6
7
8
9
10
11
  package com.example.app_10p5;
  
  import android.app.Fragment;
  import android.content.Intent;
  
  /**
   * Created by Jean-loup Beaussart on 07/05/2016.
   */
  public abstract class NFC extends Fragment {
  
      // Convertit l'array de byte en chaîne hexadécimale (si le byte = 0x63, str = "63").
0e3ce293   JLo'w   Corrections mineu...
12
      String ByteArrayToHexString(byte[] inarray) {
6ff8ec9b   JLo'w   Système d'héritag...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
          int i, j, in;
          String [] hex = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
          String out= "";
          for(j = 0 ; j < inarray.length ; ++j)
          {
              in = (int) inarray[j] & 0xff;
              i = (in >> 4) & 0x0f;
              out += hex[i];
              i = in & 0x0f;
              out += hex[i];
          }
          return out;
      }
  
  
      public abstract void handleIntent(Intent intent);
  }