Recent

Author Topic: Camera Flashlight [SOLVED]  (Read 847 times)

Guser979

  • New Member
  • *
  • Posts: 21
Camera Flashlight [SOLVED]
« on: July 05, 2020, 04:39:46 am »
Hi! I've been trying to develop an app. It is fully functional. It has a database with 12000 records. Everything is OK. I read the data with a zbarcode and photo record for each item. Problems: Photo has no flashlight. Before giving up I would like to know if anyone tried this and what is the solution? I keep trying everything I imagine but my knowledge in java is not the best. A possible solution would be to use intent for the camera. Why is it so complicated to get picture with flash in Lazarus ?  Question: If I use Android Studio (learning Java) would I be able to do this easily? Thank´s
« Last Edit: August 01, 2020, 05:06:55 am by Guser979 »

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: Camera
« Reply #1 on: July 05, 2020, 07:45:52 am »
Question: If I use Android Studio (learning Java) would I be able to do this easily? Thank´s
Following link should be able to give a hint for you ? https://mkyong.com/android/how-to-turn-onoff-camera-ledflashlight-in-android/

Guser979

  • New Member
  • *
  • Posts: 21
Re: Camera
« Reply #2 on: July 05, 2020, 02:17:40 pm »
Thanks for the answer. Well, I was hoping to get it done using LAMW. Freepascal is very easy. But anyway. I will install Android Studio, learn JAVA and give up Lazarus for Android. This is not productive because I intend to develop it for personal use only. The app has a desktop version made in Lazarus. The mobile version would be an extension of this. But still, if anyone has a solution to the problem, I'll be back with LAWM. His IDE for me is the best. And I love free (Pascal).

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: Camera
« Reply #3 on: July 05, 2020, 10:15:50 pm »
Well, I was hoping to get it done using LAMW. Freepascal is very easy.
That I have no clue how to do it using LAMW does not mean that it is not possible to realise with LAMW.

There are far more capable people around here that knows the ins and outs of LAMW, unfortunately I am not one of them.

Keep in mind that we are up and around holidays as well as time differences that could account for the fact that someone knowing LAMW better than me/us hasn't replied yet.

Quote
But still, if anyone has a solution to the problem, I'll be back with LAWM. His IDE for me is the best. And I love free (Pascal).
Try to have a little patience. I understand that this means not being productive in the mean time so, if you feel the need to use something else then you should certainly do so.

Guser979

  • New Member
  • *
  • Posts: 21
Re: Camera
« Reply #4 on: July 06, 2020, 01:27:13 am »
 :-[


Yes. Maybe I'm a little impatient because just after finishing the app I discovered that there was no way to have flash photos with LAWN's Jcustomcam (the only one that worked). I'm still trying to find a solution so I don't have to lose my job.
Update:
Using Intentmanager I can shoot using the device's camera app. It works, but I can only get the thumbnail. When I try to pass Uri to get the file on activity result, the app force close and doesn't even open the camera.

Note: Maybe this topic can help anyone with the same problem. The moment comes when you will need to use the device's camera in an app. I've researched a lot here and haven't seen this problem. But I realized that even on the Java forums this is a recurring problem. It seems to me that the solution would not be just to install Android Studio and everything would work. I'll keep trying.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1608
Re: Camera
« Reply #5 on: July 08, 2020, 04:02:44 am »

Done!

Please, update LAMW from github.

New jCustomCamera  "SetFlashlight" method!

Thanks to All!

Hint 1: After update LAMW, reinstall the "tfpandroidbridge_pack.lpk" package
Hint 2:  open your project and do "Run" --> "Clean up and Build" 

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Guser979

  • New Member
  • *
  • Posts: 21
Re: Camera
« Reply #6 on: July 17, 2020, 05:33:05 am »
sensational. I can't wait to try. I've been so busy these past few days that I barely have any free time. On the weekend the first thing to do will be this. We have to thank you.


EDIT :

jmpessoa

Tested and working. Perfect Perfect ... Now my app is perfect. Thanks to you friend. Productivity with LAMW is unmatched. The same app made in Android Studio would take much longer, even with a JAVA connoisseur. LAMW is just wonderful. I love you guys.
« Last Edit: July 18, 2020, 12:10:42 am by Guser979 »

 

TinyPortal © 2005-2018