SlideShare uma empresa Scribd logo
1 de 12
Embarcadero Technologies Copyright 2016
Controle uma Aplicação Windows
a partir de uma Aplicação Mobile com
AppTethering
Fernando Rizzato
Lead Software Consultant, Latin America
Embarcadero Technologies Copyright 2016
SOLUÇÃO DE DESENVOLVIMENTO EMBARCADERO
Embarcadero Technologies Copyright 2016
A DIVERSIDADE DE DISPOSITIVOS SEGUIRÁ AUMENTANDO
Embarcadero Technologies Copyright 2016
AppTethering
 Expanda facilmente seus aplicativos existentes
do Windows para dispositivos móveis
 Aplicações móveis complementares são a
resposta para os nossos clientes utilizando
Windows/VCL
 Controle e interação com aplicativos do Windows
existentes e aplicativos móveis
 Componentes simplificados de comunicação em
cada um dos lados
 Por exemplo, um aplicativo do Google Glass pode
controlar os aspectos de um aplicativo do
Windows já existente
Embarcadero Technologies Copyright 2016
AT
AT
Your Desktop App
Your
Mobile
App
Your
Smartphone
App
AT
• Estenda Apps VCL e FMX
• Descoberta Automática de Devices
• Executar Eventos e Métodos Remotos
• Controle Apps Remotamente
• Envie e Receba Dados
• Suporte para Bluetooth e WiFi
AppTethering
Embarcadero Technologies Copyright 2016
AppTethering
 Aplicativos VCL e FMX podem se
comunicar e transmitir dados sobre Wi-
Fi e Bluetooth
 Open, baseado em componentes e
arquitetura plugável
 Caso de Uso: Aplicação FM mobile como
"controle remoto" para aplicações VCL
existentes
Embarcadero Technologies Copyright 2016
TTetheringManager
 Cada app tem um componente TTetheringManager
 É o responsável pela função de Auto Discovery
 Gerencia o pareamento e a conexão
 Controla autenticação
Embarcadero Technologies Copyright 2016
TTetheringAppProfile
 Cada app tem um ou mais TTetheringAppProfile
 É o responsável por publicar ações para execução remota
 Executa ações remotas que foram publicadas
 Envia e recebe dados da app remota
Embarcadero Technologies Copyright 2016
Aplicações de AppTethering
 Chamada bidirecional de ações
 Permite criar uma segunda tela ”portátil”
 Clicks e Eventos Remotos
 Envio de Strings e Streams
 Barcode scanner, reconhecimento de voz, entradas via
touch screen, captura de imagens ou dados de sensores
 Expansão do alcance de sua app
Embarcadero Technologies Copyright 2016 10
AppTethering em Ação!
Embarcadero Technologies Copyright 2016
Recursos Adicionais
 Documentação:
 http://docwiki.embarcadero.com/RADStudio/Seattle/en/C
onnecting_to_Remote_Applications_Using_App_Tethering
 Blogs:
 http://otapi.com/category/tutorials/delphi-
tutorials/connectivity/app-tethering
 http://www.malcolmgroves.com/blog/?p=1842
 http://www.malcolmgroves.com/blog/?p=1854
 http://www.malcolmgroves.com/blog/?p=1891
 http://www.malcolmgroves.com/blog/?p=1935
 http://www.malcolmgroves.com/blog/?p=1964
 http://www.malcolmgroves.com/blog/?p=1989
Embarcadero Technologies Copyright 2016 12
OBRIGADO!
Perguntas?
Você pode me encontrar em:
@FernandoRizzato
fernando.rizzato@embarcadero.com
Siga-nos em
fb.com/DelphiBrasil
fb.com/EmbarcaderoBR

Mais conteúdo relacionado

Destaque (9)

а з б у к а
а з б у к аа з б у к а
а з б у к а
 
Здрава храна
Здрава хранаЗдрава храна
Здрава храна
 
Pravilna prehrana i pravilne prehrambene navike
Pravilna prehrana i pravilne prehrambene navikePravilna prehrana i pravilne prehrambene navike
Pravilna prehrana i pravilne prehrambene navike
 
Istine i lazi o ishrani
Istine i lazi o ishrani   Istine i lazi o ishrani
Istine i lazi o ishrani
 
