When writing apps and games using LibGdx you might want to implement some kind of advertisment to monetize your work. While there is quite a few examples on how to implement AdMob for Android, there might be just a few with implementing ads in apps build with LibGdx framework. Since I’m using only AdMob this article will focus only on that.

This post assumes that:

  • You know how to write a LibGdx application (and preferrably have that already)
  • Have AdMob account or have used AdMob

Prologue

When writing with LibGdx you should have at least two projects:

  • main one – where you write your code
  • android – with the android backend and android specific methods
  • desktop – this one is not necessary but helps out debugging a lot
  • (more…)

A NinePatchDrawable graphic is a stretchable bitmap that will get automatically resized by Android to accommodate the contents of the View in which you have placed it as the background. So what does this mean exactly? It means you can create custom styled controls or containers simply and without worrying about some of the problems that you might encounter without it.

(more…)

Bootstrap header

I have been looking for a good-looking and easy to use CSS framework for a long time. Ideal candidate would just hook up to my existing page and that would have been the end of my work. Unfortunately it is not that easy but Bootstrap comes pretty close.

Bootstrap

Bootstrap was launched in August 2011 and since then made a quite of an impact on the web community. The framework developed by engineers behind Tweeter has a smooth, professional look and enables to rapidly build a web application that is also compatible throughout all major browsers. And it’s a great base for all of your projects.

 

Bootstrap 2.0 is based on 12 column grid responsive system that by default stands for 940px width. This is a change in version 2.0 from the 16 column layout that was originally introduced and while it’s less it is still quite enough. The 940px might seem a bit low in today’s world of large LCD screens but responsive design will let you expand the default width up to 1210px or shrink it for lower resolutions. You’ll be able to fit your page into mobile screens!

(more…)

Just worked out why the page was screwed up in IE9 while working just fine in IE8. What was more troubling was the fact that bootstrap’s page was working just fine in what seemed the same conditions. What shocked me this morning was the fact that the same page working on the remote server (as opposed to my debuggin one) was working fine as well. Same code – same browser – different appearence.
Turns out at some point I must have clicked the “Compatibility View” in IE9. This setting is not global but configured per host. And i seem to have clicked it on localhost. Only by debugging javascript I have come upon the warning saying that. I was even beginning to think this was specific to server setting – which was very silly.
All in all not sure why this button even exist. It’s not like it makes the page display in the way IE6 would render it. I’ve checked under win7 xp mode and it looks nothing like it – under real IE6 is just gibberish as expected. I might read on a bit later about this “Compatibility View” but I doubt – I’ll just steer away from pressing it EVER.

simpleaccordionjQuery’s accordion just didn’t want to work with my page layout. And it brought it’s own styles wich was not something that fit my needs. So to deal with this I had to come up with my own accordion script – as simple as possible!

So to start. First will have to add new function to fn property of jQuery object:

$.fn.accordion = function(){
   //body will go here
}

Then lets add some rolling in and rolling out code:

(more…)