How it works...

In steps 1 to 6, we opened the existing solution we created in previous recipes. In step 9, we added a reference to the library from the Android application. In step 10, we added the code-level reference to the library. This will allow us to grab all the available methods from the library. In step 12, we changed the existing code. In step 14, we created an instance of CounterLib() and stored it in a variable.

In step 15, again, we made a small change to the button's existing click code to use the IncrementByOne() method from the class library. Finally, in steps 16, 17, and 18, we tested our new code.

Get .NET Standard 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.