Android - app to app
- Last UpdatedFeb 17, 2025
- 1 minute read
Steps to create a peripheral plugin application
-
Open Visual studio and create an Android Xamarin application.
-
Add IntelaTrac.Mobile.Peripheral.Sdk.dll reference to the Android Xamarin project.
-
Create a new class IntelatracRequest.cs and implement the IRequestHandler interface. For an example, refer to IntelaTracRequest.cs in the sample project.
-
Refer to the section IRequestHandler for details regarding the IRequestHandler methods.
-
In the Initialize method of the IntelaTracRequest class, create an instance of the class implementing the real-time peripherals/ peripheral SDKs. For example, refer PeripheralMock.cs class in the sample project.
-
Add a new class "Plugin.cs" to the project and inherit the "PeripheralService" class from the Intelatrac.Mobile.Peripheral.Sdk.dll.
-
Override the Register method of the PeripheralService class in the Plugin class and register the peripheral type and implementation of IRequestHandler as shown below:
public override void Register()
{
this.Register(Type, new IntelaTracRequest());
}
-
Peripheral Type indicates the category of the peripheral plugin. For example, "Barcode", "RFID", "Temperature", etc.
-
Peripheral type registered with the Peripheral Service should match with the Type configured under server information in Peripheral information bag.
-
-
Add the Service and IntentFilter attributes in the Plugin class as shown below:
[Service(Name = "CommmunicationChannelId", Exported = true)] [IntentFilter(new String[] { "CommunicationChannelId })]
-
CommunicationChannelId (such as com.aveva.mobileoperator.plugin.sampleperipheraldevice) is the peripheral plug-in app that communicates with the AVEVA Mobile Operator app.
-
The CommunicationChannelId must be unique and must match with the CommunicationChannel of the peripheral mentioned in PeripheralInformationBag.
-
-
Build the project and deploy the plugin-app on the Android device.