CastarSdk for WindowsOverview2024-11-04CastarSdk SDK will helps you make money with Windows apps. You only need to integrate once and reap the benefits easily.
It provides an integration package to support Windows applications developed using .NET(C#)/C++/C or other Windows development languages.
After 48 hours, you'll see revenue data in your dashboard. This document has a complete integrated solution and takes approximately 45 minutes to complete.Integration optionsSupports: Windows7-Windows11, 32 bits or 64 bitsStep 1:Apply for ClientIdGo applications-> Add -> create your ClientId for Windows.Step 2:DownloadSDK for Windows
windows.zip -> Unzipped files:
CastarSdk_64.dll
CastarSdk_386.dll
CastarSdkWin_64.dll
CastarSdkWin_386.dll
Step 3: SDK install(1) StartSDK is an interface function that opens SDK, and it receives a char* parameter, which is your own unique identifier Key.(2) StopSDK is a function that closes SDK interface functions without any parameters. It is executed when SDL is planned to be stopped.(3) Load the corresponding DLL file according to the production environment, and you can freely define the DLL path.(4) CastarSdkWin_ *. dll name can be changed, CastarSdk_ *. dll name cannot be changed.
Example:Your CliendId is "CSK****FHQlUQZ"
#include
#include
#ifdef _WIN64
#define SDKLOADFILEDLL L"CastarSdkWin_64.dll"
#else
#define SDKLOADFILEDLL L"CastarSdkWin_386.dll"
#endif
//Declare the function pointer to start running the SDK
typedef BOOL(*endSdk)();
//Declare function pointer to end running SDK
typedef BOOL(*startSdk)(char* key);
HMODULE hand = NULL;
//Set the ClientId here
const char *keybuf = "CSK****FHQlUQZ";
void InitSDKStart() {
startSdk demoDllStart = (startSdk)GetProcAddress(hand, "startSDK");
if (demoDllStart)
{
/*
The SDK will always block when running successfully,
and will throw a Boolean error when an exception occurs.
*/
if (!demoDllStart((char *)keybuf))
{
std::cout << "startSDK Error\n";
}
}
else
{
std::cout << "startSDK Error\n";
}
}
int main(int argc, char *argv[])
{
hand = LoadLibrary(SDKLOADFILEDLL);
if (NULL == hand || INVALID_HANDLE_VALUE == hand) {
std::cout << "LoadLibrary Error\n";
return -1;
}
//The thread calls the InitSDKStart function to avoid blocking the main thread.
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)InitSDKStart, NULL, 0, NULL);
/*
......
Handle your own business logic here
*/
//When needed, call the end function
endSdk demoDllEnd = (endSdk)GetProcAddress(hand, "stopSDK");
if (demoDllEnd)
{
demoDllEnd();
}
else
{
std::cout << "startSDK Error\n";
}
std::cout << "End SDK Demo!\n";
}
Attention:
1.The suffixes _64 and _386 correspond to 64 bit and 32-bit compilation environments, respectively. Please load the DLL appropriately according to the program compilation environment.
2.The startSDK function blocks execution. Please open a sub thread for execution, otherwise it will block the main thread.
1.CastarSdkWin_ *. dll depends on CastarSdk_ *. dll. When deploying in a production environment, please place both DLLs in a directory that the program can load.
CastarSdk for AndroidOverview2024-11-04
CastarSdk SDK for Android helps you make money with Android apps. You only need to integrate once and reap the benefits easily.
It provides an integration package to support Android applications developed using Java/Kotlin. After 48 hours, you'll see revenue data in your dashboard. This document has a complete integrated solution and takes approximately 45 minutes to complete.Integration optionsSupports:
ARMv7 and ARMv8 architectures;
Android system 4.3+Step 1:Apply for ClientIdGo applications-> Add -> create your ClientId for AndroidStep 2:DownloadSDK for AndroidStep 3:Import SDK Lib
(1).Add the CastarSdk.aar file to your project,put it into App module's libs directory.
(2).Implementation sdk in your app module's build.gradle file.
CastarSdk for IOSOverview2024-11-04CastarSdk SDK for IOS helps you make money with Android apps. You only need to integrate once and reap the benefits easily.
It provides an integration package to support Android applications developed using Objective-C/Swift. After 48 hours, you'll see revenue data in your dashboard.
This document has a complete integrated solution and takes approximately 45 minutes to complete.Integration optionsSupports: iOS 12.0+, Xcode15.3+Step 1:Apply for ClientIdGo applications->Add ,create your ClientId for IOSStep 2:DownloadSDK for iOSStep 3:Install the SDKCopy the unzipped ClientSDK.xcframework and CastarSdk.xcframework files to the project folderStep 4:Set up the SDKSelect the TARGETS > Project Name > General > Frameworks, Libraries, and Embedded Content menus, add the ClientSDK.xcframework file, and set the Embed property to Embed & Sign to keep the SDK dynamic library consistent with the application signature. At this point, the SDK import is complete
(1) Reference the ClientSDK.xcframework,CastarSdk.xcframework file to the project.
(2) Ensure that the Embed option of ClientSDK.xcframework in Frameworks, Libraries, and Embedded Content is set to Embed&Sign.
(3) Add the header file "import ClientSDK" to the referenced files.
(4) Set the ClientId and start the SDK.
Example: Your CliendId is "CSK****FHQlUQZ"
import UIKit
import ClientSDK
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
// Set ClientId
let key = "CSK****FHQlUQZ"
/// Initialize SDK and set key
ClientSDKTool.initSDK(key: key)
// start sdk
ClientSDKTool.start()
// stop sdk
// ClientSDKTool.stop()
}
}
Step 5:SDK API
(1) Start the SDK
// Start the SDK
ClientSDKTool.start()
(2) Stop the SDK when you need to do.
// Stop the SDK
ClientSDKTool.stop()
CastarSdk for Android TVOverview2024-11-04
CastarSdk SDK for Android helps you make money with Android apps. You only need to integrate once and reap the benefits easily.
It provides an integration package to support Android applications developed using Java/Kotlin. After 48 hours, you'll see revenue data in your dashboard. This document has a complete integrated solution and takes approximately 45 minutes to complete.Integration optionsSupports:
ARMv7 and ARMv8 architectures;
Android system 4.3+Step 1:Apply for ClientIdGo applications-> Add -> create your ClientId for AndroidStep 2:DownloadSDK for AndroidStep 3:Import SDK Lib
(1).Add the CastarSdk.aar file to your project,put it into App module's libs directory.
(2).Implementation sdk in your app module's build.gradle file.
CastarSdk for LinuxOverview2024-11-04CastarSdk SDK will helps you make money with Linux apps. You only need to integrate once and reap the benefits easily.
After 48 hours, you'll see revenue data in your dashboard. This document has a complete integrated solution and takes approximately 45 minutes to complete.Integration optionsStep 1:Apply for ClientIdGo applications-> Add -> create your ClientId for Linux.Step 2:DownloadSDK for LinuxStep 3: SDK install
(1) Extract the file to obtain the binary executable program, as follows.
CPU architectures: Executable program
linux/386 : CastarSdk_386
linux/amd64 : CastarSdk_amd64
linux/arm : CastarSdk_arm
(2) Grant the program executable permissions, for example.
chmod +x client_386
or
chmod +x client_amd64
or
chmod +x client_arm
(3) Launch the program
Example:Your CliendId is "CSK****FHQlUQZ"
./client_386 -key=CSK****FHQlUQZ
or
./client_arm -key=CSK****FHQlUQZ
or
./client_amd64 -key=CSK****FHQlUQZ