Getting Admob 4.1.0 to work

17 views
Skip to first unread message

flitjesdev

unread,
May 27, 2011, 4:19:22 PM5/27/11
to Google AdMob Ads Developers
Hi all,

I'm trying to get Admob 4.1.0 to work but it ist really going well..
I've added the sdk to my project build path.

This is my main.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp"
>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="my_code_will_be_here"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"/>

<TabHost android:id="@+id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content">


<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="110px">

<LinearLayout
android:id="@+id/tab1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/btnSetTime"
android:text="button"></Button>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/tvDate"
android:text="TextView"></TextView><TextView android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/tvStart"></
TextView>

<TextView android:text="TextView" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/tvEnd"></
TextView><TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="TextView"
android:id="@+id/tvTotal"></TextView>

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Break time:"
android:id="@+id/tvBreak"></TextView><EditText android:text="EditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/tbBreakTime"></
EditText>

<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/btnSetBreakTime"
android:text="Set break time"></Button>
</LinearLayout>

<LinearLayout
android:id="@+id/tab2"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0,1,2,3"
android:id="@+id/maintable">

</TableLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="@+id/tab3"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Selected
timesheet:" android:id="@+id/tvSelectedTimesheet"></TextView>
<Spinner android:id="@+id/Spinner01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/
btnDeleteSelectedfile" android:text="Delete Selected timesheet"></
Button>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Create new
timesheet:" android:id="@+id/tvSetNewTimesheet"></TextView>
<EditText android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/tbTimesheet"
android:text=""></EditText>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/btnSave"
android:text="Save"></Button>

</LinearLayout>
</FrameLayout>
</TabHost>

</LinearLayout>

And this is my Manifest xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.flitjes.Timesheet"
android:versionCode="3"
android:versionName="1.3">
<uses-sdk android:minSdkVersion="4" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:icon="@drawable/timesheet"
android:label="@string/app_name">
<activity android:name="com.Timesheet.Timesheet"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />

</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|
orientation"/>
</application>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>


I've tried it this way:
http://blog.kerul.net/2011/05/installing-google-admob-into-android.html

It didn't work for me so i tried it like above and it isn't working
either.
Can any 1 tell me what i'm doing wrong?

Thanks in advance
Message has been deleted

flitjesdev

unread,
May 27, 2011, 5:25:52 PM5/27/11
to Google AdMob Ads Developers
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340)
at org.eclipse.swt.widgets.Table.getSelectionIndex(Table.java:2736)
at
com.android.sdkuilib.internal.widgets.AvdSelector.getTableSelection(AvdSelector.java:
811)
at
com.android.sdkuilib.internal.widgets.AvdSelector.onDetails(AvdSelector.java:
885)
at com.android.sdkuilib.internal.widgets.AvdSelector.access
$500(AvdSelector.java:75)
at com.android.sdkuilib.internal.widgets.AvdSelector
$11.widgetDefaultSelected(AvdSelector.java:702)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:
119)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController
$2.run(Unknown Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:
332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:
115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:
110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:
79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

wes

unread,
May 27, 2011, 6:29:05 PM5/27/11
to google-adm...@googlegroups.com
So, what's the error you're actually getting?  The first one you mentioned "AndroidManifest: Ignoring..." doesn't seem to correspond to the code you actually posted.  The second one just looks like the Eclipse layout plugin dying.  Have you tried actually running the app?  If so, what do the logs say?

Cheers,
Wes
Reply all
Reply to author
Forward
0 new messages