MToken and IPS SDKs
In this section, we will show you how to reference DLLs in your Android and IOS projects.
What is an SDK?
An SDK, or Software Development Kit, is a set of tools, guidelines, and programs used to develop applications for a specific platform. Suggested by the name, an SDK is a kit for developing software. SDKs boast a set of robust features and functionalities which reduce the complexity of developing programs and applications. To create applications with advanced functionalities such as advertisements, push notifications, etc; most application software developers use specific SDKs. Typically, a basic SDK will include a compiler, debugger, and APIs, they can also include any of the following: documentation, libraries, editors, runtime/development environments, testing/analysis tools, drivers, network protocols.
What is a DLL?
A DLL, or Dynamic-link library is Microsoft’s implementation of the shared library concept in the Microsoft Windows operating systems. DLLs can contain code, data and resources, in any combination. The use of DLLs helps promote modularization of code, code reuse, efficient memory usage, and reduced disk space. So, the operating system and the programs load faster, run faster, and take less disk space on the computer. But, when a program uses a DLL, an issue that is called dependency may cause the program not to run. That’s why we need to update DLL references.
Referencing DLL
First things first, we need to obtain new DLLs. Our colleagues from SxS team deliver them to our team in two ways:
- They send premade, zipped DLLs or
- They send Java or Objective C files – in that case we need to create Bindings Library first.
In this case, files that we have received are premade DLLs for IOS.
Once downloaded, DLLs need to be unzipped. Depending on the platform, we will either have one merged file for Android or two separate files for IOS. One DLL is for MToken and other is for IPS.
Next, we need to add new folder in DigitalEdge\ExternalDependencies folder and copy unzipped DLLs to our new folder. Good practice is to name that folder after names of DLLs, which platform they are for and current date.
Next, we will open the solution in which we want to add DLLs. First we need to remove current DLLs. They are located inside of References for that platform’s project. Find the reference, then right-click on it and select Remove.
When we search for MTokenWrapper.cs and InstantPaymentWrapper.cs in Services folder, there should be errors caused by missing reference.
Now we can add new reference: right-click on References and then click on Add Reference. Click on Browse to navigate to the folder that contains wanted DLL. After clicking on OK button our new file should be referenced.
If we want to double check whether the path of our refence is correct or not, we should right click on it, select Properties, and than find Path field. If we go back to both of the classes, most of the errors, or even all of them, should disappear. Team that issued new DLLs always includes changes in documentation, so we can refactor the code in our application accordingly.
We should also test the application to make sure everything runs smoothly and there are no unexpected errors.
Don’t forget that DLLs we have added to ExternalDependencies folder are created locally and need to be manually added to source control. In Source Control Explorer navigate to ExternalDependencies folder, right-click on it and select Add Items to Folder.
Find your new folder and then include both files.
All that’s left to do is to check-in changed files to tfs.