Peter J.
Members-
Content Count
15 -
Joined
-
Last visited
Community Reputation
0 Neutral-
Using Camera in Android 9 under Delphi 12.1 CE
Peter J. replied to Peter J.'s topic in Cross-platform
Thanks for the reply, Dave. sorry, I've been too overwhelmed to look into the log msg as it seems quite a lot of setup. Anyway, I ran the same code in Android 15 and it worked fine! It's quite disappointing though that it worked in 15 and not 9. How would I know if my app will work on Android 10-14? Surely it's not practical to test all. -
Using Camera in Android 9 under Delphi 12.1 CE
Peter J. replied to Peter J.'s topic in Cross-platform
I'm using SDK 34.0 - downloaded from the sdkmanager.bat -
Using Camera in Android 9 under Delphi 12.1 CE
Peter J. replied to Peter J.'s topic in Cross-platform
Thanks for the reply. The camera did not show at all. The app crashed as in "closed without error message". procedure TForm2.DidCancelTaking(const Sender: TObject; const M: TMessage); begin if M is TMessageDidCancelTaking then begin DoCancelTaking; // do cancellation stuff end; end; procedure TForm2.DoCancelTaking; begin //if Assigned(OnDidCancelTaking) then //Memo1.lines.insert(0,'cancel taking photo'); end; procedure TForm2.RequestCameraPermissions; begin PermissionsService.RequestPermissions(['android.permission.CAMERA'], PermissionsResult, nil); end; procedure TForm2.PermissionsResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray); //PermissionsResult begin //if AGrantResults = TPermissionResult.GRANTED then if (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted) then begin // Permissions granted, start the camera // CameraComponent1.Active := True; takephoto(); //TakePhotoFromCameraAction1.Execute; showmessage('executed'); end else begin // Permissions denied, show a message ShowMessage('Camera permission is required to use this feature.'); end; end; procedure TForm2.takephoto(); var Params: TParamsPhotoQuery; begin if TPlatformServices.Current.SupportsPlatformService(IFMXCameraService, FCameraService) then begin Params.Editable := False; Params.NeedSaveToAlbum := False; Params.RequiredResolution := TSize.Create(640,640); Params.OnDidFinishTaking := TakePhotoDidFinishTaking; Params.OnDidCancelTaking := DoCancelTaking; FCameraService.TakePhoto(button1, Params); end else begin end; end; procedure TForm2.TakePhotoFromCameraActionDidFinishTaking(Image: TBitmap); begin Image2.Bitmap.Assign(Image); showmessage('TakePhotoFromCameraActionDidFinishTaking()'); end; -
Using Camera in Android 9 under Delphi 12.1 CE
Peter J. replied to Peter J.'s topic in Cross-platform
oh, thanks for the response! I didn't know that Android 9 is not supported. Delphi 12 Athens is here! – Delphi Worlds -> it says Android 8.1 so I'm a little confused. There's no error. click the button to take photo and the app closes. As for the adb log, it is way too many, so I didn't think it would be useful. I'll try to get a newer Android phone. Meanwhile, if anyone has similar experiences, please let me know possible solutions. thank you! -
I used this for Delphi 11.x with Android 9. No issue. Now the same code in Delphi 12.1 crashes after I "allow camera" in Android phone. Permissions [x] Camera. I even enabled "Secured File Sharing" just to be safe. Any advice? A similar service for Select Photos From Folder (IFMXTakenImageService) does not crash. Any advice on this? var Params: TParamsPhotoQuery; begin if TPlatformServices.Current.SupportsPlatformService(IFMXCameraService, FCameraService) then begin Params.Editable := False; Params.NeedSaveToAlbum := False; Params.RequiredResolution := TSize.Create(640,640); Params.OnDidFinishTaking := TakePhotoDidFinishTaking; Params.OnDidCancelTaking := DoCancelTaking; FCameraService.TakePhoto(button1, Params); end else begin end;
-
I ran my Android 64-bit app. The splash screen hanged without giving any error. Running a blank app is ok. What is the best way to find out what happened during the loading? I tried running app in DEBUG mode, but each time I pressed F7 or F8, the deployment process will re-start all over again. It seems the app does not even hit the first line of the .DPR project file. I know how to start logcat but there are so much messages coming in. Any other way to debug Android 64 apps? Do I really have to comment out as much code as possible, and slowly add them back in? Thanks for any ideas.
-
thanks for the reply. I didn't know it can do realistic images as the examples on youtube show a little "cartoon-like" renderings. ok, I'll check this out. What I'm trying to do is go close to a Blender 3D software rendering... meaning if I put in textures & lightings, it can give me an almost photo-realistic rendering. There was one suggestion of using Firemonkey 3D. I have tried it using the 3D forms etc. However, I read that the "perspective" generated in Firemonkey is not correct (similar to old-generation 3D rendering engines). Not sure whether this is true. I'll check out the links you gave. Thanks! Lastly, do let me know if I can achieve Blender-like 3D renderings with textures and lightings... eg. I would want water and glass to look natural too. thanks
-
Most of the 3D render engines seem to be C++. It doesn't seem to be trivial to translate the C++ to headers that can be used by Delphi. Are there any existing 3D libraries that work with Delphi? When I mean 3D, I don't mean Castle game engine type (not realistic enough). thanks for any pointers.
-
Thanks for the tip. I found this link [Android] How to upload native deubg symbols to playstore? · fastlane/fastlane · Discussion #21090 · GitHub for the debug symbols. if anyone figured out how to do it for Delphi, do update here 🙂
-
Thanks, Dave!
-
After submission, no errors, but there are 2 warnings.... should I ignore them? Warning There is no deobfuscation file associated with this App Bundle. If you use obfuscated code (R8/proguard), uploading a deobfuscation file will make crashes and ANRs easier to analyze and debug. Using R8/proguard can help reduce app size. Learn More -> I suspect this is inevitable for Delphi app ? Warning This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. Learn More -> is there an easy way to include a debug symbols file if I'm compiling a Release version (not a debug version)?
-
ok thanks a lot, Dave! by the way, "targetSdkVersion" can only be inserted by Delphi? can we define this anywhere? i looked through Project Options but there is nothing to override. so I assumed changing the XML hard-coded is the only way?
-
shouldn't https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page be the latest update of all? while the Yukon article was posted while 12 was in beta. anyway, I tried configuring apk 33 just to see if a basic app will work. surprisingly it compiled, BUT when I uploaded to Google portal, it complained I was targeting sdk 32 instead of 33! I don't even have sdk 32 installed! My AndroidManifest.template.xml says: <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="33" /> any solutions to this? where else could I be specifying 32 wrongly?
-
https://docwiki.embarcadero.com/PlatformStatus/en/Main_Page It's clearly stated that Delphi 11.3 supports Android 13 (sdk 33.0). I have tried for hours to configure SDK 33 into Delphi 11.3 with no success. I used Android Studio to download SDK 33.0 and latest NDK 26. Does anyone have a working 11.3 + Android SDK 33? and will care to share their installation tips? thanks
-
Using Delphi 11 patch 2 (btw, I used the custom Android installer documented in https://delphiworlds.com/2020/09/manual-android-sdk-ndk-install-delphi/ (The default SDK Manager installed with Delphi does not show sdk 30.03 so was forced to use this) --> I'm just wondering why I can only use this tool and not the standard SDK Manager from Delphi. installed it to c:\androidsdk\sdk (where there was previously a 29.0) and the ndk is in c:\androidsdk\ndk (Android NDK 21e that worked with 29.0 previously, and since it also has a 30.0 support folder) Unlike Android SDK 29.02 which was detected by Delphi 10.4.1 IDE In Delphi 11, Tools-Options, SDK Manager, i chose "Add" new SDK In the dialog, I select all the appropriate directories, but in the "SDK API Level" dropdown, it says "Cannot locate SDK API Level" If I browse to an old SDK folder, it can detect for eg, android25 or android 26. so I know the Delphi 11 Tools-Options SDK can detect android sdks. Anyway, I ignored the warning "Cannot locate SDK API Level in this path, please, check your selection. Do you want to save your changes anyway?" since I have no choice. 1) How can I get Delphi 11 Tools-Options-SDK to properly recognise Android 30, given that 29.0 was recongised easily. 2) Is there a preferred version of NDK that I should use with Android SDK 30.0? 3) I used Kastri biometric example to run Delphi 11 the BiometricDemo.dpr instead of BiometricDemoD11.dpr (BiometricDemoD11.dpr gave too many error messages when compiling). I added 3,628 dw-biometric-2.0.0.jar to the Android libraries The example that came out hang at the splash screen... and got stuck there. Any advice?