question

kinew avatar image
kinew asked

How to add ads in a PreferenceActivity of android app?

I am developing a small app with a PreferenceActivity and some Services. I try to add ads in the PreferenceActivity, but can not let it work. I have tried the official quick start guide https://developer.amazon.com/sdk/mobileads/quick-start.html and some methods in stackoverflow http://stackoverflow.com/questions/5019834/android-admob-advert-in-preferenceactivity Help!
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
You can add ads in the preference Activity, you can use setListFooter(AdView) to set the AdLayout in the PreferenceActivity by implementing AdListener
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kdjstudios avatar image
kdjstudios answered
How would you go about this? I am confused on where to implement this line of code?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
You can refer below two links http://developer.android.com/reference/android/preference/PreferenceActivity.html https://developer.amazon.com/public/apis/earn/mobile-ads/docs/quick-start (Add the Amazon Ad Layout to Your App) Of course, the built-in classes don't accommodate every need and your application might require something more specialized. You can create preference , the basic Preference UI building block displayed by a PreferenceActivity in the form of a ListView. This class provides the View to be displayed in the activity and associates with a SharedPreferences to store/retrieve the preference data. 1)Create a class called AmazonAd Preference 2)In the UI xml [b] [/b] Basically you are creating a custom preference to use in the PreferenceScreen
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.