Samsung Galaxy 2 7.0 Tablet...

Gary Miyakawa

Active Member
Licensed User
Longtime User
The documentation talks about the "IR Blaster" that is built in. I'd REALLY like to program it to do some magic but in searching here, I don't find that anyone has tried/used the IR Blaster.

Does anyone have any experience programming it ? Or suggestions ?

Thanks,

Gary M
 

Gary Miyakawa

Active Member
Licensed User
Longtime User
I did find this sample code but not sure how to impliment it in B4A.. Could someone help with this ? BTW, this code came from XDA forums.


B4X:
public void onClick2(View view) {
       TextView editText = (TextView) findViewById(R.id.textView2);
       
       Object irService = getSystemService("irda");
       irService.getClass();
       Class irClass = irService.getClass();
       Class params[] = new Class[1];
       params[0] = String.class;
       try {
         Method sendIR = irClass.getMethod("write_irsend", params);
         
         for(int i=0;i<2;i++)
            sendIR.invoke(irService, "37300,11,67,10,28,10,28,10,27,11,27,11,27,11,67,11,67,11,27,11,68,10,27,11,27,11,27,11,67,11,27,11,1731,11,68,10,28,10,27,11,27,11,27,11,67,11,27,11,27,11,67,11,27,11,67,11,67,11,68,10,27,11,68,10,1653");
         editText.setText("Done");
      } catch (Exception e) {
         e.printStackTrace();
         editText.setText("Fail");
      }
    }

Thanks,

Gary M
 
Upvote 0

Gary Miyakawa

Active Member
Licensed User
Longtime User
Thank you for the lead! I just picked up a 10.1 to start testing with. Any suggestions I would greatly appreciate !

Gary M
 
Upvote 0

Gary Miyakawa

Active Member
Licensed User
Longtime User
:sign0085:

I'm not a Java person and this reflector (and coverting the code to run from reflector just isn't coming together for me at this time...)

vb1992 kindly pointed me to a smaller piece of code that "should" send something to the embedded IR on my Galaxy Tab but I haven't been able to get thru the syntax...

The code that vb1992 found is as follows:
B4X:
'   Try{ 
'      Object irService = getSystemService("irda"); 
'      irService.getClass(); 
'      Class irClass = irService.getClass(); 
'      Class params[] = new Class[1]; 
'      params[0] = String.class; 
'      Method sendIR = irClass.getMethod("write_irsend", params); 
'      SendIR.invoke(irService,"data"); 
'    } Catch (Exception e){ 
'      //Do something with the error 
'    }

Could someone, with MUCH more knowldege about reflector than I (i'm a zero) help me undestand how to convert it run (hopefully) on B4A ?

Thanks much !

Gary M
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I know this is a bit of an old thread but I am curious if anyone has gotten this working yet as well. I would like to be able to learn (store) IR data as well as transmit it.
 
Upvote 0
Top