2

I want to add ads to my aplication via adMob, so I followed this tutorial: https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals?hl=de#play

It says:

// Lookup your LinearLayout assuming it's been given
// the attribute android:id="@+id/mainLayout".

But I have no layouts! Not even a layout folder!

I tried this solution, but it did not work for me: src folder empty on creating new Android project There was allready everything installed and uninstalling and then installing again also didn't work.

I guess it might have something to do with the gradle-project. I created the project with the gdx-setup tool. But I don't know anything about gradle.

I hope someone can help me.

Community
  • 1
  • 1
Tehenauin
  • 23
  • 2
  • Just create one. I had this problem with my drawable folder which I manually created and didn't face any problems with my manually created folder. – kha Oct 31 '14 at 08:52
  • Yes, that would be the last option for me, because then I had also to figure out, how the layout xml-files are built up. And I don't know if there maybe is missing something else. – Tehenauin Oct 31 '14 at 09:04
  • Here this should help you get started. http://www.dynadream.com/ddweb/index.php/Special_Blog?id=20 – Stephan Branczyk Oct 31 '14 at 09:26
  • That sounds reasonable! At least I think you brought me back on right way. In the Link you posted, they are working with the old adMob-sdk, instead of Google play services, I dont know if this makes any difference. – Tehenauin Oct 31 '14 at 09:44
  • @StephanBranczyk libgdx does not use NDK for the layout. It simply creates a GLSurfaceView in Java and sets that as the content view. I would not try using the NDK for this--it will needlessly suck up a lot of your time. Looks like you already found the Google Ads SDK for libgdx tutorial. – Tenfour04 Oct 31 '14 at 12:34

1 Answers1

1

You don't need to create a layout folder you can do it all programatically.

Look at our open source libgdx game for an example:

https://github.com/MapleScotDevelopment/LoggerBill

  • You are right! I used this Tutorial: https://github.com/libgdx/libgdx/wiki/Google-Mobile-Ads-in-Libgdx-%28replaces-deprecated-AdMob%29 But this might be similar, thank you! – Tehenauin Oct 31 '14 at 12:18