Java Code Examples for com.google.android.gms.ads.mediation.admob.AdMobExtras

The following are top voted examples for showing how to use com.google.android.gms.ads.mediation.admob.AdMobExtras. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: QuizUpWinner   File: v.java   View source code 5 votes vote down vote up
public v(Context paramContext, af paramaf)
{
  this.versionCode = 2;
  Date localDate = paramaf.getBirthday();
  long l;
  if (localDate != null)
    l = localDate.getTime();
  else
    l = -1L;
  this.ex = l;
  this.ey = paramaf.getGender();
  Set localSet = paramaf.getKeywords();
  List localList;
  if (!localSet.isEmpty())
    localList = Collections.unmodifiableList(new ArrayList(localSet));
  else
    localList = null;
  this.ez = localList;
  this.eA = paramaf.isTestDevice(paramContext);
  this.tagForChildDirectedTreatment = paramaf.S();
  this.eE = paramaf.getLocation();
  AdMobExtras localAdMobExtras = (AdMobExtras)paramaf.getNetworkExtras(AdMobExtras.class);
  Bundle localBundle;
  if (localAdMobExtras != null)
    localBundle = localAdMobExtras.getExtras();
  else
    localBundle = null;
  this.extras = localBundle;
  this.eB = paramaf.getManualImpressionsEnabled();
  this.eC = paramaf.getPublisherProvidedId();
  SearchAdRequest localSearchAdRequest = paramaf.Q();
  ai localai;
  if (localSearchAdRequest != null)
    localai = new ai(localSearchAdRequest);
  else
    localai = null;
  this.eD = localai;
}
 
Example 2
Project: Commandr-Android   File: VotingActivity.java   View source code 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.voting);
    setupActionBar();
    AdView adView = (AdView) this.findViewById(R.id.adView);
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("ads", true)) {
        adView.setVisibility(View.VISIBLE);
        Bundle bundle = new Bundle();
        bundle.putString("color_bg", "4285f4");
        bundle.putString("color_bg_top", "4285f4");
        bundle.putString("color_border", "4285f4");
        bundle.putString("color_link", "EEEEEE");
        bundle.putString("color_text", "FFFFFF");
        bundle.putString("color_url", "EEEEEE");
        AdMobExtras extras = new AdMobExtras(bundle);
        AdRequest adRequest = new AdRequest.Builder().addTestDevice("E9439BFF2245E1BC1DD0FDB28EA467F9").addTestDevice("49924C4BF3738C69A7497A524D092901").addNetworkExtras(extras).build();
        adView.loadAd(adRequest);
    } else {
        adView.setVisibility(View.GONE);
    }

    progress = (ProgressBar) findViewById(R.id.progressBar);

    Parse.initialize(this, "giwroIjJIvqQCpTB23LsdDYe8HdHCxZwy0fkKksV", "H98VqurfJTM4J05D8Fmht3VyXdbTCb5ghBf8Jkjc");

    ((FloatingActionButton)findViewById(R.id.suggest)).attachToListView(((AbsListView)findViewById(R.id.card_list_view)));

}
 
Example 3
Project: Commandr-Android   File: MostWantedCommandsActivity.java   View source code 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.most_wanted);
    setupActionBar();
    AdView adView = (AdView) this.findViewById(R.id.adView);
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("ads", true)) {
        adView.setVisibility(View.VISIBLE);
        Bundle bundle = new Bundle();
        bundle.putString("color_bg", "4285f4");
        bundle.putString("color_bg_top", "4285f4");
        bundle.putString("color_border", "4285f4");
        bundle.putString("color_link", "EEEEEE");
        bundle.putString("color_text", "FFFFFF");
        bundle.putString("color_url", "EEEEEE");
        AdMobExtras extras = new AdMobExtras(bundle);
        AdRequest adRequest = new AdRequest.Builder().addTestDevice("E9439BFF2245E1BC1DD0FDB28EA467F9").addTestDevice("49924C4BF3738C69A7497A524D092901").addNetworkExtras(extras).build();
        adView.loadAd(adRequest);
    } else {
        adView.setVisibility(View.GONE);
    }

    ArrayList<Card> cards = new ArrayList<Card>();
    for (MostWantedCommand command : MostWantedCommands.getCommands(this)) {
        cards.add(new MostWantedCard(this, command));
    }
    CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(this, cards);
    final CardGridView listView = (CardGridView) findViewById(R.id.card_list_view);
    ((FloatingActionButton)findViewById(R.id.vote)).attachToListView(listView);
    SwingBottomInAnimationAdapter animCardArrayAdapter = new SwingBottomInAnimationAdapter(mCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(listView);
    listView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
    findViewById(R.id.vote).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(MostWantedCommandsActivity.this, VotingActivity.class));
        }
    });
}
 
Example 4
Project: jumplings   File: AdsHelper.java   View source code 5 votes vote down vote up
public static void requestAd(AdView adView) {
    Bundle bundle = new Bundle();
    AdMobExtras extras = new AdMobExtras(bundle);
    AdRequest adRequest = new AdRequest.Builder().addNetworkExtras(extras)
                                                 .build();

    adView.loadAd(adRequest);
}
 
