

radekc
Members-
Content Count
7 -
Joined
-
Last visited
Everything posted by radekc
-
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
radekc replied to Joe Sansalone's topic in Network, Cloud and Web
If you want, you can use great mime decoder from synapse, works with binary data in mime use mimepart, mimemess, synautil oStream := TMemoryStream.Create; ARequestInfo.PostStream.Position := 0; oStream.LoadFromStream(ARequestInfo.PostStream); //<------- Indy Post stream oStream.Position := 0; mime := TMimeMess.Create; mime.DecodeMessageBinary(ARequestInfo.RawHeaders, oStream); if mime.MessagePart = nil then begin LogErrorFmt('Invalid HTTP mime in POST ', [], False); Exit; end; //sData := mime.MessagePart.GetSubPartCount.ToString; LogInfo(Format('Found parts:%d in mime data ', [mime.MessagePart.GetSubPartCount])); for iParts := 0 to mime.MessagePart.GetSubPartCount - 1 do begin mimepart := mime.MessagePart.GetSubPart(iParts); LogInfo(Format('Found part: %s, %s ', [mimepart.FileName, mimepart.Primary+'-'+mimepart.Secondary])); sExt := ExtractFileExt(mimepart.FileName); if (sExt = '.json') then begin mimepart.DecodePart; sData := ReadStrFromStream(mimepart.DecodedLines, mimepart.DecodedLines.Size); end; end; -
Delphi 12.2 code editor blinks for every key I press
radekc replied to Clément's topic in Delphi IDE and APIs
I have same problem on RDP. Look like Flicker happens when CodeInsight show Done (maybe they need refressh window). CodeInsight is started every time a key is pressed. Disabling CodeInsigh (and Restart LSP) block flickering but I need LSP . -
IF you want use EXTERNAL_MANAGE_STORAGE and use same code as before (on Android 13 required, introduced in Android 11), your user must enable all access, you can invoke dialog with this code (working code based on Kastri library) class function TMainForm.NeedsAllFilesAccessPermission: Boolean; begin Result := TOSVersion.Check(11) and not TJEnvironment.JavaClass.isExternalStorageManager; end; class function TMainForm.ShowAllFilesAccessPermissionSettings: Boolean; var LIntent: JIntent; LUri: Jnet_Uri; LAction: JString; begin Result := False; if NeedsAllFilesAccessPermission then begin LUri := TJnet_Uri.JavaClass.fromParts(StringToJString('package'), TAndroidHelper.Context.getPackageName, nil); LAction := StringToJString('android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION'); LIntent := TJIntent.JavaClass.init(LAction, LUri); TAndroidHelper.Context.startActivity(LIntent); Result := True; end; end;
-
Hi, I wrapped 3rd party JView java component with class based on TAndroidNativeView, but now I am lost. Everything is created, dynamic library from 3rd party is loaded (debugger is show it), I can call methods, but how I show it on form or on layout? I see created parent Layout in TAndroidNativeView, but how I parent this layout with FMX? I looked in FMX in Android MapView, but I don't know.
-
Solved, for future: use https://github.com/Zeus64/alcinoe/blob/master/source/ALFmxEdit.pas as example, refactor for your JView.
-
java.lang.BootstrapMethodError: Exception from call site #2 bootstrap method
radekc posted a topic in FMX
Hi, I am try use 3rd party library (https://developers.arcgis.com/android/latest/java/sample-code/display-a-map/) and after some battle and fixed resources I get run-time error java.lang.BootstrapMethodError: Exception from call site #2 bootstrap method every solution on web recommended for Android studio compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } but what about Delphi? General info https://developer.android.com/studio/write/java8-support -
java.lang.BootstrapMethodError: Exception from call site #2 bootstrap method
radekc replied to radekc's topic in FMX
Solved: if you use d8 for dexing, use Java 8 (as expected), but don't use --no-desugaring param.