Prezentacija o zdravoj ishrani
Prezentacija o zdravoj ishraniPrezentacija o zdravoj ishrani
Prezentacija o zdravoj ishrani
 
Zdrava prehrana
Zdrava prehranaZdrava prehrana
Zdrava prehrana
 
Zdrava hrana - pravilna ishrana
Zdrava hrana - pravilna ishranaZdrava hrana - pravilna ishrana
Zdrava hrana - pravilna ishrana
 
Prenos energije i kruženje materije u ekosistemu
Prenos energije i kruženje materije  u ekosistemuPrenos energije i kruženje materije  u ekosistemu
Prenos energije i kruženje materije u ekosistemu
 
Bill Aulet GEC2016 keynote speech March 16 2016 Medellin Colombia
Bill Aulet GEC2016 keynote speech March 16 2016 Medellin ColombiaBill Aulet GEC2016 keynote speech March 16 2016 Medellin Colombia
Bill Aulet GEC2016 keynote speech March 16 2016 Medellin Colombia
 

Semelhante a Controle uma Aplicação Windows a partir de uma Aplicação Mobile com AppTethering

Aplicativos para dispositivos móveis
Aplicativos para dispositivos móveisAplicativos para dispositivos móveis
Aplicativos para dispositivos móveis
Ygor Castro
 
Introdução Silverlight Windows Phone
Introdução Silverlight Windows PhoneIntrodução Silverlight Windows Phone
Introdução Silverlight Windows Phone
Nuno Luz
 

Semelhante a Controle uma Aplicação Windows a partir de uma Aplicação Mobile com AppTethering (20)

Mobilidade e Segurança - O Desafio de Lidar com dispositivos móveis pessoais ...
Mobilidade e Segurança - O Desafio de Lidar com dispositivos móveis pessoais ...Mobilidade e Segurança - O Desafio de Lidar com dispositivos móveis pessoais ...
Mobilidade e Segurança - O Desafio de Lidar com dispositivos móveis pessoais ...
 
Apresentação de Desenvolvimento e Negócios para Windows Phone
Apresentação de Desenvolvimento e Negócios para Windows Phone Apresentação de Desenvolvimento e Negócios para Windows Phone
Apresentação de Desenvolvimento e Negócios para Windows Phone
 
Apps tecnologias e usos
Apps   tecnologias e usosApps   tecnologias e usos
Apps tecnologias e usos
 
Apostilaandroidfatecnormal
ApostilaandroidfatecnormalApostilaandroidfatecnormal
Apostilaandroidfatecnormal
 
Android - Notas de aula
Android - Notas de aulaAndroid - Notas de aula
Android - Notas de aula
 
Soluções para Centrais de Monitoramento - Arena IT
Soluções para Centrais de Monitoramento - Arena ITSoluções para Centrais de Monitoramento - Arena IT
Soluções para Centrais de Monitoramento - Arena IT
 
Softwares Livres Para Uma Comunicação Relativamente Segura
Softwares Livres Para Uma Comunicação Relativamente SeguraSoftwares Livres Para Uma Comunicação Relativamente Segura
Softwares Livres Para Uma Comunicação Relativamente Segura
 
Forum Mobile+ - MEAPs Como selecionar uma plataforma mobile de aplicações ent...
Forum Mobile+ - MEAPs Como selecionar uma plataforma mobile de aplicações ent...Forum Mobile+ - MEAPs Como selecionar uma plataforma mobile de aplicações ent...
Forum Mobile+ - MEAPs Como selecionar uma plataforma mobile de aplicações ent...
 
Aplicativos para dispositivos móveis
Aplicativos para dispositivos móveisAplicativos para dispositivos móveis
Aplicativos para dispositivos móveis
 
Computacao Movel e Sem Fio
Computacao Movel e Sem FioComputacao Movel e Sem Fio
Computacao Movel e Sem Fio
 
Windows Phone Development
Windows Phone DevelopmentWindows Phone Development
Windows Phone Development
 
Ciclo de palestras da JFRJ - Aplicativos Móveis
Ciclo de palestras da JFRJ - Aplicativos MóveisCiclo de palestras da JFRJ - Aplicativos Móveis
Ciclo de palestras da JFRJ - Aplicativos Móveis
 
