Skip to content

Commit

Permalink
Update mmedia integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruiaraujo committed Nov 14, 2017
1 parent 71c7763 commit 6c41b2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions android/routerKeygen/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>

<application
android:name=".RouterKeygenApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import java.lang.ref.WeakReference;

public class AdsUtils {
private static final String BANNER_APID = "136973";
private static final String CONNECT_APID = "200804";
private static final String STARTUP_APID = "201332";
private static final String BANNER_APID = "bottom_banner";
private static final String CONNECT_APID = "connect";
private static final String STARTUP_APID = "startup";
private static final String CONNECT_LAST_SHOWN_TIME = "CONNECT_LAST_SHOWN_TIME";
private static final String STARTUP_LAST_SHOWN_TIME = "STARTUP_LAST_SHOWN_TIME";
private static final String CONNECT_LAST_SHOWN_COUNT = "CONNECT_LAST_SHOWN_COUNT";
Expand All @@ -35,13 +35,12 @@ private AdsUtils() {

public static void loadAdIfNeeded(final Activity activity) {
final String TAG = activity.getLocalClassName();
final RelativeLayout adRelativeLayout = (RelativeLayout) activity
final RelativeLayout adRelativeLayout = activity
.findViewById(R.id.adBannerRelativeLayout);
if (checkDonation(activity)) {
adRelativeLayout.getLayoutParams().height = 0;
return;
}
MMSDK.initialize(activity);
// Create the adView
try {
final InlineAd inlineAd = InlineAd.createInstance(BANNER_APID, adRelativeLayout);
Expand Down Expand Up @@ -125,7 +124,6 @@ private static void displayInterstitial(final Activity activity,
if (checkDonation(activity)) {
return; // NO ADS!
}
MMSDK.initialize(activity);
final SharedPreferences mPrefs = PreferenceManager
.getDefaultSharedPreferences(activity);
final SharedPreferences.Editor editor = mPrefs.edit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import com.millennialmedia.AppInfo;
import com.millennialmedia.MMSDK;
import com.millennialmedia.UserData;

Expand Down Expand Up @@ -50,6 +51,10 @@ public void onCreate() {
e.printStackTrace();
}
try {
MMSDK.initialize(this);
AppInfo appInfo = new AppInfo();
appInfo.setSiteId("8a8094180153530ea48c1a2d528b0066");
MMSDK.setAppInfo(appInfo);
UserData userData = new UserData().
setEthnicity(UserData.Ethnicity.HISPANIC);
MMSDK.setUserData(userData);
Expand Down

0 comments on commit 6c41b2d

Please sign in to comment.