How to pass Textfield value to view controller through button click in Swift UI

Here is a little sample. Like I said I don’t have Google Ads in anything right now but it should be straightforward import SwiftUI struct TestAdsView: View { @StateObject var vm: AdsScreenViewModel = AdsScreenViewModel() var body: some View { VStack{ Text(vm.adStatus.rawValue) TextField(“adId”, text: $vm.adUnitId) Button(“load Ads”, action: { vm.loadAds() }) //You might have to play … Read more

Why are permissions being automatically added to my AndroidManifest when including Google Play Services library

When you use compile ‘com.google.android.gms:play-services:7.5.0’ This implies you are using every feature of Google Play Services, including location services. If you only need a particular API, you should be using the selective APIs. In the case of ads, you can use solely: compile ‘com.google.android.gms:play-services-ads:7.5.0’

Admob Error in Eclipse for android:configChanges

Easy solution: (and NO you don’t need to to change the min-sdk value !!) Step 1: Change “project.properties” file # Project target. target=android-13 Step 2: In Eclipse Project > Clean… > (select your project) > Clean projects selected below > OK For a complete explanation with real example use this tutorial http://www.monkeycoder.co.nz/Community/posts.php?topic=1121 Cheers !

How can I get device ID for Admob

The accepted answers will work if you are only testing on the Emulator or on a few devices, but if you are testing on a plethora of devices, you may need some means of prorammatically adding the running device’s device ID. The following code will make the current running device into an adview test device … Read more

Embedding ads within Recyclerview

In your adapter, you first need to override getItemViewType, for example: @Override public int getItemViewType(int position) { if (position % 5 == 0) return AD_TYPE; return CONTENT_TYPE; } Then in onCreateViewHolder, inflate a different view according to the type. Something like this: @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { View v = null; if … Read more