Programação para dispositivos Móveis - Criação de aplicativos - Android Aula...
Programação para dispositivos Móveis - Criação de aplicativos  - Android Aula...Programação para dispositivos Móveis - Criação de aplicativos  - Android Aula...
Programação para dispositivos Móveis - Criação de aplicativos - Android Aula...
 
Restaurante
RestauranteRestaurante
Restaurante
 
INAC LIVE - Soluções de Tecnologia para Eventos
INAC LIVE - Soluções de Tecnologia para EventosINAC LIVE - Soluções de Tecnologia para Eventos
INAC LIVE - Soluções de Tecnologia para Eventos
 
INAC LIVE - Soluções de Tecnologia para Eventos
INAC LIVE - Soluções de Tecnologia para EventosINAC LIVE - Soluções de Tecnologia para Eventos
INAC LIVE - Soluções de Tecnologia para Eventos
 
INAC - Soluções de Tecnologia para Eventos
INAC - Soluções de Tecnologia para EventosINAC - Soluções de Tecnologia para Eventos
INAC - Soluções de Tecnologia para Eventos
 
Dispositivos Moveis
Dispositivos MoveisDispositivos Moveis
Dispositivos Moveis
 
Introdução Silverlight Windows Phone
Introdução Silverlight Windows PhoneIntrodução Silverlight Windows Phone
Introdução Silverlight Windows Phone
 
Embarcadero adquire Raize Components e apresenta novas soluções para desenv...
Embarcadero adquire Raize Components e apresenta novas soluções para desenv...Embarcadero adquire Raize Components e apresenta novas soluções para desenv...
Embarcadero adquire Raize Components e apresenta novas soluções para desenv...
 

Mais de Fernando Rizzato

Mais de Fernando Rizzato (20)

Todos os recursos do RAD Studio 10.3 RIO
Todos os recursos do RAD Studio 10.3 RIOTodos os recursos do RAD Studio 10.3 RIO
Todos os recursos do RAD Studio 10.3 RIO
 
Conoce lo nuevo en RAD Studio, C++ Builder y Delphi 10.2.2
Conoce lo nuevo en RAD Studio, C++ Builder y Delphi 10.2.2Conoce lo nuevo en RAD Studio, C++ Builder y Delphi 10.2.2
Conoce lo nuevo en RAD Studio, C++ Builder y Delphi 10.2.2
 
Programa Acadêmico Embarcadero Gratuíto
Programa Acadêmico Embarcadero GratuítoPrograma Acadêmico Embarcadero Gratuíto
Programa Acadêmico Embarcadero Gratuíto
 
Programa Acadêmico Embarcadero
Programa Acadêmico EmbarcaderoPrograma Acadêmico Embarcadero
Programa Acadêmico Embarcadero
 
RAD Studio 10.2 Tokyo
RAD Studio 10.2 TokyoRAD Studio 10.2 Tokyo
RAD Studio 10.2 Tokyo
 
O BACK-END PERFEITO PARA APLICAÇÕES DELPHI E C++ BUILDER
O BACK-END PERFEITO PARA APLICAÇÕES DELPHI E C++ BUILDERO BACK-END PERFEITO PARA APLICAÇÕES DELPHI E C++ BUILDER
O BACK-END PERFEITO PARA APLICAÇÕES DELPHI E C++ BUILDER
 
BERLIN 10.1 UPDATE 2 EDIÇÃO DE ANIVERSÁRIO
BERLIN 10.1 UPDATE 2 EDIÇÃO DE ANIVERSÁRIOBERLIN 10.1 UPDATE 2 EDIÇÃO DE ANIVERSÁRIO
BERLIN 10.1 UPDATE 2 EDIÇÃO DE ANIVERSÁRIO
 
Modelado y Arquitectura de Datos con ER/Studio
Modelado y Arquitectura de Datos con ER/StudioModelado y Arquitectura de Datos con ER/Studio
Modelado y Arquitectura de Datos con ER/Studio
 
Uso de efectos, animaciones y transiciones en FireMonkey
Uso de efectos, animaciones y transiciones en FireMonkey Uso de efectos, animaciones y transiciones en FireMonkey
Uso de efectos, animaciones y transiciones en FireMonkey
 
Usando efeitos, animações e transições no FireMonkey
Usando efeitos, animações e transições no FireMonkey Usando efeitos, animações e transições no FireMonkey
Usando efeitos, animações e transições no FireMonkey
 
