flashlight

Can I control the flashlight without using android.hardware.Camera?

佐手、 提交于 2019-12-01 07:54:09
The use of front light option with zxing1.6 barcode scanner does not work on my Nexus One. I need to be able to use the flashlight in my app, but you can't have two instances of the camera running. Is there a way to use the flashlight without accessing the camera? Or can I somehow access a camera that is already in use? I am using the Google IntentIntegrator.java patch to be able to scan barcodes. The short answer is "no"; the front LED is controlled as a flash mode, which is a property of the camera. It is mode "torch". And no two apps can't open the camera at the same time. (A longer answer

Can I control the flashlight without using android.hardware.Camera?

你。 提交于 2019-12-01 04:23:19
问题 The use of front light option with zxing1.6 barcode scanner does not work on my Nexus One. I need to be able to use the flashlight in my app, but you can't have two instances of the camera running. Is there a way to use the flashlight without accessing the camera? Or can I somehow access a camera that is already in use? I am using the Google IntentIntegrator.java patch to be able to scan barcodes. 回答1: The short answer is "no"; the front LED is controlled as a flash mode, which is a property

what is the difference between FLASH_MODE_TORCH AND FLASH_MODE_ON

不羁岁月 提交于 2019-11-30 23:56:30
My app turn on camera LED using FLASH_MODE_TORCH , but now some people say that FLASH_MODE_TORCH will not work on some Samsung devices correctly. So should I use FLASH_MODE_ON for all devices to work?(especially for Samsung devices) may be this will help you Parameters params = null; if(mCamera != null) { params = mCamera.getParameters(); if(params != null) { List<String> supportedFlashModes = params.getSupportedFlashModes(); if(supportedFlashModes != null) { if(supportedFlashModes.contains(Parameters.FLASH_MODE_TORCH)) { params.setFlashMode( Parameters.FLASH_MODE_TORCH ); } else if

iOS Firebase Flashlight/ElasticSearch Heroku Setup using Node.JS

筅森魡賤 提交于 2019-11-30 14:12:21
问题 I'm building an iOS app in Swift with a Firebase backend. I need advanced search options for my app. I've been told I should use Flashlight/ElasticSearch via this github link https://github.com/firebase/flashlight Assume my app's name is SneakerSearch and my Firebase Project_ID is- sneakersearch-az12 Firebase Web_API_Key is- abc123XYZ000... Firebase App_Url is- gs://sneakersearch-az12.appspot.com I need some advice with the steps for setting this up as I'm new to Heroku and Node.js. I never

iOS Firebase Flashlight/ElasticSearch Heroku Setup using Node.JS

此生再无相见时 提交于 2019-11-30 09:06:26
I'm building an iOS app in Swift with a Firebase backend. I need advanced search options for my app. I've been told I should use Flashlight/ElasticSearch via this github link https://github.com/firebase/flashlight Assume my app's name is SneakerSearch and my Firebase Project_ID is- sneakersearch-az12 Firebase Web_API_Key is- abc123XYZ000... Firebase App_Url is- gs://sneakersearch-az12.appspot.com I need some advice with the steps for setting this up as I'm new to Heroku and Node.js. I never learned either before but I've already installed the Heroku tool belt and 'sudo gem heroku install' is

How to turn on the Android Flashlight

人走茶凉 提交于 2019-11-29 18:31:04
问题 Update Check out my answer Original I'm trying to turn on the camera flashlight on the LG Revolution within my program. I use the torch mode method which works on most phones but not on LG phone. Does anyone know how to get it to work on LG's or specifically the Revolution? Here's my manifest: <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> <uses-permission android:name="android.permission.FLASHLIGHT"/> Here's my current

LED Flashlight does not work on Samsung Galaxy Nexus

。_饼干妹妹 提交于 2019-11-29 06:54:23
I've got the following problem: My Flashlight app works fine on my Samsung Galaxy S2 but unfortunately not on the Samsung Galaxy Nexus (problem: flashlight ignores the button-click -> no reaction, no light, no crash, no exception). I've read "LED flashlight on Galaxy Nexus controllable by what API?" here in stackoverflow but it did not help me since my problem still occures. This is my code-snippet to control the light: final Button FlashLightControl = (Button)findViewById(R.id.ledbutton); FlashLightControl.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg) { if

Turn ON / OFF Flashlight using SurfaceView

巧了我就是萌 提交于 2019-11-28 12:18:28
I am writing an Android Camera App and trying to implement Flash functionality, I am using SurfaceView, whenever i do tap on flash button toggle works but flash not coming... see my below code i have used to Turn ON/OFF Flashlights. Complete code:-- @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera); preview=(SurfaceView)findViewById(R.id.surface); previewHolder=preview.getHolder(); previewHolder.addCallback(surfaceCallback); previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); previewHolder

Android: Keep camera-LED on after screen turns off

谁说我不能喝 提交于 2019-11-28 10:22:23
since i'm at the beginning with Android coding i hesitated to post my question, but now i'm at the point where i can't resist. I have a service which turns on the camera-LED onCreate: @Override public void onCreate() { // make sure we don't sleep this.pm = (PowerManager) getSystemService(Context.POWER_SERVICE); this.mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SleepLED"); this.mTimer = new Timer(); this.mTimerTask = new TimerTask() { public void run() { // turn on the LED setFlashlight(Camera.Parameters.FLASH_MODE_TORCH); mWakeLock.acquire(); } }; // Get the notification-service

How to turn flashlight ON and OFF in swift?

无人久伴 提交于 2019-11-28 04:29:08
I'd like to add flashlight functionality to my app in Swift. How can I go about doing that? Lyndsey Scott Update #1: ( torchActive isn't returning the expected value; perhaps because it's been modified ) Update #2: For Swift 2.0 To toggle the flash from on to off (not just "on" as in mad pig's answer), you can use the following method: func toggleFlash() { let device = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) if (device.hasTorch) { do { try device.lockForConfiguration() if (device.torchMode == AVCaptureTorchMode.On) { device.torchMode = AVCaptureTorchMode.Off } else { do {