Inserting Admob PreferenceScreen / lwp_settings.xml

Discussion in 'Archive - LWC 2.1' started by Vinicius, Apr 16, 2013.

  1. Vinicius In the know

    Member Since:
    Apr 16, 2013
    Message Count:
    25
    Likes Received:
    7
    Trophy Points:
    25
    Hi I need to insert admob lwp_settings.xml the file,but I'm not getting! Could someone help me!

    I can not insert a LinearLayout inside a PreferenceScreen.

    Help me!

    Sorry my english .. I'm from Brazil ... rsrsrsrsrs


    Insert admob in this file ...




    <?xml version="1.0" encoding="utf-8"?>


    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:key="settings"
    android:title="Settings" >

    <PreferenceCategory
    android:key="main_preference_category"
    android:title="Made with Live Wallpaper Creator :)" >

    <Preference
    android:key="demo_tag"
    android:summary="Get the full version to enable settings such as item speed, direction and hit counters"
    android:title="This is a free version" />

    <CheckBoxPreference
    android:key="hide_items"
    android:summary="Do not display moving items. Only background is visible. Hit Counter is also disabled"
    android:title="Hide Items" />
    <CheckBoxPreference
    android:key="disable_interaction"
    android:summary="Touching moving items has no effect"
    android:title="Disable Interaction" />

    <ListPreference
    android:defaultValue="@string/direction"
    android:entries="@array/direction_entries"
    android:entryValues="@array/direction_values"
    android:key="direction_settings"
    android:summary="Choose direction of moving items"
    android:title="Direction" />
    <ListPreference
    android:defaultValue="slow"
    android:entries="@array/speedNames"
    android:entryValues="@array/speedValues"
    android:key="speed_settings"
    android:summary="Select movement speed of items"
    android:title="Speed" />
    <ListPreference
    android:defaultValue="hide"
    android:entries="@array/counterNames"
    android:entryValues="@array/counterValues"
    android:key="counter_settings"
    android:summary="Display a hit counter in the background"
    android:title="Hit Counter" />
    </PreferenceCategory>

    </PreferenceScreen>

    I tried to put it inside PreferenceScreen , but it did not work! Follow the Code:



    <com.google.ads.AdView android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adUnitId="a151519f7a54ad6"
    ads:adSize="BANNER"
    ads:loadAdOnCreate="true"/>
  2. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
  3. Vinicius In the know

    Member Since:
    Apr 16, 2013
    Message Count:
    25
    Likes Received:
    7
    Trophy Points:
    25
  4. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    You can put banners into settings using the method shown in that link. Maybe I'll do a tutorial on that sometime (so many tutorials piling up for me :eek:)
    If you want to use other advertising methods, there are plenty already discussed here on these forums. Look around in the Advertising Discussion and the Tutorials sections.
  5. Vinicius In the know

    Member Since:
    Apr 16, 2013
    Message Count:
    25
    Likes Received:
    7
    Trophy Points:
    25
    Tank You Vas!

    =D
  6. martha lui New Guy

    Member Since:
    Mar 29, 2015
    Message Count:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Please help me about that i also want ti add admob banner in preference activity. I tried above method but didn't work for me. So please help....

Share This Page