This remote is widely accepted as being incredibly up to date, and compatible with hundreds of devices. It is not free, but there is a free version.
Something like this app lets you add codes for various devices.
In terms of programming, this would be off topic here, but since there might be alternatives you can use I've answered this. You could use the Android SDK and write an IR app yourself using the Andrid 4.4 APIs.
Infrared transmitters
When running on a device that includes an infrared (IR) transmitter, you can now transmit IR signals using the
ConsumerIrManager
APIs. To get an instance ofConsumerIrManager
, callgetSystemService()
withCONSUMER_IR_SERVICE
as the argument. You can then query the device's supported IR frequencies withgetCarrierFrequencies()
and transmit signals by passing your desired frequency and signal pattern with transmit().
You should always first check whether a device includes an IR transmitter by calling
hasIrEmitter()
, but if your app is compatible only with devices that do have one, you should include a<uses-feature>
element in your manifest for"android.hardware.consumerir" (FEATURE_CONSUMER_IR)
.
(Note: I have zero involvement with any of the apps listed)