1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Remotely Control Apps Via App Tethering Or REST In #Delphi XE8

Discussion in 'Delphi Android And IOS' started by AdminDF, May 15, 2015.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan Staff Member DF Staff

    If you are building enterprise applications with Delphi XE8 Firemonkey you may run into the situation where you need to remotely control your app on a user’s device without being in front of the device. Firemonkey makes it easy to remotely control an app on Android, IOS, OSX, and Windows. I have created some sample source code which will take a screenshot of the current application and send it to a second application via the app tethering components. The second application will allow you to click on the screenshot and execute the click on the first application. Basically it works very similarly to how Remote Desktop works in windows. Obviously this is a very rudimentary version as it sends the entire screen each time and is not optimized to only send only the parts of the screen that have changed. You could also deploy this same type of system using the TRESTClient instead of the app tethering components as the idea is the same. Basically you could have a support section in your app where the user would click a Start Remote Session or Sync button. Your app would begin sending screenshots to the remote server via app tethering or REST. Each time the app sends a screenshot it could also listen for a click. Once a click is received it could execute the click in the local app which would complete the remote control loop. This same type of functionality can be used to build a Firemonkey test harness. The magic happens in the custom FindControlAtPoint function which was developed for the TImageCacheLayout component. This same idea and code should also work in Appmethod and maybe C++Builder. Here is a code snippet of that function:

    Code:
    function TForm1.FindControlAtPoint(aParent: TControl; aPos: TPointF): TControl;
    var
    I: Integer;
    Control, ChildControl: TControl;
    S: String;
    begin
    Result := nil;
    
    // Check all the child controls and find the one at the coordinates
    for I := aParent.Controls.Count – 1 downto 0 do
    begin
    Control := aParent.Controls;
    S := Control.ClassName;
    if Control.PointInObject(aPos.X, aPos.Y) then
    begin
    ChildControl := FindControlAtPoint(Control, aPos);
    if Assigned(ChildControl) and ChildControl.HitTest then
    Exit(ChildControl)
    else
    if Control.HitTest then
    Exit(Control);
    end;
    end;
    end;



    Full Source Code
    Hidden Content:
    **Hidden Content: You must click 'Like' before you can see the hidden data contained here.**
     
    XoreDev, saber, mabreu and 1 other person like this.
  2. realist
    Online

    realistrealist is a Verified Member Administrator General Staff Member DF Staff

    RE:

    Thanks
     
  3. jMichael88
    Offline

    jMichael88 DF Junior

    RE:

    Thanks
     
  4. aligathor
    Offline

    aligathor DF Junior

    RE:

    Cool & Nice!
     
  5. CC_
    Online

    CC_ Guest

    RE:

    Great
     
  6. tbilalis
    Offline

    tbilalis DF Junior

    thanks
     
  7. rpancelli
    Offline

    rpancelli DF Member

Share This Page