[LAMW] The camera does not work in AppCompat.Light.NoActionBar
lazarus / 43-Android
----------------------------------------------------------------------
juank1971 · 2020-12-27 01:53
Hi
i am trying to test the camera in AppCompat.Light.NoActionBar
with the latest version of LAMW and it crashes.
I attach the error
----------------------------------------------------------------------
juank1971 · 2020-12-27 01:56
the last error is a new project AppCompat.Light.NoActionBar
bat i convert the AppCameraDemo2 to AppCompat.Light.NoActionBar
and crashes too.
----------------------------------------------------------------------
juank1971 · 2020-12-27 14:15
i try uncomment and comment this line in jControls.java
import android.os.StrictMode; //by Guser979 [try fix
"jCamera_takePhoto"
StrictMode.VmPolicy.Builder builder = new
StrictMode.VmPolicy.Builder(); //by Guser97
StrictMode.setVmPolicy(builder.build()); //by Guser97
and this line too uncomment and comment
String image_path = (path+File.separator+filename);
and crashes the apk
----------------------------------------------------------------------
jmpessoa · 2020-12-29 02:21
I created a new demo project (attachment) using
"AppCompat.Light.DarkActionBar"
and it is working [tested] on these Android versions:
Android 4.3,
Android 5.0.1,
Android 6.0.1 and
Android 9
----------------------------------------------------------------------
juank1971 · 2020-12-29 19:03
Thanks jmpessoa:
uffffffffffffffff, I really don't understand what I'm doing wrong.
your demo works perfectly in my phone android 9.
I don't understand then what is happening, I create a new project
AppCompat.Light.DarkActionBar
I copy the components used in your demo and all procedures, it doesn't
work,
the APK it crashes in TakePhoto
I really don't know what is happening in my lazarus IDE, I have
installed version 2.1 of lazarus, gradle-6.6.1 and java
jdk-8u181-windows-x64.
----------------------------------------------------------------------
jmpessoa · 2020-12-29 19:28
QuoteI have installed version 2.1 of lazarus, gradle-6.6.1 and java
jdk-8u181-windows-x64.
Your system is OK.
Do you have a LAMW updated?
Do you have a Android SDK updated (Api 29)?
QuoteI copy the components used in your demo and all procedures,
copy???
Don't copy just "mimic" it!
----------------------------------------------------------------------
juank1971 · 2021-01-04 21:34
It keeps giving me the same error,
when I try to open the camera and create a new proyect:
I have the latest version of lamw, I have updated the sdk 28 and 29,
I downloaded the latest version of trunk, I compiled it and installed
it,
and when I test your demo AppCompatDarkActionDemo1 you sends me , it
works correctly
but when I generate a new project from my IDE add jcamera and compile
it gives me the error that I sent before.
I am using lazarus 2.1 gradle 6.6.1 Java 64Bits jdk1.8.0_181,
android-ndk-r10e.
----------------------------------------------------------------------
juank1971 · 2021-01-05 06:09
finally I found the error, inside the file
res\xml\support_provider_paths.xml
i have this line
i change for this
change files-path for external-path ,and camera work fine. in android
9
----------------------------------------------------------------------
juank1971 · 2021-01-05 06:43
i change the same line in
lazandroidmodulewizard-master\android_wizard\smartdesigner\java\suppor
t\support_provider_paths.xml
for all my new projects
thanks all for your time .
thanks Jose for your demo because i compared your demo with my new
project and finaly i find the diferences.
----------------------------------------------------------------------
jmpessoa · 2021-01-05 20:08
Quotei change the same line in
lazandroidmodulewizard-master\android_wizard\smartdesigner\java\suppor
t\support_provider_paths.xml
I will update/fix LAMW github.
Thank you!
Edited:
Done!!!