Jump to content

Turan Can

Members
  • Content Count

    63
  • Joined

  • Last visited

Community Reputation

3 Neutral

About Turan Can

  • Birthday March 1

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Turan Can

    Foreground service

    This example will help you. Take a look at this. https://stackoverflow.com/questions/60466609/start-foreground-service-in-delphi-10-3
  2. Turan Can

    FMX Android Mouse pos X , Y and keyboard event

    This has to be. Because remote desktop connection products will not work otherwise. It has to be active with an authorization.
  3. Turan Can

    FMX Android Mouse pos X , Y and keyboard event

    Mouse, Detection of mouse click I need a sample code to post mosu as x, y. Important: I want to click outside the form globally, not on the form. So even if the form is running in the background, I want to click on a point I want. function MousePos: TPointF; var MouseService: IFMXMouseService; begin if TPlatformServices.Current.SupportsPlatformService(IFMXMouseService, IInterface(MouseService)) then Exit(MouseService.GetMousePos); Result := PointF(0, 0); end;
  4. Turan Can

    FMX Android Mouse pos X , Y and keyboard event

    First of all thanks for the reply. This only works in the open form. I want to activate the mouse anywhere on the phone.
  5. Hi All, Does anyone know the equivalent of these 2 features in android? I want to click on the X, Y coordinates I sent. Windows vcl; I've been using these on windows with no problems. SetCursorPos Mouse_Event Android ?? event: JMotionEvent; Form1.MouseMove([], Mouse.Left, Mouse.Top);
  6. Turan Can

    Android Screenshot not working on new phones >= 10

    After great effort I solved the problem. Thanks everyone for the unanswered message 😉
  7. I realized that no one is developing with video or audio features in Delphi android. Display, sound, keyboard, socket etc. features are priority concepts. I converted it from java to delphi with great effort, but I couldn't even find an answer to it. It's a very sad scene. Android Screenshot not working on new phones >= 10 - Cross-platform - Delphi-PRAXiS [en] (delphipraxis.net)
  8. Turan Can

    Android Screenshot not working on new phones >= 10

    MediaProjection service type not recognized in android Q - Stack Overflow Is there a "startForeground()" delphide example of this method? TJService.Create.startForeground(); // FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION); I couldn't find it, under which service? ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
  9. Turan Can

    Delphi 11.0 has a different form Caption offset than Delphi 10.4

    You have to design it yourself, On click form properties... BorderStyle : bsNone OnPaint procedure TForm1.FormPaint(Sender: TObject); begin OnBasePaint(ClientWidth, ClientHeight, Canvas); end; procedure TfmMain1.OnBasePaint(ClientWidth, ClientHeight: Integer; Canvas: TCanvas); var Rect: TRect; begin Rect.Left := 0; Rect.Top := 0; Rect.Bottom := ClientHeight; Rect.Right := ClientWidth; with Canvas do begin // Pen.Width := 2; // Brush.Color := $00000000; // Pen.Color := $006B6B6B; // Rectangle(0, 0, ClientWidth, ClientHeight); end; end;
  10. Turan Can

    combobox with custom drop down (treeview)

    Add dropdown menu and when clicked. Activate a hidden treeview menu. For example, I'm using a panel instead of a button because there is no color in the buttons 🙂
  11. Hi All, I was capturing android screenshot but it doesn't work on newer versions. Return error code; Project AndroidTest.apk raised exception class EJNIException with message 'java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION'. Permission add on: Foreground Service I gave the "AndroidManifest" in authorization. <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> Another weird problem is the service I added "AndroidManifest". TJManifest_permission.JavaClass... is not in "FOREGROUND_SERVICE" the service, INSTANT_APP_FOREGROUND_SERVICE Attached is a sample project. Delphi 11 build project function TForm1.OnActivity(RequestCode, ResultCode: integer; Itt: JIntent): Boolean; var MPro: JMediaProjection; begin Result := false; if RequestCode = REQUEST_CODE_SCREEN_CAPTURE then begin if ResultCode = TJActivity.JavaClass.RESULT_OK then begin ///Return error code; ///Project AndroidTest.apk raised exception class EJNIException with message 'java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION'. MPro := FMedia.getMediaProjection(ResultCode, Itt); if MPro <> nil then begin // ... Result := true; ShowMessage('Ok') end; end; end; end; AndroidTest_Screenshot.zip
  12. Turan Can

    WinInet API 4095 How can I remove this limit?

    I solved the problem thanks
  13. Hi All, When I want to download a page on the website, it downloads a maximum of 4095 bytes. How can I remove this limit? function TDownloadFile.WebGetData(const UserAgent: string; const Url: string): string; var hInet: HINTERNET; hURL: HINTERNET; Buffer: array [0 .. 10] of AnsiChar; BufferLen: Cardinal; dwTimeOut: DWORD; begin Result := ''; hInet := InternetOpen(PChar(UserAgent), INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); if hInet = nil then RaiseLastOSError; try // dwTimeOut := 2000; // Timeout in milliseconds // InternetSetOption(hInet, INTERNET_OPTION_CONNECT_TIMEOUT, @dwTimeOut, SizeOf(dwTimeOut)); hURL := InternetOpenUrl(hInet, PChar(Url), nil, 0, INTERNET_FLAG_PRAGMA_NOCACHE or INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_RELOAD, 0); if hURL = nil then RaiseLastOSError; try repeat if not InternetReadFile(hURL, @Buffer, SizeOf(Buffer), BufferLen) then RaiseLastOSError; Result := Result + UTF8Decode(Copy(Buffer, 1, BufferLen)) until BufferLen = 0; finally InternetCloseHandle(hURL); end; finally InternetCloseHandle(hInet); end; end;
  14. Hi All, The foreground program works fine. However, when I open another program, it becomes disabled after a short while. What do we need to do to keep the background work going? I tried a thing or two but it didn't work. This feature exists but I couldn't find Delphide ..? "Use <android.permission.FOREGROUND_SERVICE permission: name =" " Uses Permissions - RAD Studio (embarcadero.com)
  15. Turan Can

    full screen view capture

    The problem is solved. I convert from the Java example. Thanks. It only receives the form you send. Please check the picture above.
×