Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I currently have a free Android application which exists quite happily on the Android market. The problem is that it does not make any money.

Can someone tell me how to put some advertising into the application so that I can capitalise on my hard work and investment in Android.

Thanks in advance

Pie Eater
Posted
Comments
fjdiewornncalwe 19-Nov-10 15:08pm    
If your application is useful and in demand, you should charge a nominal fee for it. Charging a dollar or two for an app actually causes many people to look at the application as more "legitimate" and at a nominal price, they will pay. Volume is the name of the game. Advertising embedded into the application will likely just get you bad feedback and people won't even look at this or any other app you create in the future. ( This is entirely my personal opinion... :) )

1 solution

The question is what your advertising looks like? Let's suppose you want to download some new info to be shown from web. To read text you can use something like:
InputStream is = null;
try {
    is = OpenHttpConnection(URL);
    InputStreamReader isr = new InputStreamReader(is);
    int read;
    String str = "";
    char[] ib = new char[1024];

   while ((read = isr.read(ib))>0)
   {
     String string =
     String.copyValueOf(ib, 0, read);
     str += string;
     ib = new char[1024];
  }
   in.close();
} catch (Exception e) {
}


For images BitmapFactory has decodeStream method.
And finally use Toast to show your ads. It can be quite complicated, if you provide corresponding layout for it. Design your layout to have all info needed and show the toast:

Toast toast = new Toast(getApplicationContext());
toast.setGarvity(Gravity.LEFT | Gravity.BOTTOM, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
toast.show();
 
Share this answer
 
Comments
Dalek Dave 22-Nov-10 4:21am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900