javaandroidmobileinfrared

Java for android error: "IR emitter not available" in a device that HAS IR support


I use other apps in my cellphone, using its IR. But when I try and use the IREmitter in any project, it triggers that error!

mCIR = (ConsumerIrManager)getSystemService(this.CONSUMER_IR_SERVICE);
if (!mCIR.hasIrEmitter()) {
     mFreqsText.setText("No IR Emitter found!");
     Log.e(TAG, "No IR Emitter found!\n");
}

This gives me the "No IR Emitter found". And this is my manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.felipenmoura.irtest">

<uses-permission android:name="android.permission.TRANSMIT_IR" android:required="true"/>
<uses-feature android:name="android.hardware.consumerir" android:required="true"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Any clue on why am I waisting so much time on this? Yes, I am a noob in java, sorry!


Solution

  • It looks like LG has it's own IR blaster SDK. The LG QRemote SDK.

    http://developer.lge.com/resource/mobile/RetrieveOverview.dev?categoryTypeCode=ANRS

    In the end of the list.