All Activity
This stream auto-updates
- Past hour
-
I'm sorry, but it seems you answered the question yourself. There simply is no MMX DLL that can be loaded in D2007.
-
TakePhotoAction crashes android app and starts again on xiaomi Android 12
fisipjm replied to fisipjm's topic in FMX
Thank you both for your Answers. The information about not needing any permission when using the System Camera is completely accurate. I tested it, and it works as expected. Please mark the permission topic as completed. This makes sense because my app isn’t directly taking the photo—it’s the System Camera app that has access to the hardware. I’ve gathered some new information about what seems to be the app being "wiped" from the background. To investigate further, I added a timer and an information panel to the sample application to monitor its memory usage. The app also includes a function to add 50 MB to the RAM with each click. Here’s what I found: Normal Operation: When the app runs on a Xiaomi device, it typically uses around 50–60 MB of RAM. Taking a photo works without any issues. High RAM Usage: When I increase the app’s RAM usage significantly (e.g., by manually adding memory), the demo app crashes when taking a photo. Memory Thresholds: A "soft limit" seems to exist between 200 MB and 450 MB, beyond which the app becomes unstable. At 500 MB, there is a "hard limit" where the app consistently crashes and restarts. After the crash, the app restarts with a memory footprint of around 50–60 MB again Unfortunately, I couldn’t stop MIUI from killing the app in the background. I followed all the suggestions from this StackOverflow thread: https://stackoverflow.com/questions/70860054/xiaomi-miui-keeps-killing-my-background-application Without success. One thing that baffles me is that even if the demo app crashes during the photo-taking process, the picture taken is still displayed in the system image viewer. How is this even possible? It looks like the TImageManagerAndroid.TPhotoActivityResponseListener.onResponse trys to prevent the Bitmap from getting loss even if the OnDidFinishTaking Event is not Assigned any more. Do you have any Idea on how to use the Bitmap after the app starts from the beginning? My Starting form is not the One I want to get the Image into. Here is what the onResponse method does (with some little Logs added) but I do not know how to handle that properly. See the Part where log.d is onDidFinishTaking is not assigned. procedure TImageManagerAndroid.TPhotoActivityResponseListener.onResponse(response: JPhotoActivityResponse); var LParams: TParamsPhotoQuery; LNativeBitmap: JBitmap; LBitmap: TBitmap; LConverted: Boolean; LRequestKind: JPhotoActivityRequestKind; LException: JException; LFailureCause: TTakingFailureCause; function GetFailureCauseFromException(const Exception: JException): TTakingFailureCause; var LName: string; begin LName := JStringToString(Exception.getClass.getName); if LName = 'com.embarcadero.firemonkey.medialibrary.FileNotCreatedException' then Result := TTakingFailureCause.FileNotCreated else if LName = 'java.io.FileNotFoundException' then Result := TTakingFailureCause.FileNotAvailable else if LName = 'com.embarcadero.firemonkey.decode.BitmapDecodeException' then Result := TTakingFailureCause.DecodeError else Result := TTakingFailureCause.UnknownError; end; begin log.d('Response Listener Start'); LParams := FImageManager.FParams; if response.isCancelled then begin log.d('Response is Cancelled'); if Assigned(LParams.OnDidCancelTaking) then LParams.OnDidCancelTaking else TMessageManager.DefaultManager.SendMessage(FImageManager, TMessageDidCancelTaking.Create); end else if response.isSuccessful then begin log.d('Response is Successful'); LNativeBitmap := TJBitmap.Wrap(response.getResult); LBitmap := TBitmap.Create; try LConverted := JBitmapToBitmap(LNativeBitmap, LBitmap); LNativeBitmap.recycle; if LConverted then begin if Assigned(LParams.OnDidFinishTaking) then begin log.d('OnDidFinishTaking is Assigned'); LParams.OnDidFinishTaking(LBitmap) end else begin log.d('OnDidFinishTaking is not Assigned'); LRequestKind := response.getRequestKind; if LRequestKind.equals(TJPhotoActivityRequestKind.JavaClass.PICK) then TMessageManager.DefaultManager.SendMessage(Self, TMessageDidFinishTakingImageFromLibrary.Create(LBitmap)) else if LRequestKind.equals(TJPhotoActivityRequestKind.JavaClass.TAKE) then TMessageManager.DefaultManager.SendMessage(Self, TMessageDidFinishTakingImageFromCamera.Create(LBitmap)); end; end; finally LBitmap.Free; end; end else begin log.d('Response is Exception'); LException := response.getException; LFailureCause := GetFailureCauseFromException(LException); TJutil_Log.JavaClass.w(StringToJString('PhotoLibrary'), LException); if Assigned(LParams.OnDidFailTaking) then LParams.OnDidFailTaking(LFailureCause) else TMessageManager.DefaultManager.SendMessage(FImageManager, TMessageDidFailTaking.Create(LFailureCause)); end; log.d('Response Listener End'); end; -
Hello Uwe, first of all, thank you very much for your work on mmx. It makes a lot of people feel better working on their project. My question: "Extract Method" is very handy working on 10.4.2. Is it somehow possible to use MMX V14.0.4 with Delphi 2007? It is the first version where you dropped support for 2007 and also the version where you fixed that rename bug. Best regards
-
Desktop App Development with Object Pascal
PhilBoy replied to PhilBoy's topic in Algorithms, Data Structures and Class Design
@David Schwartz I appreciate your frank response to the situation I described in my posts. From my discussions with the Project Lead, I don't think there's any malicious intent behind hiring me for this project. His co-lead for the project pushed hard for this project to be funded and commence, and was really interested in reviving this Delphi simulator. My Project Lead is actually looking for more people to come on board the project. I guess it's a situation where I've mischaracterized my skill sets. My Project Lead is aware that I have no Delphi experience and has asked me to take time to become familiar with the environment. I think I'll just have a discussion with him on what his expectations are and to clarify what my skill sets are and be looking for something else to do. If you would be interested in this role, please let me know and we can privately discuss connecting with my Project lead. -
KuestenPeter joined the community
- Today
-
Try use OLEDB (using AdoConnection) rather using ODBC
-
Escaping characters in HttpRest.RestParams.AdditemSO
Angus Robertson replied to iddqd345's topic in ICS - Internet Component Suite
Should be in SVN today, if I don't get distracted. Angus -
sslHttpCli - the program freezes after executing the request
iddqd345 replied to iddqd345's topic in ICS - Internet Component Suite
Sent an email -
Escaping characters in HttpRest.RestParams.AdditemSO
iddqd345 replied to iddqd345's topic in ICS - Internet Component Suite
Thanks! -
TakePhotoAction crashes android app and starts again on xiaomi Android 12
Rollo62 replied to fisipjm's topic in FMX
I'm not sure, if that is still true on modern phones with modern OS, the examples were quite old, from the era before permission discussions perhaps. I would generally recommend to request permission before touching any camera part, that cost not much, and will be considered as good behaviour to ask the user before touching dangerous parts. -
I thought they had gone under, due to gross incompetence. But as one can see, that is no reason to die as a business anymore...quite the opposite even.
-
i update the class my github Repo here unit API.Utils; interface uses System.SysUtils, // [Exceptions] System.Generics.Defaults; // [IComparer, TComparer] type TRange<T> = class public // Check if a value is within the range [aMin, aMax] using a custom comparer class function IsIn(const aValue, aMin, aMax: T; const aComparer: IComparer<T>): Boolean; overload; static; // Check if a value is within the range [aMin, aMax] using the default comparer class function IsIn(const aValue, aMin, aMax: T): Boolean; overload; static; end; implementation { TRange<T> } class function TRange<T>.IsIn(const aValue, aMin, aMax: T; const aComparer: IComparer<T>): Boolean; begin case GetTypeKind(T) of tkString, tkClass, tkLString, tkWString, tkInterface, tkDynArray, tkUString: begin if PPointer(@aValue)^ = nil then Exit(False); end; tkMethod: begin if (PMethod(@aValue)^.Data = nil) or (PMethod(@aValue)^.Code = nil) then Exit(False); end; tkPointer: if PPointer(@aValue)^ = nil then Exit(False); end; if not Assigned(aComparer) then raise EArgumentNilException.Create('Comparer is not assigned.'); Result := (aComparer.Compare(aValue, aMin) >= 0) and (aComparer.Compare(aValue, aMax) <= 0); end; class function TRange<T>.IsIn(const aValue, aMin, aMax: T): Boolean; begin Result := IsIn(aValue, aMin, aMax, TComparer<T>.Default); end; end. the call test : program RangeCheckerPrj; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, DateUtils, System.Types, System.Generics.Defaults, API.Utils in 'API\API.Utils.pas', API.Objects.Comparer in 'API\API.Objects.Comparer.pas', API.RangeCheckerTest in 'API\API.RangeCheckerTest.pas'; begin try Writeln('-----------------<< Integer Tests >>--------------------------------'); Writeln(TRangeTester<Integer>.Test(5, 1, 10)); // "5 is within the range [1, 10]" Writeln(TRangeTester<Integer>.Test(15, 1, 10)); // "15 is outside the range [1, 10]" Writeln('-----------------<< Int64 Tests >>--------------------------------'); Writeln(TRangeTester<Int64>.Test(5_000_000_000_000_000_001, 5_000_000_000_000_000_000, 5_000_000_000_000_000_010)); Writeln(TRangeTester<Int64>.Test(5_000_000_000_000_000_000, 5_000_000_000_000_000_001, 5_000_000_000_000_000_010)); Writeln('-----------------<< Float Tests >>----------------------------------'); Writeln(TRangeTester<Double>.Test(7.5, 5.0, 10.0)); Writeln(TRangeTester<Double>.Test(7.5, 7.6, 10.0)); Writeln('-----------------<< DateTime Tests >>------------------------------'); Writeln(TRangeTester<TDateTime>.Test(Today, Today, Today +10)); Writeln(TRangeTester<TDateTime>.Test(Yesterday, Today, Today +10)); Writeln('-----------------<< String Tests >>--------------------------------'); Writeln(TRangeTester<string>.Test('hello', 'alpha', 'zulu')); Writeln(TRangeTester<string>.Test('zulu', 'alpha', 'omega')); Writeln(TRangeTester<string>.Test('b', 'a', 'c')); // "'b' is within the range ['a', 'c']" Writeln(TRangeTester<string>.Test('A', 'b', 'c')); Writeln(TRangeTester<string>.Test('B', 'a', 'c')); Writeln('-----------------<< TPoint Tests >>-----------------------------'); Writeln(TRangeTester<TPoint>.Test(gPoint1, gPoint2, gPoint3, PointComparer)); Writeln(TRangeTester<TPoint>.Test(Point(5, 5), Point(0, 0), Point(3, 4), PointComparer)); Writeln('-----------------<< TCustomRecord Tests >>-----------------------------'); Writeln(TRangeTester<ICustomRecord>.Test(gRec1, gRec2, gRec3, gRecordComparer)); gRec1.New.Edit('Mid', 40); Writeln(TRangeTester<ICustomRecord>.Test(gRec1, gRec2, gRec3, gRecordComparer)); Writeln('-----------------<< TProduct Tests >>-----------------------------'); Writeln(TRangeTester<IProduct>.Test(gProduct1, gProduct2, gProduct3, gProductComparer)); gProduct1.New.Edit(1, 40); Writeln(TRangeTester<IProduct>.Test(gProduct1, gProduct2, gProduct3, gProductComparer)); Writeln('-----------------<< TClient Tests >>-----------------------------'); Writeln(TRangeTester<IClient>.Test(gClient1, gClient2, gClient3, gClientComparer)); gClient1.New.Edit('Alice', 40); Writeln(TRangeTester<IClient>.Test(gClient1, gClient2, nil, gClientComparer)); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end. the Output:
-
sslHttpCli - the program freezes after executing the request
Angus Robertson replied to iddqd345's topic in ICS - Internet Component Suite
Sorry, the logging you provided has no detail about the HTTP protocol used, it is only for SSL development purposes. So is no-use in diagnosing your problem. The HttpRest log set to body level will be more useful, you can email it. Angus -
When I use rmGET, I can insert a database. However, this type of work sends everything open via the URL. This situation is not clear. It is readable via Postman. It is said that it is useful to send it as a JSON object.
-
sslHttpCli - the program freezes after executing the request
iddqd345 posted a topic in ICS - Internet Component Suite
Hi, I use HttpRest, but it uses HttpCli, so the question is about the latter. My program freezes after executing the GET request. As a result of the request, a JSON object is downloaded and the program freezes after that. To make sure that the problem is not in my code, I tried to repeat the error in OverbyteIcsHttpsTst.exe the result is the same . Unfortunately, I cannot provide access to this server for the test, and I understand that this greatly complicates the search for the problem. Here is a part of the log OverbyteIcsHttpsTst.exe, these lines with "TCustomSslWSocket.Do_FD_CLOSE error" are repeated in a loop indefinitely. It looks like there's some kind of problem with windows messages processing, but my knowledge is lacking here. 19:01:04:473 ProtoMsg: TLS 1.3 Handshake: New Session Ticket, State: SSLv3/TLS read server session ticket, Recv, DataLen: 391, Data= 040001830000012CAD664D34080000000000000001016E7E78006A32B910C63995E26ED8C34A6C6C886400B92837D931524BB9AFC3BB686B6C08B5478FE607E41E0C24A2B36B6FC73B68F3EBC9BA0E5B4318B88B4CC6FE95E86E6CC3E9864BA6FF73DE58CF321B4F1F43EFCCE759382480F1B2E6409B812CEEDD564F74017D2455F539812540FFB90450749767EC04F8C319A6CFBBDF60BBD01E0578C6B4A857D3AF582785C85C5ACD683D1E33D3FE9C72FD34509280239D0A8466EA6C3D305263C3E232428F09CCACD3A8460285B43C2B148E10C2A9BFF1833D0F919474EC58049B59CCE5DEAAA0E5FDBCBA1FF8C38443F448A158D004E62B81052A4739CE857CBE38E14612882B47EB2EE9AF23DAE4D80B367410E6048ADF63B40AD653413039C128FE721C1D429ADA2DEB00BB7752B8939C4B6C2E1706F2A2C21BBA756AC33F264BF852F65BCE2EB9C0F313651DCC8F32C4DD1B14F111E7214B5E982FBF1AB0DDD047628F1E545E3066A31785AD37EF5AA85AC22EE4A98BF178C9528AB35D142CB644DF0000 19:01:04:473 NSCB> New session created 19:01:04:473 0589E980 CliNewSessionCB [034849F0] Reused: False 19:01:04:473 0589E980 ICB> SSL_connect: SSLv3/TLS read server session ticket 19:01:04:551 ProtoMsg: TLS 1.2, State: SSL negotiation finished successfully, Recv, DataLen: 5, Data= 17030301C0 19:01:04:551 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:551 0589E980 *CloseCalled handle=1136, State=SSL negotiation finished successfully (TLS_ST_OK), Err=No error returned 19:01:04:551 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:551 ProtoMsg: TLS 1.3, State: SSL negotiation finished successfully, Recv, DataLen: 1, Data= 17 19:01:04:551 Data available. Len=431 19:01:04:598 End of header 19:01:04:598 State = httpWaitingBody 19:01:04:598 GetBodyLineNext begin 19:01:04:598 DocBegin 19:01:04:614 GetBodyLineNext FBodyDataLen=43 19:01:04:614 End of document 19:01:04:614 State = httpBodyReceived 19:01:04:614 DocEnd 19:01:04:614 GetBodyLineNext end 19:01:04:614 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:614 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:614 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:614 0589E980 SslInternalClose handle=1136 19:01:04:614 0589E980 TCustomSslWSocket.ShutDown 1 handle=1136 19:01:04:614 0589E980 SslInternalShutdown handle=1136 19:01:04:614 ProtoMsg: TLS 1.2, State: SSL negotiation finished successfully, Send, DataLen: 5, Data= 1703030013 19:01:04:614 ProtoMsg: TLS 1.2, State: SSL negotiation finished successfully, Send, DataLen: 1, Data= 15 19:01:04:614 ProtoMsg: TLS 1.3 Alert, Warning: Close Notify, State: SSL negotiation finished successfully, Send, DataLen: 2, Data= 0100 19:01:04:614 0589E980 ICB> SSL3 alert write warning close notify 19:01:04:614 0589E980 SslShutdownCompleted *0* handle=1136 19:01:04:614 State = httpReady 19:01:04:614 ProtoMsg: TLS 1.2, State: SSL negotiation finished successfully, Recv, DataLen: 5, Data= 1703030013 19:01:04:614 0589E980 SslShutdownCompleted *0* handle=1136 19:01:04:614 0589E980 TriggerSslShutDownComplete(0) 1136 19:01:04:614 0589E980 TCustomWSocket.Shutdown 1 handle=1136 19:01:04:614 0589E980 SslShutdownCompleted *1* handle=1136 19:01:04:614 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:614 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:614 RequestDone 19:01:04:692 ProtoMsg: TLS 1.3, State: SSL negotiation finished successfully, Recv, DataLen: 1, Data= 15 19:01:04:692 ProtoMsg: TLS 1.3 Alert, Warning: Close Notify, State: SSL negotiation finished successfully, Recv, DataLen: 2, Data= 0100 19:01:04:692 0589E980 ICB> SSL3 alert read warning close notify 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 19:01:04:692 **data available. Len=-1 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 0589E980 TCustomSslWSocket.Do_FD_CLOSE error #0 handle=1136 19:01:04:692 Data available. Len=-1 -
Thanks. When I use rmGET, I can insert a database. However, this type of work sends everything open via the URL. This situation is not clear. It is readable via Postman. It is said that it is useful to send it as a JSON object.
-
How to see a list of needed .bpl files for deployment
Uwe Raabe replied to CB2021's topic in General Help
The menu Project -> Information for <xxx> should give you this: Information for Project -
I have a situation that occurs on low-end Android devices. Short version: When the user double-taps a button, the event is being executed on the button that hasn't been created on the screen yet. What happens is, I have a list of frames created on my screen, which represent the product categories. When I tap on a category frame, the application destroys the category frames on the screen and creates a new set of product frames. The problem is, when my user double-taps very quickly on the category frame, the second click is executed on the product frame that hasn't even appeared on the screen yet. I'm using delphi 12.2 My code is something like this: procedure CreateCategory; var frm: TFrameCategory; category: TObjCategory; begin for category in listCategory do begin frm := TFrameCategory.Create(nil, category); frm.OnClick := OnClickCategory; rectangleFrames.AddObject(frm); end; end; procedure OnClickCategory(Sender: TObject); var frm: TFrameProduct; prod: TObjProduct; i: Integer; begin for i := rectangleFrames.ControlsCount - 1 downto 0 do begin rectangleFrames.Controls.DisposeOf; end; rectangleFrames.ControlCollection.Clear; for prod in listProduct do begin frm := TFrameProduct.Create(nil, prod); frm.OnClick := OnClickProduct; rectangleFrames.AddObject(frm); end; end So, the second tap is executed in OnClickProduct instead of being executed twice in OnClickCategory. How can I prevent this? i've alredy tryed a lot of things like calling this procedure on the OnClickCategory event but it doesn't seems ideal procedure disableRecTemp; begin rectangleFrames.Enabled:= False; TThread.CreateAnonymousThread(procedure begin Sleep(1500); TThread.Synchronize(nil, procedure begin rectangleFrames.Enabled := True; end); end).Start; end
-
I'm using C++B 12.2 64bit(modern) how can I generate a list of the Embarcadero .bpl files I will need to deploy in my install program? The menu Project->Deployment only shows files added to my project but no .bpl files. Thank You.
-
The last that I had from HikVision was in pure C (and with comments in Chinese ....). They had a C# wrapper for demo project.
-
TakePhotoAction crashes android app and starts again on xiaomi Android 12
Patrick PREMARTIN replied to fisipjm's topic in FMX
Right, I use the camera stream. This page explains what Android expect (for the gallery): https://developer.android.com/about/versions/14/changes/partial-photo-video-access And this one for the TakePhotoFromCamera API : https://developpeur-pascal.fr/utiliser-l-action-standard-takephotofromcamera-pour-les-applications-android-9-et-plus.html where I use the same permissions, but you also need the "secured file sharing" right from Project / Options / Rights / Android32&64 -
TakePhotoAction crashes android app and starts again on xiaomi Android 12
fisipjm replied to fisipjm's topic in FMX
Hi Patrick, Thanks for your Reply. But what you are saying is not true. It is true, If you use the Camera Component on your App itself for lets say perform qrCodeScan or somthing similar. But if you use the TakePhotoAction from the action list, the Application that is used to take the picture is switched to system camera and handles the Bitmap in the on Finished procedure. That works without the need of any System and User Permission for the Camera. The Example from Embarcadero shows this too. -
Isn't the headerfile for C#?
-
@Erik@Grijjy's neslib/Chet: C Header Translator for Delphi may be worth giving it a try.
-
TakePhotoAction crashes android app and starts again on xiaomi Android 12
Patrick PREMARTIN replied to fisipjm's topic in FMX
procedure TfrmMain.GoToPhotoScreen(AskPermission: boolean); begin if AskPermission then TPermissionsService.DefaultService.RequestPermissions (['android.permission.CAMERA'], procedure(const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray) var i: integer; begin for i := 0 to length(AGrantResults) - 1 do if (AGrantResults[i] = TPermissionStatus.Denied) then raise exception.create ('Permission nécessaire pour prendre une photo.'); GoToPhotoScreen(false); end, procedure(const APermissions: TClassicStringDynArray; const APostRationaleProc: TProc) begin TDialogService.showmessage ('Il est nécessaire d''avoir cette autorisation pour prendre une photo.', procedure(Const AModalResult: TModalResult) begin if assigned(APostRationaleProc) then APostRationaleProc; end); end) else begin MaskPath.data.data := FCurrentProject.MaskPath.data.data; ActiveLaCamera(tconfig.CameraType); CurrentScreen := rPhotoScreen; end; end; You need something like this code from https://github.com/DeveloppeurPascal/Fie-Frapic/blob/main/src/fMain.pas and the good permissions for your manifest. The TakePhoto call is in "ActiveLaCamera() but you can put it in the ELSE part of this code. -
TakePhotoAction crashes android app and starts again on xiaomi Android 12
Patrick PREMARTIN replied to fisipjm's topic in FMX
Hi Do you ask for Android permissions to take a photo in your projects options and in your code ? The standard actions only call the APIs, they don't ask for the permissions for us.