TMS

TMS LCL Cloud Pack

Seamless access to cloud services from Lazarus applications

Also available for:



Tips and Frequently Asked Questions

 Using TMS LCL Components for Raspberry Pi


With the recently introduced TMS LCL Cloud Pack and the open-source TMS LCL HW Pack, building small Raspberry Pi based projects is easier than ever. In this example, the code for an appliance is presented that displays the number of visitors on a website on a Raspberry Pi 16x2 LCD backpanel.

This code fetches the page statistics from Google Analytics with the TMS LCL Cloud Pack TMSLCLCloudGAnalytics component

function TForm1.GetRTVisitors: string;
var
  RT: TRealtimeMetricsArray;
  StartDate, EndDate: string;
  i: integer;
  error: string;
  Res: TGStringArray;
begin
  Result := ‘’;
 StartDate := ''today'';
  EndDate := ''today'';
  SetLength(RT,1);
  RT[0] := rtActiveUsers;
  TMSLCLCloudGAnalytics1.RequestData.RealtimeMetrics := RT;
  // fetches data for the page coupled with Google Analytics ID set via ViewID 
  Error := TMSLCLCloudGAnalytics1.GetData(TMSLCLCloudGAnalytics1.App.ViewID);
  If Error = ‘’ then
  begin
     Res  := TMSLCLCloudGAnalytics1.Data.Data[0];
     Result := Res[0];
 end;
end;
When the button is clicked, the 16x2 LCD display is initialized and a connection is made to the Google Analytics service:

procedure TForm1.ButtonClick1 (Sender: TObject);
begin
  TMSLCLAdaDispl16x2.Init;
  TMSLCLCloudGAnalytics1.Connect;
end;
When the connection is ready, the number of realtime users is fetched and shown on the 16x2 LCD display:

procedure TForm1.TMSLCLCloudGAnalytics1Connected(Sender: TObject);
var
  s: string;
begin
  s := GetRTVisitors;
  TMSLCLAdaDispl16x2.DrawText(‘Visitors:’ +s);
end;



TMS

Buy now

TMS LCL Cloud Pack


Single developer license


license for 1 developer € 95


order now
add to cart

Site license


unlimited developers in the company € 375


order now
add to cart

CreditCards and PayPal Accepted


Compatibility

    , Demo, Lazarus/FPC


Licensing

Bookmarks