Comprender y utilizar layouts FireMonkey
Comprender y utilizar layouts FireMonkey Comprender y utilizar layouts FireMonkey
Comprender y utilizar layouts FireMonkey
 
Compreendendo e utilizando FireMonkey Layouts
Compreendendo e utilizando FireMonkey Layouts Compreendendo e utilizando FireMonkey Layouts
Compreendendo e utilizando FireMonkey Layouts
 
Uso del Windows Runtime (WinRT) y la Universal Windows Platform (UWP) en Win...
 Uso del Windows Runtime (WinRT) y la Universal Windows Platform (UWP) en Win... Uso del Windows Runtime (WinRT) y la Universal Windows Platform (UWP) en Win...
Uso del Windows Runtime (WinRT) y la Universal Windows Platform (UWP) en Win...
 
Utilizando o Windows Runtime (WinRT) e o Universal Windows Platform (UWP) no ...
Utilizando o Windows Runtime (WinRT) e o Universal Windows Platform (UWP) no ...Utilizando o Windows Runtime (WinRT) e o Universal Windows Platform (UWP) no ...
Utilizando o Windows Runtime (WinRT) e o Universal Windows Platform (UWP) no ...
 
Introducción a NoSQL con MongoDB y FireDAC
Introducción a NoSQL con MongoDB y FireDAC Introducción a NoSQL con MongoDB y FireDAC
Introducción a NoSQL con MongoDB y FireDAC
 
Introdução a NoSQL com MongoDB e FireDAC
Introdução a NoSQL com MongoDB e FireDAC Introdução a NoSQL com MongoDB e FireDAC
Introdução a NoSQL com MongoDB e FireDAC
 
Integración de servicios en la nube con REST/JSON
Integración de servicios en la nube con REST/JSONIntegración de servicios en la nube con REST/JSON
Integración de servicios en la nube con REST/JSON
 
Integração de Serviços Cloud com REST/JSON
Integração de Serviços Cloud com REST/JSON Integração de Serviços Cloud com REST/JSON
Integração de Serviços Cloud com REST/JSON
 
LiveBindings: desde lo básico hasta técnicas avanzadas
LiveBindings: desde lo básico hasta técnicas avanzadas LiveBindings: desde lo básico hasta técnicas avanzadas
LiveBindings: desde lo básico hasta técnicas avanzadas
 
LiveBindings - de Formulários Visuais ao Código
LiveBindings - de Formulários Visuais ao Código LiveBindings - de Formulários Visuais ao Código
LiveBindings - de Formulários Visuais ao Código
 

