D
D
Dowran Kadyrow2019-08-09 12:54:45
Java
Dowran Kadyrow, 2019-08-09 12:54:45

How to create a remote control program?

What code in Java can be used to send a signal from the IR port to a TV or something else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-08-09
@Dowran

Briefly and to the point, something like this:

ConsumerIrManager mCIR = (ConsumerIrManager) getSystemService(Context.CONSUMER_IR_SERVICE);
mCIR.transmit(carrierFrequency, pattern);

But in general, it will take about fifty more lines of code to properly access the IR sensor, check what it can transmit, smooth out the features of working with it in different versions of Android, and form the necessary values ​​in the variables carrierFrequencyand pattern.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question