This section explains the steps to integrate the now.gg Utility module with your development environment.
To get started, download the now.gg SDK download package that contains the now.gg Utility module and add it to your development environment.
1. Extract the compressed now.gg Utility module and locate the .aar file in the package:
Utility.aar
2. Add the following dependency to the build.gradle
file of your game:
dependencies { implementation fileTree(dir: 'libs', include: ['*.aar']) }
Once the module has been successfully imported, you can now use the now.gg Utility Module.
The Utility module includes the following methods:
The getDeviceType()
method lets you detect the user’s device type.
The device types include:
To get the device type, call the getDeviceType()
method, as illustrated below:
DeviceType deviceType = UtilitySDK.getInstance().getDeviceType(applicationContext);
Reference – You can refer to the getDeviceType reference here.
The openUrl()
method lets you open a URL in a new browser window of the user’s device. The following sample code illustrates this implementation.
UtilitySDK.getInstance().openUrl("<your_url_here>", activityObject);
Reference – You can refer to the openUrl() reference here.
The isRunningOnNowGG()
method enables you to identify if your application is running on the now.gg platform or not. The following sample code illustrates this implementation:
UtilitySDK.getInstance().isRunningOnNowGG(applicationContext)
true
, If the application is running on now.gg.Reference – You can refer to the isRunningOnNowGG() reference here.
Utility Module
Utility Module
Document Rev. 1.0