Skip to content

Settings

awallace87 edited this page Aug 23, 2016 · 1 revision

Additional SDK Settings

Location

In order to provide location targeted ads, the Yieldmo Android SDK is capable of leveraging the location permissions of the publishers application.

By default, the SDK will not include a location in ad requests. The publisher has two methods to enable location data to be included in ad requests:

Enable Location Permissions

If your application already has permission to obtain the device location, i.e. enabled in the AndroidManifest.xml like so:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.yieldmo.demo">
    ...
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    ...
</manifest>

By default, the SDK will not leverage these application permissions to gain the device location. Instead, the publisher has to explicitly grant us permission in order to automatically retrieve the device location. That is done through the following code:

Yieldmo.setLocationPermissionEnabled(true);

When enabled, the Yieldmo SDK will fetch location data through whatever permissions have been granted to the application on subsequent ad requests.

Set Location

As an alternative, a publisher is also able to pass a direct Location object to the Yieldmo SDK. This is done as follows:

Yieldmo.setLocation(Location location);

Afterwards, any ad requests will include the details of location

Logging

The Yieldmo SDK uses Android's Logging Framework, to send system logs related to the SDK's functioning.

To enable logging:

YMLogger.setLogLevel(YMLogger.LogLevel.Verbose);

Supported Log Levels

  • YMLogger.LogLevel.None (Default Level)
  • YMLogger.LogLevel.Error
  • YMLogger.LogLevel.Warn
  • YMLogger.LogLevel.Info
  • YMLogger.LogLevel.Debug
  • YMLogger.LogLevel.Verbose

Manifest Settings

While there are direct Java APIs for configuring the Yieldmo SDK, some of these settings can be set via the application's AndroidManifest.xml through custom Manifest tags.

Custom tags

Using <meta-data> tags in the AndroidManifest.xml file of the application, the following settings can be configured (Instructions for using meta-data in the application manifest):

SDK Settings

  • <meta-data android:name="com.yieldmo.sdk.locationPermissionEnabled" android:value="Boolean"/>: This tag will set whether the Yieldmo SDK has permission to retrieve location data automatically. true = enabled, false = disabled
  • <meta-data android:name="com.yieldmo.sdk.loggingEnabled" android:value="Boolean"/>: This tag will set the log level based on the Boolean value. true = Info, false = None

MRAID Native Features

  • <meta-data android:name="com.yieldmo.sdk.supportsSMS" android:value="Boolean"/>: This tag will set whether MRAID SMS ads should be supported
  • <meta-data android:name="com.yieldmo.sdk.supportsTel" android:value="Boolean"/>: This tag will set whether MRAID Telephone ads should be supported
  • <meta-data android:name="com.yieldmo.sdk.supportsCalendar" android:value="Boolean"/>: This tag will set whether MRAID Calendar ads should be supported
  • <meta-data android:name="com.yieldmo.sdk.supportsStorePicture" android:value="Boolean"/>: This tag will set whether MRAID Picture ads should be supported

Android-SDK-Beta

  • Home
  • [Key Terms](Key Terms)

Start Here


  • [Listening for Ad Events](Listening for Ad Events)
  • Additional Settings
  • [Page View](Page View)
  • [Custom Content Frame](Content Frame)
  • Proguard

Have a previous SDK?

  • [Upgrade Guide](Upgrade Guide)

Clone this wiki locally