Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Incorporating ads into a canvas  (Read 8531 times)
0 Members and 1 Guest are viewing this topic.
Offline ~Spaceaholic

Senior Devvie

Medals: 3
Projects: 1

« Posted 2011-11-21 21:42:29 »

As some of you may know from other various posts I have made I am nearing completion of my first game for the android platform, all I have left is some minor tweaks and incorporating ads into the game.  I am having a bit of an issue incorporating the ads... my game is drawn using a surfaceview, and all game objects are drawn to a canvas which is then drawn to the screen. The game engine I am using is a modified version of the one available in mario zechners begining android developement.... 

I have imported the necessary jar file from admob and am able to create an AdView, but do not have any idea on how to apply the view to the canvas... the tutorials I have found online including the one available from google all draw the ads using layouts(linear, relative, etc) but I have no layouts defined...

If there is any more information that would help you help me please ask and I will gladly respond as quickly as possible...
Offline turskagames

Senior Newbie

Projects: 2

Awesome games for awesome people

« Reply #1 - Posted 2012-09-25 06:30:36 »

I assume you have solved this somehow since the topic is so old, but I answer anyway if someone else is pondering the same thing. I also use surfaceview in my game and show an ad banner in the bottom of the view. Just define the layout for your game and include your custom view (which draws to the surfaceview) and the adview in the layout. I use RelativeLayout but LinearLayout should work just fine also. So, define something like this:

    android:layout_marginBottom="50dp" />

< android:id="@+id/ad_view"
    android:layout_centerHorizontal="true" />

Awesome games for awesome people
Pages: [1]
  ignore  |  Print  

EgonOlsen (47 views)
2018-06-10 19:43:48

EgonOlsen (29 views)
2018-06-10 19:43:44

EgonOlsen (49 views)
2018-06-10 19:43:20

DesertCoockie (214 views)
2018-05-13 18:23:11

nelsongames (130 views)
2018-04-24 18:15:36

nelsongames (129 views)
2018-04-24 18:14:32

ivj94 (870 views)
2018-03-24 14:47:39

ivj94 (131 views)
2018-03-24 14:46:31

ivj94 (782 views)
2018-03-24 14:43:53

Solater (146 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!