Admob
How to integrate admob in android applications:
First download admob-sdk-android.jar and copy to libs, then add jar

in values create attrs.xml and put this:
<?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="com.admob.android.ads.AdView"> <attr name="backgroundColor" format="color" /> <attr name="primaryTextColor" format="color" /> <attr name="secondaryTextColor" format="color" /> <attr name="keywords" format="string" /> <attr name="refreshInterval" format="integer" /> </declare-styleable> </resources>
in main.xml add/change red lines:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myapp="http://schemas.android.com/apk/res/com.linuxmobile.android.deepmix" android:layout_centerHorizontal="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/logo"> <ListView android:id="@+id/myListView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#000000" /> <com.admob.android.ads.AdView android:id="@+id/ad" android:layout_width="fill_parent" android:layout_height="wrap_content" myapp:backgroundColor="#000000" myapp:primaryTextColor="#FFFFFF" myapp:secondaryTextColor="#CCCCCC" android:layout_alignParentBottom="true" /> </RelativeLayout>
and the last in AndroidManifest.xml add/change red lines
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.linuxmobile.android.deepmix"
package="com.linuxmobile.android.deepmix"
android:versionName="1.02" android:versionCode="3">
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:debuggable="false">
<activity android:name=".DeepMixMoscowRadio"
android:screenOrientation="portrait"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- The application's publisher ID assigned by AdMob -->
<meta-data android:value="a14d810dedaa074" android:name="ADMOB_PUBLISHER_ID" />
<!-- AdMobActivity definition -->
<activity android:name="com.admob.android.ads.AdMobActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard|keyboardHidden" />
<!-- Track Market installs -->
<receiver android:name="com.admob.android.ads.analytics.InstallReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="8"></uses-sdk>
</manifest>
green is your admob application ID!

RSS Feed
Twitter

