Check this
//Check for SDK version
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
//create an instance of ConsumerIrManager class
ConsumerIrManager cIr = (ConsumerIrManager) getApplicationContext().getSystemService(Context.CONSUMER_IR_SERVICE);
//Check weather device has the IR hardware component or not
boolean feature_consumer_ir = cIr.hasIrEmitter();
if (feature_consumer_ir) {
Log.i("Test",cIr.getCarrierFrequencies().toString());
Toast.makeText(this, "Yep this device has the IR Hardware Component", Toast.LENGTH_SHORT).show();
}else
{ Toast.makeText(this, "This Phone Does't have any IR Hardware Component", Toast.LENGTH_SHORT).show();
}
}
Now If you want to send the signal use this
int[] pattern=new int[2];
pattern[0]=1000000; // delay time in micro seconds
pattern[1]=1000000; // delay time in micro seconds
int frequency=57437537;
//call transmit method with pattern and frequency parameters using ConsumerIrManager object
cIr.transmit(frequency, pattern);
You can see that IR device will send the signal.To know weather it is sending or not hold your device infront of camera of another device it will show blinking of IR blaster
Note :
The problem now is that you need to know the IR signal frequecny i.e you need to decode the signals.
To get IR signals decoded this might help you
Is it possible to capture/receive IR signals in an Android application?