Leveraging Backend Storage in your Appmethod apps

  

One of the Appmethod features I wanted to highlight is our BaaS support. BaaS stands for Backend as a Service, and in Appmethod, we integrate with leading Backend as a Service providers to add functionality and platform services to your mobile applications. This includes out of the box support for Kinvey and Parse. With BaaS, you get easy access to common services in the cloud without having to build or maintain the backend services yourself.

Here is a quick summary of the features you get with our BaaS integration:

Use push notifications to engage your users on any device or platform
Access data and object storage in the cloud
User authentication
Builds on the REST client support introduced in XE5
Built-in support for Kinvey and Parse with a common API component set

This tutorial show you how to use the KinveyProvider component for querying data that lives in a data collection in the cloud using our BackendQuery component.
First, I signed up for an account on Kinvey.com. While this demo uses Kinvey, you could also use the ParseProvider component. Once you sign up for the account, you will get an app key, master secret and app secret that you will need to enter for the KinveyProvider component. You will also need a BackendQuery, RestResponseDataSetAdapter and FDMemTable component.  BaaS requires Open SSL which means that you will need to get the necessary library files onto your file system before deploying your application.
Before hooking the RestResponseDataSetAdapter component into FDMemTable and BackendQuery, you will need to setup a new data collection since this demo consumes existing data that lives in the cloud. After you have created a new data collection, you will need to add rows and columns and add some data.

Next, set your properties as shown in the two screenshots below, then execute your BackendQuery request, by right-clicking the component.

My application consists of a TTabcontrol with 2 tabs that have a master-detail relationship. The ListView on Tab1 (Master) is bound into FDMemTable, and my toolbar label and memo on Tab2 (Detail) are also bound into FDMemTable. Binding TListView’s Sync property into FDMemTable’s * property ensures that the data stays in sync.

 
C++ Code:

void __fastcall TForm3::BackClick(TObject *Sender)

{

TabControl1->ActiveTab = master;

}

//—————————————————————————

void __fastcall TForm3::ListView1ChangeRepainted(TObject *Sender)

{
TabControl1->ActiveTab = detail;

}

//—————————————————————————

void __fastcall TForm3::FormCreate(TObject *Sender)

{

BackendQuery1->Execute();

}

Object Pascal Code:

procedure TForm3.BackClick(Sender: TObject);
begin
TabControl1.ActiveTab :=  master;
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
BackendQuery1.Execute;
end;
procedure TForm3.ListView1ChangeRepainted(Sender: TObject);
begin
TabControl1.ActiveTab := detail;
end;

Comments are closed.