How to make android phone flashlight blink?

前端 未结 3 383
盖世英雄少女心
盖世英雄少女心 2021-01-25 05:11

I am trying to make the LED flashlight of android phone blink based on binary code like if char = 1 turn LED light on else if char = 0 turn LED off.

if ( char ==         


        
3条回答
  •  孤城傲影
    2021-01-25 06:11

    String[] list1 = { "1", "0", "1", "0", "1", "0", "1", "0", "1", "0" };
            for (int i = 0; i < list1.length; i++) {
                if (list1[i].equals("0")) {
                    params.setFlashMode(Parameters.FLASH_MODE_ON);
                } else {
                    params.setFlashMode(Parameters.FLASH_MODE_OFF);
                }
    
            }
    

    may be your problem solved but I think this one is too fast to blink......

提交回复
热议问题