Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #LD48 | #ludumdare on irc.afternet.org (Info)

Ludum Dare 31 — Coming December 5th-8th 2014! — Join the Mailing List!
  • Ludum Dare 31 begins: in 80 days, 5 hours, 31 minutes, 15 seconds
  • (Time might be off, we’ll have it right soon)


    October Project – Pen Study is Ready to Make Money. Are you?

    Posted by (twitter: @LanceNanek)
    October 11th, 2012 2:40 pm

    Pen Study, a fun app with language learning tidbits and mini-games to grow your brain that I write and blog about with Chloe, just entered the Ludum Dare October Project to be ready to earn our first dollar. Are you ready to earn your first dollar? Check out our implementation below.

    For this challenge I went with integrating a single ad banner on the menu screen, not the game modes themselves. You can see it at the bottom of this screenshot:

    The ad and falling facts game mode.

    Screenshots of the app showing fun characters helping the player trace letters.

    The tracing game mode.

    For high traffic games I use a much more complex solution involving multiple ad providers in AdWhirl and with their own specific integrations. Shout outs go to Millennial Media for paying the most for banner ads so far outside of deals arranged in person, and AppFlood for bringing in the most installs!

    This dare is about easily getting unfinished games and challenge entries making money, so here comes a simple single integration with an ad provider I’ve never tried before. Here is an Android layout with the banner:

    [stextbox id="grey"]

    <LinearLayout xmlns:a=”http://schemas.android.com/apk/res/android”
    a:layout_width=”match_parent”
    a:layout_height=”match_parent”
    a:orientation=”vertical”
    a:gravity=”center”
    a:background=”#cccccc”
    >

    <!– Other content goes here. –>

    <com.sec.android.ad.AdHubView a:id=”@+id/AdLayout”
    a:layout_width=”wrap_content”
    a:layout_height=”wrap_content”
    a:layout_gravity=”center”
    a:visibility=”gone”
    a:paddingTop=”10dp”
    a:paddingBottom=”10dp”
    />
    </LinearLayout>

    [/stextbox]

    And here is the code that initializes it.

    [stextbox id="grey"]

    public class SelectLessonActivity extends DelegatingActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frame);

    final AdHubView adhubView = (AdHubView) callingActivity.findViewById(R.id.AdLayout);
    adhubView.setVisibility(View.VISIBLE);
    adhubView.init(this, Constants.ADHUB_INVENTORY_ID, AdSize.BANNER
    adhubView.setThreadPriority(AdHubView.MIN_PRIORITY);
    adhubView.startAd();
    }
    }

    [/stextbox]

    Make sure you have the needed permissions in your AndroidManifest.xml:

    [stextbox id="grey"]<uses-permission android:name=”android.permission.INTERNET” />
    <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” />
    <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” /> [/stextbox]

    And that you have the JAR in your libs:

    A list of JARs in the source code tree.

    App libraries.

    Coding done! Getting real ads was a little difficult with this provider. I had to post to a market first, then wait for the approval process, and also wait for banking information to be approved. Some other providers let you get going immediately and sort it out later. I did like being able to pick categories of ads that match the app demographic, kids and education games:

    A list of categories with checkboxes for what ads to show on an ad network site.

    Choosing what type of ads to show.

    I feel people will be more likely to click a targeted ad and it has a better chance to be useful and not annoying to them. A targeting method common with other ad providers is specifying keywords. That might be more flexible and powerful. If the ad provider ads a new category, my keywords might match that already, for example. Or they might use smarter algorithms enabled by keywords.

    Hope this helps your own projects! Check out Pen Study to feed your brain between coding. :)

    Tags: , , , , , , , ,

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]