public class IrdaManager {
   /**
    * IrdaManager exposes the hidden Samsung IrdaManager class.
    * http://www.haxd.me/index.php/2013/03/reversing-samsungs-irdamanager/
    * https://github.com/rngtng/IrDude/blob/master/src/com/rngtng/irdude/MainActivity.java
    */
   public static void LIBRARY_DOC(){}
   
   private Object mIrdaService=null;
   private Method mIrWrite=null;
   
   /**
    * Initialize the IrdaManager.
    * Returns True if successfully initialized, otherwise False.
    * If initialization fails the B4A LastException property will contain the related Exception.
    */
   public boolean Initialize(BA pBA){
      boolean success=false;
      mIrdaService=pBA.context.getSystemService("irda");
      Class<?> irdaServiceClass=mIrdaService.getClass();
      Class<?>[] p={String.class};
      try {
         mIrWrite=irdaServiceClass.getMethod("write_irsend", p);
         success=true;
      } catch (SecurityException e) {
         e.printStackTrace();
         pBA.setLastException(e);
      } catch (NoSuchMethodException e) {
         e.printStackTrace();
         pBA.setLastException(e);
      }
      return success;
   }
   
   /**
    * Returns whether or not the IrdaManager is initialized.
    */
   public boolean IsInitialized(){
      return mIrWrite==null?false:true;
   }
   
   /**
    * Sends Data using the IrdaManager.
    * Returns True if successfully sent, otherwise False.
    * If send fails the B4A LastException property will contain the related Exception.
    */
   public boolean WriteIrSend(BA pBA, String Data){
      boolean success =false;
      try {
         mIrWrite.invoke(mIrdaService, Data);
         success=true;
      } catch (IllegalArgumentException e) {
         e.printStackTrace();
         pBA.setLastException(e);
      } catch (IllegalAccessException e) {
         e.printStackTrace();
         pBA.setLastException(e);
      } catch (InvocationTargetException e) {
         e.printStackTrace();
         pBA.setLastException(e);
      }
      return success;
   }
}Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("Main")
   MyIR.Initialize
End Sub
Sub CmdPower_Click
   Log("IrdaManager: " & MyIR.IsInitialized)
   Log(MyIR.WriteIrSend("0000 006d 0022 0003 00a9 00a8 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e"))
End Subwrite.invoke(irdaService, "38400,173,171,24,62,24,61,24,62,24,17,24,17,24,18,24,17,24,17,24,62,24,61,24,62,24,17,24,19,23,17,24,17,24,17,24,62,24,61,25,61,24,62,24,18,23,17,24,17,25,17,24,17,24,17,24,18,24,17,24,62,24,61,24,62,24,61,24,1880");Log(MyIR.WriteIrSend("0000 006d 0022 0003 00a9 00a8 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e"))Log(MyIR.WriteIrSend(hex2dec("0000 006d 0022 0003 00a9 00a8 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e")))You can use the Phone library to utilize the temperature sensor.
"0000 006d 0022 0003 00a9 00a8 0015 003f 0015 003f 0015 003f 0015 0015
 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 003f 0015 003f
 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f
 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015
 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015
 003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e""38028,169,168,21,63,21,63,21,63,21,21,21,21,21,21,21,21,21,21,21,63,21,
63,21,63,21,21,21,21,21,21,21,21,21,21,21,21,21,63,21,21,21,21,21,21,21,
21,21,21,21,21,21,64,21,21,21,63,21,63,21,63,21,63,21,63,21,63,21,1794,
169,168,21,21,21,3694" Sub hex2dec(irData As String)As String
   Dim sparts() As String
   Dim MyList As List
   Dim frequency As Int
   Dim i As Int
   
   
   sparts = Regex.Split(" ", irData)
   MyList.Initialize()
   For i = 0 To sparts.Length -1
      MyList.Add(sparts(i))
   Next
   
   MyList.removeat(0) 'dummy
   frequency = Bit.ParseInt(MyList.Get(0),16)
   MyList.removeat(0)
   MyList.removeat(0) ' seq1
   MyList.removeat(0) ' seq2
   For i = 0 To MyList.Size -1
      MyList.Set(i, Bit.ParseInt(MyList.get(i), 16))
   Next
   frequency = (1000000 / (frequency * 0.241246))
   MyList.InsertAt(0, frequency)
   irData = ""
   
   For i = 0 To MyList.Size -1
      irData = irData & MyList.Get(i) 
      If i < MyList.Size -1 Then irData = irData & ","
   Next
   
   Log(irData)
   
   Return irData
End SubSub Process_Globals
End Sub
Sub Globals
   Dim IrdaManager1 As IrdaManager
End Sub
Sub Activity_Create(FirstTime As Boolean)
   If IrdaManager1.Initialize Then
      Log("IrdaManager successfully initialized")
      Dim HexData As String="0000 006d 0022 0003 00a9 00a8 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 003f 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003f 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 003f 0015 0702 00a9 00a8 0015 0015 0015 0e6e"
      Dim DecData As String=IrdaManager1.Hex2Dec(HexData, " ")
      Log("DecData: "&DecData)
      
      If IrdaManager1.WriteIrSend(DecData) Then
         Log("WriteIrSend succeeded")
      Else
         Log("WriteIrSend failed: "&LastException)
      End If
   Else
      Log("Failed to initialize the IrdaManager: "&LastException)
   End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub