Sivagnanam Subramani
Sivagnanam Subramani

Reputation: 45

How to bind service from Java library in Xamarin Android Project

How to bind a service created in 3rd party library project in Xamarin Android project.??

Upvotes: 0

Views: 178

Answers (1)

Guangyu Bai - MSFT
Guangyu Bai - MSFT

Reputation: 4486

You can refer to this article Binding a Java Library. In the Microsoft doc, first you can get the class from the .aar file.

var ClassName = new Com.MyCompany.MyProject.MyclassName();

Then use the bindService or other methods to use the Class.

var Result =context.getApplicationContext.bindService(new Intent(context,typeof(ClassName)), new ServiceConnection(),Bind.AutoCreate);

Upvotes: 0

Related Questions