Example 5
Project: mobile-sdk-android   File: GooglePlayDFPBanner.java   View source code 5 votes vote down vote up
private PublisherAdRequest buildRequest(DFBBannerSSParameters ssparm, TargetingParameters targetingParameters) {
    PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
    if ((ssparm.test_device != null) && (ssparm.test_device.length() > 0)) {
        adListener.printToClog("test device " + ssparm.test_device);
        builder.addTestDevice(ssparm.test_device);
    }

    switch (targetingParameters.getGender()) {
        case UNKNOWN:
            builder.setGender(PublisherAdRequest.GENDER_UNKNOWN);
            break;
        case FEMALE:
            builder.setGender(PublisherAdRequest.GENDER_FEMALE);
            break;
        case MALE:
            builder.setGender(PublisherAdRequest.GENDER_MALE);
            break;
    }

    Bundle bundle = new Bundle();

    if (targetingParameters.getAge() != null) {
        bundle.putString("Age", targetingParameters.getAge());
    }
    if (targetingParameters.getLocation() != null) {
        builder.setLocation(targetingParameters.getLocation());
    }
    for (Pair<String, String> p : targetingParameters.getCustomKeywords()) {
        bundle.putString(p.first, p.second);
    }

    builder.addNetworkExtras(new AdMobExtras(bundle));

    return builder.build();
}
 
Example 6
Project: mobile-sdk-android   File: GooglePlayDFPInterstitial.java   View source code 5 votes vote down vote up
private PublisherAdRequest buildRequest(TargetingParameters targetingParameters) {
    PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
    switch (targetingParameters.getGender()) {
        case UNKNOWN:
            builder.setGender(PublisherAdRequest.GENDER_UNKNOWN);
            break;
        case FEMALE:
            builder.setGender(PublisherAdRequest.GENDER_FEMALE);
            break;
        case MALE:
            builder.setGender(PublisherAdRequest.GENDER_MALE);
            break;
    }

    Bundle bundle = new Bundle();

    if (targetingParameters.getAge() != null) {
        bundle.putString("Age", targetingParameters.getAge());
    }
    if (targetingParameters.getLocation() != null) {
        builder.setLocation(targetingParameters.getLocation());
    }
    for (Pair<String, String> p : targetingParameters.getCustomKeywords()) {
        bundle.putString(p.first, p.second);
    }

    builder.addNetworkExtras(new AdMobExtras(bundle));

    return builder.build();
}
 
Example 7
Project: mobile-sdk-android   File: GooglePlayServicesInterstitial.java   View source code 5 votes vote down vote up
private AdRequest buildRequest(TargetingParameters targetingParameters) {
    AdRequest.Builder builder = new AdRequest.Builder();

    switch (targetingParameters.getGender()) {
        case UNKNOWN:
            builder.setGender(AdRequest.GENDER_UNKNOWN);
            break;
        case FEMALE:
            builder.setGender(AdRequest.GENDER_FEMALE);
            break;
        case MALE:
            builder.setGender(AdRequest.GENDER_MALE);
            break;
    }

    Bundle bundle = new Bundle();

    if (targetingParameters.getAge() != null) {
        bundle.putString("Age", targetingParameters.getAge());
    }
    if (targetingParameters.getLocation() != null) {
        builder.setLocation(targetingParameters.getLocation());
    }
    for (Pair<String, String> p : targetingParameters.getCustomKeywords()) {
        bundle.putString(p.first, p.second);
    }

    builder.addNetworkExtras(new AdMobExtras(bundle));

    return builder.build();
}
 
Example 8
Project: QuizUpWinner   File: AdMobAdapter.java   View source code 4 votes vote down vote up
public final Class<AdMobExtras> ˋ()
{
  return AdMobExtras.class;
}
 
Example 9
Project: Commandr-Android   File: MainActivity.java   View source code 4 votes vote down vote up
/**
 * Called when the activity is created, add the Settings fragment.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Crashlytics.start(this);

    if (!PreferenceManager.getDefaultSharedPreferences(this).getBoolean("setup", false)) {
        Intent i = new Intent(this, SetupActivity.class);
        startActivity(i);
        finish();
    }
    WearUtil.updateCommandList(this);

    setContentView(R.layout.main);
    // Look up the AdView as a resource and load a request.
    AdView adView = (AdView) this.findViewById(R.id.adView);
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("ads", true)) {
        adView.setVisibility(View.VISIBLE);
        Bundle bundle = new Bundle();
        bundle.putString("color_bg", "4285f4");
        bundle.putString("color_bg_top", "4285f4");
        bundle.putString("color_border", "4285f4");
        bundle.putString("color_link", "EEEEEE");
        bundle.putString("color_text", "FFFFFF");
        bundle.putString("color_url", "EEEEEE");
        AdMobExtras extras = new AdMobExtras(bundle);
        AdRequest adRequest = new AdRequest.Builder().addTestDevice("E9439BFF2245E1BC1DD0FDB28EA467F9").addTestDevice("49924C4BF3738C69A7497A524D092901").addNetworkExtras(extras).build();
        adView.loadAd(adRequest);
    } else {
        adView.setVisibility(View.GONE);
    }
    // Create new fragment and transaction
    if (savedInstanceState == null) {
        SettingsFragment newFragment = new SettingsFragment();
        FragmentTransaction transaction = getFragmentManager().beginTransaction();

        // Replace whatever is in the fragment_container view with this fragment,
        // and add the transaction to the back stack

        transaction.add(R.id.fragment_container, newFragment);

        // Commit the transaction
        transaction.commit();
    }
    if (checkPlayServices()) {
        gcm = GoogleCloudMessaging.getInstance(this);
        regid = getRegistrationId(this);

        if (regid.isEmpty()) {
            registerInBackground();
        }
    } else {

    }

}