Controle uma Aplicação Windows a partir de uma Aplicação Mobile com AppTethering

  • 1. Embarcadero Technologies Copyright 2016 Controle uma Aplicação Windows a partir de uma Aplicação Mobile com AppTethering Fernando Rizzato Lead Software Consultant, Latin America
  • 2. Embarcadero Technologies Copyright 2016 SOLUÇÃO DE DESENVOLVIMENTO EMBARCADERO
  • 3. Embarcadero Technologies Copyright 2016 A DIVERSIDADE DE DISPOSITIVOS SEGUIRÁ AUMENTANDO
  • 4. Embarcadero Technologies Copyright 2016 AppTethering  Expanda facilmente seus aplicativos existentes do Windows para dispositivos móveis  Aplicações móveis complementares são a resposta para os nossos clientes utilizando Windows/VCL  Controle e interação com aplicativos do Windows existentes e aplicativos móveis  Componentes simplificados de comunicação em cada um dos lados  Por exemplo, um aplicativo do Google Glass pode controlar os aspectos de um aplicativo do Windows já existente
  • 5. Embarcadero Technologies Copyright 2016 AT AT Your Desktop App Your Mobile App Your Smartphone App AT • Estenda Apps VCL e FMX • Descoberta Automática de Devices • Executar Eventos e Métodos Remotos • Controle Apps Remotamente • Envie e Receba Dados • Suporte para Bluetooth e WiFi AppTethering
  • 6. Embarcadero Technologies Copyright 2016 AppTethering  Aplicativos VCL e FMX podem se comunicar e transmitir dados sobre Wi- Fi e Bluetooth  Open, baseado em componentes e arquitetura plugável  Caso de Uso: Aplicação FM mobile como "controle remoto" para aplicações VCL existentes
  • 7. Embarcadero Technologies Copyright 2016 TTetheringManager  Cada app tem um componente TTetheringManager  É o responsável pela função de Auto Discovery  Gerencia o pareamento e a conexão  Controla autenticação
  • 8. Embarcadero Technologies Copyright 2016 TTetheringAppProfile  Cada app tem um ou mais TTetheringAppProfile  É o responsável por publicar ações para execução remota  Executa ações remotas que foram publicadas  Envia e recebe dados da app remota
  • 9. Embarcadero Technologies Copyright 2016 Aplicações de AppTethering  Chamada bidirecional de ações  Permite criar uma segunda tela ”portátil”  Clicks e Eventos Remotos  Envio de Strings e Streams  Barcode scanner, reconhecimento de voz, entradas via touch screen, captura de imagens ou dados de sensores  Expansão do alcance de sua app
  • 10. Embarcadero Technologies Copyright 2016 10 AppTethering em Ação!
  • 11. Embarcadero Technologies Copyright 2016 Recursos Adicionais  Documentação:  http://docwiki.embarcadero.com/RADStudio/Seattle/en/C onnecting_to_Remote_Applications_Using_App_Tethering  Blogs:  http://otapi.com/category/tutorials/delphi- tutorials/connectivity/app-tethering  http://www.malcolmgroves.com/blog/?p=1842  http://www.malcolmgroves.com/blog/?p=1854  http://www.malcolmgroves.com/blog/?p=1891  http://www.malcolmgroves.com/blog/?p=1935  http://www.malcolmgroves.com/blog/?p=1964  http://www.malcolmgroves.com/blog/?p=1989
  • 12. Embarcadero Technologies Copyright 2016 12 OBRIGADO! Perguntas? Você pode me encontrar em: @FernandoRizzato fernando.rizzato@embarcadero.com Siga-nos em fb.com/DelphiBrasil fb.com/EmbarcaderoBR

