What is the alternative for setTorchMode in API 21 and 22

I’m trying run flashlight on API 21 and 22 but not working Code if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { isFlashlightOn(); if (camera == null && parameters == null) { camera = Camera.open(); parameters = camera.getParameters(); parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); camera.setParameters(parameters); } if (getFlashlightState) { Objects.requireNonNull(camera).startPreview(); } else { Objects.requireNonNull(camera).stopPreview(); } } else { isFlashlightOn(); if (cameraManager == null) {…

Details

Pyspark Parsing Text File

Have a data file like this: a b c d:;e g:;h /pqr: column1;column2;column3 unit1;unit2;unit2 data1;data2;data3 data4;data5;data6 Columns and associated data elements could vary. Hence, I want to store it as key value pair, something like this: d:e;g:h column1:unit1:data1;column2:unit2:data2;column3:unit3:data3 d:e;g:h column1:unit1:data4;column2:unit2:data5;column3:unit3:data6 If you notice, I’ve ignored the 1st three lines before reading the text file. Also,…

Details

getting error Module parse failed: Unexpected token (1180:11) in react js

when i am trying to run npm start command, i am getting error: Module parse failed: Unexpected token (1180:11) , can anyone please help me to resolve this issue ? here i have uploaded my webpack.config.js file const webpack = require(‘webpack’); module.exports = { entry: ‘./src/index.js’, module: { rules: [ { test: /\.(js|jsx)$/, exclude: /node_modules/,…

Details