Hello friends, today we are going to learn how to create remote in android using ConsumerIrManager. ConsumerIrManager class operates consumer infrared on the device and we’ll use two methods of ConsumerIrManager class hasIrEmitter
method to check whether device has infrared emitter or not and transmit
method to transmit single/pattern. Actually I have Clarion JM-8201 home theater and I have lost it’s remote and for that reason I was facing difficulties using it and I have tried many apps from playstore but no one worked for me so I decided to develop own remote app. Now I am sharing this code so that anyone else need it can benefit and If anyone have same home theater then s/he can use same code as it is to create their own remote for their home theater.
So, Here is the code
MainActivity.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
package com.zatackcoder.clarionremotejm8201; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; import android.hardware.ConsumerIrManager; import android.os.Build; import android.os.Bundle; import android.view.View; import android.widget.Toast; public class MainActivity extends AppCompatActivity { Integer frequency = 33000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @RequiresApi(api = Build.VERSION_CODES.KITKAT) public void handleClick(View view) { ConsumerIrManager consumerIrManager = (ConsumerIrManager) getSystemService(CONSUMER_IR_SERVICE); if(!consumerIrManager.hasIrEmitter()) { Toast.makeText(getApplicationContext(), "IR Emitter Not Found in Your Device", Toast.LENGTH_LONG).show(); return; } switch (view.getId()) { case R.id.powerB: consumerIrManager.transmit(frequency, Btn.POWER); break; case R.id.inputB: consumerIrManager.transmit(frequency, Btn.INPUT); break; case R.id.usbB: consumerIrManager.transmit(frequency, Btn.USB); break; case R.id.sdB: consumerIrManager.transmit(frequency, Btn.SD); break; case R.id.fmB: consumerIrManager.transmit(frequency, Btn.FM); break; case R.id.auxB: consumerIrManager.transmit(frequency, Btn.AUX); break; case R.id.trebleMinusB: consumerIrManager.transmit(frequency, Btn.TREBLE_MINUS); break; case R.id.treblePlusB: consumerIrManager.transmit(frequency, Btn.TREBLE_PLUS); break; case R.id.bassMinusB: consumerIrManager.transmit(frequency, Btn.BASS_MINUS); break; case R.id.bassPlusB: consumerIrManager.transmit(frequency, Btn.BASS_PLUS); break; case R.id.stMinusB: consumerIrManager.transmit(frequency, Btn.ST_MINUS); break; case R.id.stPlusB: consumerIrManager.transmit(frequency, Btn.ST_PLUS); break; case R.id.prevB: consumerIrManager.transmit(frequency, Btn.PREVIOUS); break; case R.id.volMinusB: consumerIrManager.transmit(frequency, Btn.VOL_MINUS); break; case R.id.nextB: consumerIrManager.transmit(frequency, Btn.NEXT); break; case R.id.volPlusB: consumerIrManager.transmit(frequency, Btn.VOL_PLUS); break; case R.id.muteB: consumerIrManager.transmit(frequency, Btn.MUTE); break; case R.id.ftMinusB: consumerIrManager.transmit(frequency, Btn.FT_MINUS); break; case R.id.ftPlusB: consumerIrManager.transmit(frequency, Btn.FT_PLUS); break; case R.id.num1B: consumerIrManager.transmit(frequency, Btn.NUM_1); break; case R.id.num2B: consumerIrManager.transmit(frequency, Btn.NUM_2); break; case R.id.num3B: consumerIrManager.transmit(frequency, Btn.NUM_3); break; case R.id.num4B: consumerIrManager.transmit(frequency, Btn.NUM_4); break; case R.id.num5B: consumerIrManager.transmit(frequency, Btn.NUM_5); break; case R.id.num6B: consumerIrManager.transmit(frequency, Btn.NUM_6); break; case R.id.num7B: consumerIrManager.transmit(frequency, Btn.NUM_7); break; case R.id.num8B: consumerIrManager.transmit(frequency, Btn.NUM_8); break; case R.id.num9B: consumerIrManager.transmit(frequency, Btn.NUM_9); break; case R.id.num0B: consumerIrManager.transmit(frequency, Btn.NUM_0); break; case R.id.resetB: consumerIrManager.transmit(frequency, Btn.RESET); break; case R.id.searchB: consumerIrManager.transmit(frequency, Btn.SEARCH); break; } } } |
activity_main.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp" android:weightSum="100" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:layout_weight="8" android:orientation="horizontal"> <Button android:id="@+id/powerB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ic_btn_round_red" android:onClick="handleClick" android:text="Power" android:textColor="#FFF" /> <View android:layout_width="wrap_content" android:layout_height="1dp" android:layout_weight="25" /> <Button android:id="@+id/inputB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/ic_btn_round_green" android:onClick="handleClick" android:text="Input" android:textColor="#FFF" /> </LinearLayout> <LinearLayout android:id="@+id/linearLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="16" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="0dp" android:orientation="horizontal"> <Button android:id="@+id/usbB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="USB" /> <Button android:id="@+id/sdB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="SD" /> <Button android:id="@+id/fmB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="FM" /> <Button android:id="@+id/auxB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="AUX" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="0dp" android:orientation="horizontal"> <Button android:id="@+id/trebleMinusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="TREBLE-" /> <Button android:id="@+id/treblePlusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="TREBLE+" /> <Button android:id="@+id/bassMinusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="BASS-" /> <Button android:id="@+id/bassPlusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="BASS+" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="40" android:gravity="center"> <GridLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:columnCount="3" android:rowCount="5"> <Button android:id="@+id/stMinusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="0" android:layout_column="0" android:layout_columnWeight="1" android:layout_marginRight="20dp" android:onClick="handleClick" android:text="ST-" /> <Button android:id="@+id/stPlusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="0" android:layout_column="2" android:layout_columnWeight="1" android:layout_marginLeft="20dp" android:onClick="handleClick" android:text="ST+" /> <Button android:id="@+id/prevB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="1" android:layout_column="1" android:layout_columnWeight="1" android:onClick="handleClick" android:text="PREV" /> <Button android:id="@+id/volMinusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="2" android:layout_column="0" android:layout_columnWeight="1" android:onClick="handleClick" android:text="VOL-" /> <Button android:id="@+id/nextB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="3" android:layout_column="1" android:layout_columnWeight="1" android:onClick="handleClick" android:text="NEXT" /> <Button android:id="@+id/volPlusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="2" android:layout_column="2" android:layout_columnWeight="1" android:onClick="handleClick" android:text="VOL+" /> <Button android:id="@+id/muteB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="2" android:layout_column="1" android:layout_columnWeight="1" android:onClick="handleClick" android:text="MUTE" /> <Button android:id="@+id/ftMinusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="4" android:layout_column="0" android:layout_columnWeight="1" android:layout_marginRight="20dp" android:onClick="handleClick" android:text="FT-" /> <Button android:id="@+id/ftPlusB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="4" android:layout_column="2" android:layout_columnWeight="1" android:layout_marginLeft="20dp" android:onClick="handleClick" android:text="FT+" /> </GridLayout> </LinearLayout> <LinearLayout android:id="@+id/numbersLL" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="32" android:gravity="bottom" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/num1B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="1" /> <Button android:id="@+id/num2B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="2" /> <Button android:id="@+id/num3B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="3" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/num4B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="4" /> <Button android:id="@+id/num5B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="5" /> <Button android:id="@+id/num6B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="6" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/num7B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="7" /> <Button android:id="@+id/num8B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="8" /> <Button android:id="@+id/num9B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="9" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/resetB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="Reset" /> <Button android:id="@+id/num0B" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="0" /> <Button android:id="@+id/searchB" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:onClick="handleClick" android:text="Search" /> </LinearLayout> </LinearLayout> </LinearLayout> |
Btn.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
package com.zatackcoder.clarionremotejm8201; public final class Btn { public static int[] POWER = {9000, 4450, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 1650, 600, 550, 550, 550, 600, 1650, 550, 1700, 550, 600, 550, 1700, 550}; public static int[] INPUT = {9050, 4450, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 1650, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 550, 600, 550, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 550, 550, 1700, 550}; public static int[] USB = {8950, 4500, 600, 550, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1650, 600, 550, 550, 1700, 550, 1700, 550, 550, 550, 600, 500, 1700, 600, 550, 550, 1600, 650, 550, 550, 600, 550, 550, 600, 1650, 550, 1700, 550, 600, 550, 1700, 550, 550, 550, 1700, 550}; public static int[] SD = {9000, 4450, 600, 550, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 1750, 550, 550, 550, 1700, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 600, 550, 1700, 550, 550, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 1700, 550}; public static int[] FM = {8950, 4500, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 550, 600, 1650, 600, 550, 550, 1700, 550, 1700, 550, 1700, 500, 600, 550, 1700, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 1700, 550, 550, 550, 1700, 550}; public static int[] AUX = {9000, 4500, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 1650, 550, 600, 550, 550, 600, 550, 550, 550, 550, 600, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 600, 550, 1700, 500, 600, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 600, 500, 1750, 550, 550, 550, 1700, 550, 550, 550, 1700, 600}; public static int[] TREBLE_MINUS = {9000, 4500, 550, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 550, 1700, 550, 550, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 1700, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 1750, 500, 1750, 500, 1700, 600}; public static int[] TREBLE_PLUS = {8950, 4500, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 500, 600, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 1750, 500, 600, 550, 600, 500, 1700, 600, 1650, 550, 1700, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 1750, 550, 550, 550, 550, 550, 600, 550, 550, 600, 1650, 600, 1650, 550, 1700, 550}; public static int[] BASS_MINUS = {9000, 4500, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 550, 600, 1650, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 600, 550, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] BASS_PLUS = {9000, 4500, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 1700, 550, 600, 550, 1700, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 600, 550, 1700, 550, 550, 550, 1700, 550, 600, 500, 1750, 550, 1700, 550, 1650, 600}; public static int[] PREVIOUS = {9000, 4500, 550, 550, 550, 550, 600, 550, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 550, 600, 1650, 600, 550, 550, 1700, 550, 1700, 550, 550, 550, 1700, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 1700, 500, 1750, 550}; public static int[] NEXT = {9000, 4500, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 500, 1750, 550, 1700, 550, 1650, 600, 550, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 550, 1650, 600, 1650, 550, 1700, 550, 1700, 550}; public static int[] VOL_MINUS = {8950, 4500, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 600, 550, 550, 550, 600, 500, 1700, 600, 1650, 550, 1650, 600, 1700, 550, 600, 550, 1650, 600, 1650, 600, 1650, 550}; public static int[] VOL_PLUS = {8950, 4500, 550, 600, 500, 600, 550, 550, 550, 600, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 600, 500, 1700, 550, 1700, 600, 1650, 550, 600, 550, 1700, 500, 1700, 600, 1650, 600}; public static int[] MUTE = {9000, 4450, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 550, 550, 1700, 550, 600, 550, 1700, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 1700, 550, 1650, 550, 1700, 550}; public static int[] ST_MINUS = {8950, 4500, 550, 600, 550, 550, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1700, 500, 600, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 600, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 600, 500, 600, 550, 550, 600, 1650, 600, 550, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 1650, 600, 1650, 550}; public static int[] ST_PLUS = {8950, 4500, 550, 600, 500, 600, 600, 550, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 550, 550, 600, 550, 550, 550, 600, 1650, 550, 600, 550, 550, 600, 1650, 600, 550, 500, 600, 550, 600, 500, 600, 550, 1700, 550, 550, 550, 1700, 550, 600, 500, 1750, 550, 1700, 550, 1700, 500, 1700, 600, 550, 550, 1700, 550}; public static int[] FT_MINUS = {9000, 4500, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 500, 1750, 550, 550, 550, 1700, 550, 550, 600, 1650, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 1700, 550, 1700, 550, 1700, 550, 600, 550, 1700, 550}; public static int[] FT_PLUS = {9000, 4500, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 1700, 550, 1650, 600, 550, 550, 1700, 550, 1700, 550, 1650, 600, 550, 550, 1700, 550}; public static int[] NUM_1 = {9000, 4500, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 1750, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 600, 1650, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] NUM_2 = {9000, 4500, 600, 550, 550, 550, 550, 600, 550, 550, 600, 550, 550, 600, 500, 1700, 600, 550, 550, 550, 550, 600, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 1700, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 1750, 550, 1700, 500, 1750, 500, 1750, 500, 1700, 550, 1700, 550}; public static int[] NUM_3 = {9050, 4500, 550, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 1750, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 1700, 550, 600, 500, 1750, 550, 1700, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 1750, 500, 1750, 550, 1700, 500, 1750, 500, 1750, 500, 1750, 500}; public static int[] NUM_4 = {9000, 4500, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 600, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 550, 600, 500, 1700, 550, 600, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 1700, 550, 600, 500, 1750, 500, 1750, 500, 1750, 550, 1700, 550, 1700, 500}; public static int[] NUM_5 = {9000, 4500, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 550, 600, 550, 550, 550, 600, 500, 1750, 550, 550, 550, 1700, 550, 600, 500, 1750, 500, 600, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 500, 1750, 500, 600, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] NUM_6 = {9000, 4500, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 1700, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 1750, 550, 550, 550, 600, 550, 1700, 550, 1700, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] NUM_7 = {9000, 4500, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 550, 600, 550, 1700, 550, 600, 500, 1750, 550, 1700, 500, 1700, 600, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] NUM_8 = {9050, 4500, 550, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 600, 500, 1750, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 550, 550, 550, 1700, 600, 550, 550, 600, 500, 600, 550, 600, 500, 1750, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 1550, 700, 1700, 550, 550, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] NUM_9 = {9000, 4500, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 550, 550, 1700, 600, 550, 550, 1700, 550, 550, 550, 600, 550, 1700, 550, 600, 500, 600, 550, 600, 550, 550, 550, 600, 500, 1750, 550, 1700, 500, 600, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] NUM_0 = {9050, 4500, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 500, 600, 550, 1700, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 1700, 550, 600, 500, 600, 600, 550, 500, 600, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] RESET = {9050, 4500, 550, 550, 600, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 550, 600, 550, 550, 600, 550, 550, 1700, 550, 600, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 1700, 550, 1700, 550, 1700, 550}; public static int[] SEARCH = {9000, 4500, 550, 600, 550, 550, 550, 600, 500, 600, 550, 600, 550, 550, 550, 1700, 550, 600, 550, 550, 550, 600, 550, 550, 600, 550, 550, 550, 600, 550, 550, 1700, 550, 550, 550, 600, 550, 600, 550, 1700, 550, 1700, 550, 550, 550, 600, 550, 550, 550, 600, 550, 1700, 550, 1700, 550, 550, 550, 600, 500, 1750, 550, 1700, 550, 1700, 550, 1700, 550}; } |
These button codes/patten I have extracted from actuall remote by the help of a shopkeeper using Arduino Uno and Infrared Sensor.
styles.xml
1 2 3 4 5 6 7 8 9 10 11 |
<resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> </resources> |
AndroidManifest.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.zatackcoder.clarionremotejm8201"> <uses-permission android:name="android.permission.TRANSMIT_IR"/> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> |
Screenshot
AndroidStudio Project Download
ClarionRemoteJM8201 AndroidStudio Project
Thanks for Stoping by
If you find this helpful then please do share
Comments