Notas do Editor

  1. Execute remote actions, exchange data and use discovery service App Tethering Application tethering enables your apps to interact with other apps running either on the same machine or on a remote machine. Using tethering, your applications can: Discover other applications that support tethering running on the same device or on other connected devices. Share data between applications. Tethering allows sharing both strings and streams, and you can use streams to implement support for any other data structure. Execute actions remotely. An application can publish actions using tethering; then a second application can invoke any of these actions remotely on the first application. Tethering components: We follow the Bluetooth profile model: there is a main component, and then a profile that implements the functionality: TTetheringManager: is the component that manages all basic operations: auto discovering and pairing with other remote managers. TTetheringAppProfile implements the "Application Profile", a set of functionality that include executing remote actions, sharing resources and sending streams and strings between other paired profiles. A manager needs to register a profile to start, so you need to drop a TTetheringManager component and a TTetheringAppProfile component in a form, and then link both components, filling the manager property in the profile component. To find other tether applications in the network, your app needs to execute the method DiscoverManagers. You can set a timeout; the default timeout is 1500ms. When the timeout finishes, you receive the OnEndManagersDiscovery event, in which you receive a list of the discovered remote managers. From this list of remote managers, you can choose the ones you want to pair with. Example: Create a form with a button, a memo, a manager, and a profile. uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Layouts, System.Generics.Collections, FMX.ListBox, IPPeerClient, IPPeerServer, System.Tether.Manager, System.Tether.AppProfile, System.Tether.TCPProtocol; type TForm1 = class(TForm) TetheringManager1: TTetheringManager; TetheringAppProfile1: TTetheringAppProfile; Button1: TButton; Memo1: TMemo; procedure TetheringManager1EndManagersDiscovery(const RemoteManagers: \ TList<System.Tether.Manager.TTetheringManagerInfo>); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm3.Button1Click(Sender: TObject); begin TetheringManager1.DiscoverManagers; end; procedure TForm3.TetheringManager1EndManagersDiscovery(\ const RemoteManagers: TList<System.Tether.Manager.TTetheringManagerInfo>); var I: Integer; begin for I := 0 to RemoteManagers.Count - 1 do Memo1.Lines.Add(RemoteManagers[I].ManagerText); end; In this example, you fill a memo with the text of all remote managers found. When you want to make a manager private, you have to fill the password because another manager wants to pair, it needs to know this password to be able to pair. To pair with a remote manager, you use the method PairManager(ARemoteManager). Then if the manager is protected by password, you receive an event OnRequestManagerPassword with the remote manager identifier and a password var to fill, so you need to provide the password to be able to pair: If the password is wrong, then you get the event OnAuthErrorFromServer. If the pairing is fine, then you receive OnPairedToServer along with the OnEndProfilesDiscovery event with all the profiles found in that manager. On the remote side, the manager receives: OnAuthErrorFromClient if the password is wrong. OnPairedFromClient if the password is correct. Profile To use the basic functionality, you need to add a TTetheringProfileApp, and connect that profile to the existing manager. With this you can share data and actions with other profiles. Next you add to the profile SharedActions and/or SharedResources: Shared Actions: A shared action is a container that stores an action link to connect with an existing TAction, and has an ItemName that is used to track that action from all clients that want to execute the action. From the remote client, the action can be executed on demand. Shared Resources: A shared resource is a container that stores a DataValue or a Stream, and its public name that is used in order to be referenced outside. After you configure the sharing information in the profile that you are going to share, go to the client application that is going to use the shared profile. When that application is connected to the previously shared profile, you can instruct the client application profile to execute one remote action, by providing the actual discovered remote profile and the shared name of the action: CommandApp.RunRemoteAction(CommandManager.RemoteProfiles[LbPlayers.ItemIndex], 'acPlayPause');
  2. Execute remote actions, exchange data and use discovery service App Tethering Application tethering enables your apps to interact with other apps running either on the same machine or on a remote machine. Using tethering, your applications can: Discover other applications that support tethering running on the same device or on other connected devices. Share data between applications. Tethering allows sharing both strings and streams, and you can use streams to implement support for any other data structure. Execute actions remotely. An application can publish actions using tethering; then a second application can invoke any of these actions remotely on the first application. Tethering components: We follow the Bluetooth profile model: there is a main component, and then a profile that implements the functionality: TTetheringManager: is the component that manages all basic operations: auto discovering and pairing with other remote managers. TTetheringAppProfile implements the "Application Profile", a set of functionality that include executing remote actions, sharing resources and sending streams and strings between other paired profiles. A manager needs to register a profile to start, so you need to drop a TTetheringManager component and a TTetheringAppProfile component in a form, and then link both components, filling the manager property in the profile component. To find other tether applications in the network, your app needs to execute the method DiscoverManagers. You can set a timeout; the default timeout is 1500ms. When the timeout finishes, you receive the OnEndManagersDiscovery event, in which you receive a list of the discovered remote managers. From this list of remote managers, you can choose the ones you want to pair with. Example: Create a form with a button, a memo, a manager, and a profile. uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Layouts, System.Generics.Collections, FMX.ListBox, IPPeerClient, IPPeerServer, System.Tether.Manager, System.Tether.AppProfile, System.Tether.TCPProtocol; type TForm1 = class(TForm) TetheringManager1: TTetheringManager; TetheringAppProfile1: TTetheringAppProfile; Button1: TButton; Memo1: TMemo; procedure TetheringManager1EndManagersDiscovery(const RemoteManagers: \ TList<System.Tether.Manager.TTetheringManagerInfo>); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm3.Button1Click(Sender: TObject); begin TetheringManager1.DiscoverManagers; end; procedure TForm3.TetheringManager1EndManagersDiscovery(\ const RemoteManagers: TList<System.Tether.Manager.TTetheringManagerInfo>); var I: Integer; begin for I := 0 to RemoteManagers.Count - 1 do Memo1.Lines.Add(RemoteManagers[I].ManagerText); end; In this example, you fill a memo with the text of all remote managers found. When you want to make a manager private, you have to fill the password because another manager wants to pair, it needs to know this password to be able to pair. To pair with a remote manager, you use the method PairManager(ARemoteManager). Then if the manager is protected by password, you receive an event OnRequestManagerPassword with the remote manager identifier and a password var to fill, so you need to provide the password to be able to pair: If the password is wrong, then you get the event OnAuthErrorFromServer. If the pairing is fine, then you receive OnPairedToServer along with the OnEndProfilesDiscovery event with all the profiles found in that manager. On the remote side, the manager receives: OnAuthErrorFromClient if the password is wrong. OnPairedFromClient if the password is correct. Profile To use the basic functionality, you need to add a TTetheringProfileApp, and connect that profile to the existing manager. With this you can share data and actions with other profiles. Next you add to the profile SharedActions and/or SharedResources: Shared Actions: A shared action is a container that stores an action link to connect with an existing TAction, and has an ItemName that is used to track that action from all clients that want to execute the action. From the remote client, the action can be executed on demand. Shared Resources: A shared resource is a container that stores a DataValue or a Stream, and its public name that is used in order to be referenced outside. After you configure the sharing information in the profile that you are going to share, go to the client application that is going to use the shared profile. When that application is connected to the previously shared profile, you can instruct the client application profile to execute one remote action, by providing the actual discovered remote profile and the shared name of the action: CommandApp.RunRemoteAction(CommandManager.RemoteProfiles[LbPlayers.ItemIndex], 'acPlayPause');
  3. Execute remote actions, exchange data and use discovery service App Tethering Application tethering enables your apps to interact with other apps running either on the same machine or on a remote machine. Using tethering, your applications can: Discover other applications that support tethering running on the same device or on other connected devices. Share data between applications. Tethering allows sharing both strings and streams, and you can use streams to implement support for any other data structure. Execute actions remotely. An application can publish actions using tethering; then a second application can invoke any of these actions remotely on the first application. Tethering components: We follow the Bluetooth profile model: there is a main component, and then a profile that implements the functionality: TTetheringManager: is the component that manages all basic operations: auto discovering and pairing with other remote managers. TTetheringAppProfile implements the "Application Profile", a set of functionality that include executing remote actions, sharing resources and sending streams and strings between other paired profiles. A manager needs to register a profile to start, so you need to drop a TTetheringManager component and a TTetheringAppProfile component in a form, and then link both components, filling the manager property in the profile component. To find other tether applications in the network, your app needs to execute the method DiscoverManagers. You can set a timeout; the default timeout is 1500ms. When the timeout finishes, you receive the OnEndManagersDiscovery event, in which you receive a list of the discovered remote managers. From this list of remote managers, you can choose the ones you want to pair with. Example: Create a form with a button, a memo, a manager, and a profile. uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Layouts, System.Generics.Collections, FMX.ListBox, IPPeerClient, IPPeerServer, System.Tether.Manager, System.Tether.AppProfile, System.Tether.TCPProtocol; type TForm1 = class(TForm) TetheringManager1: TTetheringManager; TetheringAppProfile1: TTetheringAppProfile; Button1: TButton; Memo1: TMemo; procedure TetheringManager1EndManagersDiscovery(const RemoteManagers: \ TList<System.Tether.Manager.TTetheringManagerInfo>); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm3.Button1Click(Sender: TObject); begin TetheringManager1.DiscoverManagers; end; procedure TForm3.TetheringManager1EndManagersDiscovery(\ const RemoteManagers: TList<System.Tether.Manager.TTetheringManagerInfo>); var I: Integer; begin for I := 0 to RemoteManagers.Count - 1 do Memo1.Lines.Add(RemoteManagers[I].ManagerText); end; In this example, you fill a memo with the text of all remote managers found. When you want to make a manager private, you have to fill the password because another manager wants to pair, it needs to know this password to be able to pair. To pair with a remote manager, you use the method PairManager(ARemoteManager). Then if the manager is protected by password, you receive an event OnRequestManagerPassword with the remote manager identifier and a password var to fill, so you need to provide the password to be able to pair: If the password is wrong, then you get the event OnAuthErrorFromServer. If the pairing is fine, then you receive OnPairedToServer along with the OnEndProfilesDiscovery event with all the profiles found in that manager. On the remote side, the manager receives: OnAuthErrorFromClient if the password is wrong. OnPairedFromClient if the password is correct. Profile To use the basic functionality, you need to add a TTetheringProfileApp, and connect that profile to the existing manager. With this you can share data and actions with other profiles. Next you add to the profile SharedActions and/or SharedResources: Shared Actions: A shared action is a container that stores an action link to connect with an existing TAction, and has an ItemName that is used to track that action from all clients that want to execute the action. From the remote client, the action can be executed on demand. Shared Resources: A shared resource is a container that stores a DataValue or a Stream, and its public name that is used in order to be referenced outside. After you configure the sharing information in the profile that you are going to share, go to the client application that is going to use the shared profile. When that application is connected to the previously shared profile, you can instruct the client application profile to execute one remote action, by providing the actual discovered remote profile and the shared name of the action: CommandApp.RunRemoteAction(CommandManager.RemoteProfiles[LbPlayers.ItemIndex], 'acPlayPause');
  4. Execute remote actions, exchange data and use discovery service App Tethering Application tethering enables your apps to interact with other apps running either on the same machine or on a remote machine. Using tethering, your applications can: Discover other applications that support tethering running on the same device or on other connected devices. Share data between applications. Tethering allows sharing both strings and streams, and you can use streams to implement support for any other data structure. Execute actions remotely. An application can publish actions using tethering; then a second application can invoke any of these actions remotely on the first application. Tethering components: We follow the Bluetooth profile model: there is a main component, and then a profile that implements the functionality: TTetheringManager: is the component that manages all basic operations: auto discovering and pairing with other remote managers. TTetheringAppProfile implements the "Application Profile", a set of functionality that include executing remote actions, sharing resources and sending streams and strings between other paired profiles. A manager needs to register a profile to start, so you need to drop a TTetheringManager component and a TTetheringAppProfile component in a form, and then link both components, filling the manager property in the profile component. To find other tether applications in the network, your app needs to execute the method DiscoverManagers. You can set a timeout; the default timeout is 1500ms. When the timeout finishes, you receive the OnEndManagersDiscovery event, in which you receive a list of the discovered remote managers. From this list of remote managers, you can choose the ones you want to pair with. Example: Create a form with a button, a memo, a manager, and a profile. uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Layouts, System.Generics.Collections, FMX.ListBox, IPPeerClient, IPPeerServer, System.Tether.Manager, System.Tether.AppProfile, System.Tether.TCPProtocol; type TForm1 = class(TForm) TetheringManager1: TTetheringManager; TetheringAppProfile1: TTetheringAppProfile; Button1: TButton; Memo1: TMemo; procedure TetheringManager1EndManagersDiscovery(const RemoteManagers: \ TList<System.Tether.Manager.TTetheringManagerInfo>); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm3.Button1Click(Sender: TObject); begin TetheringManager1.DiscoverManagers; end; procedure TForm3.TetheringManager1EndManagersDiscovery(\ const RemoteManagers: TList<System.Tether.Manager.TTetheringManagerInfo>); var I: Integer; begin for I := 0 to RemoteManagers.Count - 1 do Memo1.Lines.Add(RemoteManagers[I].ManagerText); end; In this example, you fill a memo with the text of all remote managers found. When you want to make a manager private, you have to fill the password because another manager wants to pair, it needs to know this password to be able to pair. To pair with a remote manager, you use the method PairManager(ARemoteManager). Then if the manager is protected by password, you receive an event OnRequestManagerPassword with the remote manager identifier and a password var to fill, so you need to provide the password to be able to pair: If the password is wrong, then you get the event OnAuthErrorFromServer. If the pairing is fine, then you receive OnPairedToServer along with the OnEndProfilesDiscovery event with all the profiles found in that manager. On the remote side, the manager receives: OnAuthErrorFromClient if the password is wrong. OnPairedFromClient if the password is correct. Profile To use the basic functionality, you need to add a TTetheringProfileApp, and connect that profile to the existing manager. With this you can share data and actions with other profiles. Next you add to the profile SharedActions and/or SharedResources: Shared Actions: A shared action is a container that stores an action link to connect with an existing TAction, and has an ItemName that is used to track that action from all clients that want to execute the action. From the remote client, the action can be executed on demand. Shared Resources: A shared resource is a container that stores a DataValue or a Stream, and its public name that is used in order to be referenced outside. After you configure the sharing information in the profile that you are going to share, go to the client application that is going to use the shared profile. When that application is connected to the previously shared profile, you can instruct the client application profile to execute one remote action, by providing the actual discovered remote profile and the shared name of the action: CommandApp.RunRemoteAction(CommandManager.RemoteProfiles[LbPlayers.ItemIndex], 'acPlayPause');