HowTo: Implementing Ads and links in AI

2,394 views
Skip to first unread message

M. Hossein Amerkashi

unread,
Jun 16, 2011, 10:41:01 AM6/16/11
to appto...@googlegroups.com
See attached for an approach to implement Ads in App Inventor.


M. Hossein Amerkashi
http://Amerkashi.Wordpress.com
Hossein-AdDemoDesigner.jpg
Hossein-AdDemoBlocks.jpg
Message has been deleted

M. Hossein Amerkashi

unread,
Jun 17, 2011, 3:08:38 PM6/17/11
to appto...@googlegroups.com
Please note that I have actually consolidated 2 apps into 1 so that I can show everything in one place.

In reality, it should be broken down into 2 as follows:
1. App1 would be an admin app that is used for managing ad campaigns
2. App2 would be an app that gets published to Market

Using the admin app, once you make update to your ads, all users-devices that has your app installed, App2 the one that utilizes ads, will display the updated ads. See attached file. It shows what needs to be moved to Admin app. I also have crossed-out the blocks that are not really needed and are there just for demo purpose.


You can download APK or SOURCE to your computer from HERE or download apk directly onto your phone using QR by going HERE

Hope this helps,
Hossein-AdDemoBlocks2.jpg

Mike McGill

unread,
Jun 18, 2011, 3:53:56 PM6/18/11
to appto...@googlegroups.com
On Friday, June 17, 2011 7:31:34 PM UTC-4, DR_MCGILL wrote:
ok a few questions on my part...I wish you didnt have to hold my hand through all of this, but hopefully it will help other noobs down the line as well..

how do i tie my app into this?? (And I am assuming i have to tie it to the pic u listed AdDemoBlocks3.jpg)(which is also the one i believe needs published-app2)

Do i just create it in the app you listed for dload on your site? (the zip file dload)

Do we need to worry about the properties for the activitystarter1?  And do we need to worry about the serviceURL for the tinywebdb1?

Also, confused on how unpublished app1 communicates with app2 to send new add info...

thank you again so much for help, this is very much fun to learn...I hope i can update my app with this add stuff asap!

Mike McGill

unread,
Jun 18, 2011, 3:54:00 PM6/18/11
to appto...@googlegroups.com

M. Hossein Amerkashi

unread,
Jun 18, 2011, 5:30:43 PM6/18/11
to appto...@googlegroups.com
Mike, For clarification, I broke it down into 2 apps:
1. admin app - this is the app that does not get published and we can use to create ad campaigns
2. user app - this is the app that gets published to market.

admin app - Its only purpose is to store ads. We provide it a tag and list of ads. Each ad has 2 parts:
1st part contains the url to image
2nd part contains the hyperlink

user app
On init, it retrieves that ads that were stored in admin app. Once retrieved, it stores into a list. Once you start timer, every 5 second, it randomly selects an item (image and its hyperlink) and stores into local vars. Please note that in real app, you don't really need a timer button. This is just for demo purpose and you can remove it. If you remove, then in screen init, just start up the timer.

I left a notifier in selectRandomImage to show that its invoked. The reason I left it in there is to show that once ads are rotating, if user clicks on ad button, the timer still is firing. This could cause issues when user clicks HOME button on his device.

ToDo:
I did not add in validation. There should be a validation in selectRandomImage to ensure that list is not empty.


Hope this helps.

-Hossein.
adminAppBlocks.png
userAppToPublish.png

M. Hossein Amerkashi

unread,
Jun 18, 2011, 5:31:32 PM6/18/11
to appto...@googlegroups.com
Forgot to mention that I will post the both sources (admin and user apps) by tomorrow.

-Hossein

Maverick

unread,
Jul 2, 2011, 8:44:46 PM7/2/11
to appto...@googlegroups.com
Hello Hossein,

I see your list for the Ads lets me put in 3 ads.  What if I wanted to put in 6 different ads?  What do I need to do differently?

Please let me know.

Thanks,
Mark

M. Hossein Amerkashi

unread,
Jul 2, 2011, 10:39:05 PM7/2/11
to appto...@googlegroups.com
Maverick,
The way I have it setup you can add as many ads as you want. For demo purpose, I just used 3. Add as as many as you want.

-Hossein.

Markus Olszewski

unread,
Jul 9, 2011, 11:25:47 AM7/9/11
to appto...@googlegroups.com
Hey, thanks a lot for that tutorial. Is there a way to disable the ad if the phone is not connected to 3g or WiFi because it causes a crash if there is no internet and you launch the app. Thanks a lot :)

M. Hossein Amerkashi

unread,
Jul 9, 2011, 12:13:49 PM7/9/11
to appto...@googlegroups.com

Markus Olszewski

unread,
Jul 10, 2011, 8:23:47 AM7/10/11
to appto...@googlegroups.com
After I updated the URL's once the updater stopped working :( Do you have any idea why ? I changed the TinyWebDB tag to a different one later but with no result.

M. Hossein Amerkashi

unread,
Jul 10, 2011, 9:13:42 AM7/10/11
to appto...@googlegroups.com
Did you use double pipe sign (||) to to separate image and link? Can you post block for us?

Hossein

Markus Olszewski

unread,
Jul 10, 2011, 9:18:28 AM7/10/11
to AppToMarket
Yes, I have followed every thing that you put on the screen shots. I
just removed the two notifiers as they were pointless. I can post my
blocks in like 3 mins .

Mark Allen

unread,
Jul 12, 2011, 11:23:44 PM7/12/11
to appto...@googlegroups.com
Yea, I think I got the same problem.  It looks like whenever my phone does not have internet access (for whatever reason) the adds will not load & the following ERROR message displays on the App:  Bad arguments to pick random item - The operation pick random item cannot accept the arguments: text  - End Application

Then, it forces the app to close.  I tested the theory that the lack of internet access is causing this by turning the phone on Airplane mode (I have a Sprint EVO 4G) & I also tested the app while driving around this week in my car.  The issue above happens about 20% of the time when I start the App.

So, Hossein, do you know any way we can write a condition into the "pick random item" block that will disable the ad feature (slideshow) if no internet (3g, 4G, WiFi) connection available?

I read the issue that you pointed us to & I did not see any specific mention on either how this issue is fixed nor how (specifically) for us to fix it.

Please let us know!

Thanks Hossein!

Maverick

Mark Allen

unread,
Jul 12, 2011, 11:28:10 PM7/12/11
to appto...@googlegroups.com
Yea, I had the same exact problem too.

I eventually gave up on using the "Manage Ads" APP to update the web service & simply went straight to the web service to enter in the URLs manually.

http://tinywebdb.appspot.com/


M. Hossein Amerkashi

unread,
Jul 12, 2011, 11:36:28 PM7/12/11
to appto...@googlegroups.com
Yes, I do know of a solution:

Put in a Web component and set its URL to like http://www.google.com  or something

Then drop a Screen1.ErrorOccured to overwrite the default AI error handling
In there put in a IF condition to see if error = 1101. If that's the case, that means NO INTERNET. This is where you should disable the timer.

Let me know if that helps you out.

Hossein

Mark Allen

unread,
Jul 13, 2011, 12:28:22 AM7/13/11
to appto...@googlegroups.com


Is this what you are describing?

Let me know if any changes need to be made to these blocks or if it should be good to go as is.

Mark Allen

unread,
Jul 13, 2011, 12:29:30 AM7/13/11
to appto...@googlegroups.com
Screen1.ErrorOccured.docx

M. Hossein Amerkashi

unread,
Jul 13, 2011, 9:16:01 AM7/13/11
to appto...@googlegroups.com
Looks right. Just make sure you are using equal sign in your condition. It looks like a minus.

Also, don't forget that you actually have to do Web1.GET ofter you set its URL

Give that a try, set your phone to airplane mode, give it a try and let us know how it goes.

-Hossein.

Mark Allen

unread,
Jul 14, 2011, 1:54:40 AM7/14/11
to appto...@googlegroups.com
Wow, brilliant again Hossein!

Your suggestion worked.  I put the Web1.GET into my Screen 1 initialize & it prevented the timer from taking effect while in airplane mode.

Looks like the App is now error free.

Thanks again for your help with this!

Maverick

M. Hossein Amerkashi

unread,
Jul 14, 2011, 10:13:33 AM7/14/11
to appto...@googlegroups.com
Great. Glad to be of help.

Here is a challenge and if you implement, please post blocks here.

This current approach is good when app starts because it just checks to see if there is signal or not and if not it stops the ad-timer. What would happen if initially phone has signal, but later looses? This will cause same issue again.

What I can think of is to have a 2nd timer that keeps like every 10 sec or so to see if there is signal or not (using web approach we discussed before). In there, if no signal, set ad-timer off else on. What do you think? I don't really have time right now to work on this. Can you give it a try and see how it goes and if you get it working post block for others?

Hossein.

Mark Allen

unread,
Jul 15, 2011, 4:13:37 PM7/15/11
to appto...@googlegroups.com
Hossein,
 
Yes, I see your point.  I too realized what you are describing.  At my office we have WiFi & my EVO is hooked up to the company router.  The phone also gets 4G & 3G signals as well.  When I sit at one of our developer's desk, I am far away from the wireless router & I tired the App & it started up while on the router, then lost signal, & caused the error before the phone had time to switch over to 3G or 4G cell phone signal.
 
Anyway, I know exactly what you are asking me to try with the blocks editor & I will take a stab at the solution that you have proposed over the weekend.  I will keep you posted once I get it figured out & I will post a picture of my blocks once the solution is in place.
 
Thanks,
Mark

Mark Allen

unread,
Jul 23, 2011, 1:35:50 AM7/23/11
to appto...@googlegroups.com
Hossein,

Sorry for the 1-week delay.  I abruptly had to go out of town & I am just now getting back to this request.

Attached, please find my document that includes screen shots of the blocks.

Ad Server Blocks.docx

I put in a 2nd timer that fires off every 15000 milliseconds & the original timer goes off every 10000 milliseconds.

It seems to work well so far.  I plan to test it throughout the upcoming week & I will post here if I discover any issues.

Thanks,
Mark
Ad Server Blocks.docx

M. Hossein Amerkashi

unread,
Jul 23, 2011, 11:46:04 AM7/23/11
to appto...@googlegroups.com
Thanks for posting blocks. Looks good. Maybe adding and IF condition in selectRandomAd to ensure that varListOfAds is not empty??

-Hossein.

Mark Allen

unread,
Jul 24, 2011, 2:08:09 AM7/24/11
to appto...@googlegroups.com
That is a great idea.  I was still experiencing a random error for Argument cannot accept empty text string.  It does not happen very often, however happens when the app is open & the network switches from 3G over to 4G or vice versa.  I will try your suggestion & see if it works.  I will post my blocks once complete.

Mark Allen

unread,
Jul 24, 2011, 12:15:06 PM7/24/11
to appto...@googlegroups.com
Is this what you had in mind?

(see attachment - IsListEmpty)
IsListEmpty.docx

Mark Allen

unread,
Jul 25, 2011, 2:17:04 PM7/25/11
to appto...@googlegroups.com
This afternoon, I saw an error in the app that said "Is List Empty?" cannot accept the value Text.  However in my screen shot, you will notice that I did not include a "text" value in the "Is List Empty?" equation & it includes "global - varListofAds" & the logic block "False".  Is it looking at the actual values in the list (the URLs) that make up the varListofAds as text?

M. Hossein Amerkashi

unread,
Jul 25, 2011, 6:33:13 PM7/25/11
to appto...@googlegroups.com
Mark,

I believe you should change as follows

IF
  NOT "Is List Empty" varListOfAds

-Hossein.

Mark Allen

unread,
Jul 26, 2011, 7:52:31 AM7/26/11
to appto...@googlegroups.com
Like this?

(see attachment - IfNotIsListEmptyVarListofAds)
IfNotIsListEmptyVarListofAds.docx

M. Hossein Amerkashi

unread,
Jul 26, 2011, 5:10:08 PM7/26/11
to appto...@googlegroups.com
I believe that should do it Mark.

-Hossein.

Mark Allen

unread,
Jul 27, 2011, 7:36:11 AM7/27/11
to appto...@googlegroups.com
Thanks Hossein,

This is what I have saved in the App.  I will keep testing all week & update this thread if any issues are found.

Mark

Ahmad

unread,
Jul 29, 2011, 11:06:44 AM7/29/11
to appto...@googlegroups.com
Excellent Job ,, but 1 question


Can admob ads be implemented this way ??


When i add my app there, They say i have to download the SDK

They don't give direct links for viewing or clicking


so can anybody help me to find the ads links there ?? :)




Thanks and Best Regards..

Mark Allen

unread,
Jul 29, 2011, 6:25:21 PM7/29/11
to appto...@googlegroups.com
Ahmad,

It looks like AdMob is not an option with this method.

The only Advertising outfit that I have come across so far is:  http://web.mobpartner.com/

This one lets you get 2 links (URLs) to use to put your ads in the Apps.

1 URL is for the Banner ad & the other URL is the object of the click on the banner ad.

I have been running ads on my apps with them for about a month & have not even made 1 dime.

I am not sure if this is a good option at all.

Please take a look around & let us know if you can find any other options that have better ads, better sponsors, & pay better.

If so, please paste link to other advertisers here.

Thanks,
Mark

M. Hossein Amerkashi

unread,
Jul 29, 2011, 6:45:35 PM7/29/11
to appto...@googlegroups.com
Mark, My experience is that people don't usually click on ads. How many times have you clicked on ads (from apps) yourself :o)

-Hossein.

Mark Allen

unread,
Jul 31, 2011, 2:09:10 PM7/31/11
to appto...@googlegroups.com
Hossein,

Yes, that may be true.  But many Ad agencies will pay App Developers by the impression (each time the ad appears in the app & is seen by the users) so if you have 30K impressions per day in your app, then you can make some good $$$.

I know of an ad agency that paid $950 for 24K impressions to a website recently.

So, the potential is there.

Thanks,
Mark

francesco giannelli

unread,
Aug 1, 2011, 3:04:49 PM8/1/11
to appto...@googlegroups.com
Ok guys, first of all I want to say that probably mobpartner is the biggest CPA campaigns provider, and has a really simple interface adapt to appinventor... so since we lack ppc with adsense the best alternative is this.

I want to tell you a trick, actually you can avoid the timer and most of the code stuff of the solution provided by M. Hossein Amerkashi using the pool, that is a fuction you can find among the mobpartner site, basically you can enter all the campaigns you want in the pool, that by clicking the pool link they will be displayed randomly. So you will have only to add a button with the link of the banner of the pool and the relative affiliate link.
I hope you understood me, basically instead of developing the random ads pick in the app you assign this job to the mobpartner pool implementing ads way more easily.

Also, I earned 0$ too so far lol. I have minimum 5k impression a day, and actually I tried an heavy emails campaign too reaching a peak of 0,5% of CTR, but I still got 0$ :D
But recently I contacted the support of mobpartner and a advertising manager contacted me, I gave the link of my app (Nyan Catch you will find it on market and soon I will update the graphic :D), and he added to my pool the best campaigns for my app based also
on the country! yes! I don't know how, Actually if you know how to know which are the countries my app is downloaded from I would be glad to hear that! basically he founded this country rates and mixed with the app category he gave me those campaigns!

So I will suggest to you to contact the support to to get the best campaigns for your apps, because you know advertising is all about targeted traffic and users in our case!

M. Hossein Amerkashi

unread,
Aug 1, 2011, 5:17:45 PM8/1/11
to appto...@googlegroups.com
wow, you have 5k impressions per day?

That is pretty nice. Can you share your app link with us and if you don't mind, some HowTos on setting up the blocks with snapshots?

-Hossein.

francesco giannelli

unread,
Aug 1, 2011, 5:34:38 PM8/1/11
to appto...@googlegroups.com
mmm wait, now that you make me think, I guess they are not 5k impressions xD maybe they are 5-15 impressions with a floating point :) well I post a mobpartner screenshot about statistics so you can say :)
any what blocks are you referring to? the ads are still the same, but instead of a TinyDB for storing the links you can just put the static link of the mobpartner pool.

Mark Allen

unread,
Aug 2, 2011, 12:16:01 AM8/2/11
to appto...@googlegroups.com
Good evening Hossein,

I have been testing the latest set of blocks for the "Implementing Ads & Links in AI" for the past week or so since my last post about the changes that we discussed.

Unfortunately I have some bad news to report.  My testing has not proven 100% successful & I still see an error in the app from time to time that says:

Bad Arguments to “is list empty?”  The operation “is list empty?” cannot accept the arguments: text – END Application.                Then the App force closes…


I put together a document (App Workflow Document) & attached it here within this thread.  The document lists out in a step-by-step format, my current understanding of the

blocks that make up the Ad Server within my App.


I have included several assumptions & questions to confirm or refute my assumptions within the document.


Can you please read my document & then reply back to the questions within the document to let me know your thoughts on how I have the  

blocks that make up the Ad Server set up within my App?

I am stumped right now as to why the Bad Argument for "is list empty?" is still occurring.

There are a lot of moving parts within the App that make up the components in the Ad Server & I am wondering if it may make more sense to take all of the separate
parts & processes & combine them into a single operation (if possible).

Please review my situation & let me know what advice you may have for me at this stage (I am stuck).

Thanks!
<Mark>
App Workflow Document.docx

M. Hossein Amerkashi

unread,
Aug 2, 2011, 8:18:33 PM8/2/11
to appto...@googlegroups.com
Real nice document Allen. I'll look into it and reply back here.

-Hossein

M. Hossein Amerkashi

unread,
Aug 2, 2011, 9:17:07 PM8/2/11
to appto...@googlegroups.com
Mark,

Change definition for varListOfAds to be an empty List (make a list) NOT text

-Hossein.

francesco giannelli

unread,
Aug 3, 2011, 6:39:38 AM8/3/11
to AppToMarket
guys, seems that the manager I contacted is actually useful :)
yesterday I put the updated aps with the new pool, and today I earned
my first 10cents :)

Alex C.

unread,
Aug 4, 2011, 10:28:51 PM8/4/11
to appto...@googlegroups.com
Hey guys, first off thanks for the great tutorial.  This is probably a pretty simple question but I am having trouble getting the adds to work.  I have everything identical to your tutorial but when I click on the add instead of going to the website an error pops up that says
Error 601: No corresponding activity was found.
I believe thsi is a problem with the activity starter but I also have no idea, any help would be appreciated.
Thanks again and take care.

M. Hossein Amerkashi

unread,
Aug 5, 2011, 9:46:24 AM8/5/11
to appto...@googlegroups.com
Alex,

Is your activity starter setup like below?

Action: android.intent.action.VIEW
DataUri: http://the/link/to/site    <--- Change

-Hossein

Alex C.

unread,
Aug 5, 2011, 10:39:13 AM8/5/11
to appto...@googlegroups.com
Oh I see, thank you very much, took me a minute to figure out what that meant so for the other noobs out there when you drag the activity starter onto the screen then you have to set the activity section to android.intent.action.VIEW and then it worked fine.
Although for some reason this morning now when im trying to load the app i keep getting a bad string saying that I can't select a random item from "text" which I can only assume means that the database where its trying to load from is down, and I am just using the one from your example so thats no problem, I simply made a list in the app and did it from the app instead of outsourcing the getting of the information.  This will be more tedious in the future when changing the adds but I am sure I can fix the problem when I get a real chance to sit down and look at it.

Mark Allen

unread,
Aug 5, 2011, 11:25:46 PM8/5/11
to appto...@googlegroups.com
Hossein,



Is this correct?  Or am I taking your advice to literally?

Please confirm if this is the correct solution.

Thanks Hossein!

<Mark>

Mark Allen

unread,
Aug 5, 2011, 11:27:35 PM8/5/11
to appto...@googlegroups.com
See attached image in document.
VarListOfAds_makealist.docx
Message has been deleted

M. Hossein Amerkashi

unread,
Aug 5, 2011, 11:33:51 PM8/5/11
to appto...@googlegroups.com
Mark,

See LIST drawer and following should be in there. Sorry, I don't have AI open and I had to crop an existing image

-Hossein
foo.jpg

Mark Allen

unread,
Aug 6, 2011, 12:04:27 AM8/6/11
to appto...@googlegroups.com
Like this?
call_makealist.docx

francesco giannelli

unread,
Aug 6, 2011, 3:43:09 AM8/6/11
to appto...@googlegroups.com
apparently seems that using only the pool doesn't load different ads...that is strange...hossein can you try trying a list with only the pool links and see if it works for you?

Mark Allen

unread,
Aug 6, 2011, 9:29:50 AM8/6/11
to appto...@googlegroups.com
Hossein,

I tried the modification pictured in 'call_makealist.docx' & this is not the right solution (it did not work).

Can you please upload a picture of what you had in mind?

Thanks,
Mark

M. Hossein Amerkashi

unread,
Aug 6, 2011, 9:46:58 AM8/6/11
to appto...@googlegroups.com
Yes, its not correct. Will you be able to send me your src?

-Hossein.

Mark Allen

unread,
Aug 6, 2011, 10:08:55 AM8/6/11
to appto...@googlegroups.com
Sorry Hossein, what is src?

M. Hossein Amerkashi

unread,
Aug 6, 2011, 10:47:59 AM8/6/11
to appto...@googlegroups.com
Mark,

I loaded your app, updated (see attached) and its running with NO PROBLEM.  Also, see the suggestion that I put in the attached file.

-Hossein.
foo.jpg

M. Hossein Amerkashi

unread,
Aug 6, 2011, 10:49:37 AM8/6/11
to appto...@googlegroups.com
Francesco,

Not sure if I understand what you want me to do. Can you explain more or send a link if you want us to try?

-Hossein.

Mark Allen

unread,
Aug 6, 2011, 12:35:35 PM8/6/11
to appto...@googlegroups.com
Hi Hossein,

Sorry I was not available earlier.  Our baby was crying & I needed to feed her.

OK, so I see what you put in there for Add Banner Image & Add Banner Background Text.  I will put these suggestions in.

For the Call Make a List block, should I put the Text, Make A list in there as the item?

For the most part it runs without any problem, the only time it acts up is when the app can not pull in the data from the web service.

You can test this by changing the value for the Web Service from "MobPartnerAds" to something that does not exist on the web service (like XXXYYY) & then saving the app & running it.

Also, the error message about "is list empty?" cannot contain the value text, displays when the phone is in a bad area in WiFi & drops the internet connection or the internet connection is slow, etc.

PS

I took your advice last night & made my own web service last night.  It took a few hours to figure it out, but I got it up & running now.

Now I will not have to worry about people coming along & deleting my Tags.  I will need to resubmit my App on the Market with the new web service URL.

Hope to get all the issues fixed & then resubmit it early next week.

I really appreciate all of your help Hossein.

Please let me know about the Question above:

"For the Call Make a List block, should I put the Text, Make A list in there as the item?"

Thanks!

<Mark>

M. Hossein Amerkashi

unread,
Aug 6, 2011, 3:50:10 PM8/6/11
to appto...@googlegroups.com
Mark,

Problem solved. See attached. Basically I added an IF condition to ensure its a list that we deal with.
Let me know if you have questions.

-Hossein.
foo.jpg

francesco giannelli

unread,
Aug 6, 2011, 4:27:08 PM8/6/11
to appto...@googlegroups.com
hossein,

what I want you to try instead of using a list of all the direct links of the campaigns you are running, is to use only the r and c links of a pool (if you don't have one just create putting some campaigns in it)
I posted a pool example in the image attacched.
I have tried doing so, but what I get is that it loads only the first time, and when the timer should get the links again, the links don't change, and the buttonbanner is stuck with the first image/link it loads.
so the problem is that it loads only one time and doesn't change image/links randomly like it does in any web browser.


pool.jpg

Mark Allen

unread,
Aug 6, 2011, 10:15:12 PM8/6/11
to appto...@googlegroups.com
Hi Hossein,

This looks like a good solution.  I am trying to put it in place.

How did you get the = (equal sign) to show up in the "call = is a list? thing" block & the "value = valueFromWebDB" block?

I have tried to set the blocks to contain an = sign, but can't seem to make that work.

Please let me know.

Thanks!

<Mark>
foo.jpg

M. Hossein Amerkashi

unread,
Aug 6, 2011, 10:16:59 PM8/6/11
to appto...@googlegroups.com
Mark,
You can ignore that. That was for my debugging.

-Hossein.

Mark Allen

unread,
Aug 6, 2011, 11:00:06 PM8/6/11
to appto...@googlegroups.com
Hossein,

Understood.  I put the blocks in (without the = sign) & I am testing it now.

Once again, thank you for your time & attention to my questions & for helping me perfect the Ads & Links in AI.

I will run my normal test plans this week & I will report back my test results next weekend after 1 full week of testing in various locations & in various different scenarios.

Hope you are having a good weekend!

Thanks,
<Mark>

M. Hossein Amerkashi

unread,
Aug 7, 2011, 8:18:28 PM8/7/11
to appto...@googlegroups.com
Francesco,

We are using pools and it seems to be running okay; Mark can verify because his doing a lot of tests on this. HERE is the doc that Mark put together. What we are doing is basically broken down in 2 apps:
1> app 1 is used as admin to change ad campaign and update a tinywebdb and sort of serve pooled ads (their links; the r and c)
2> app 2 is the one that gets distributed to users and displays the ads.

I know it may be a lot, but you have to read from beginning of this thread. Just note that we ARE NOT using any static links and this solution allows us to change ads that user sees ANY TIME we want.

-Hossein

marc1i

unread,
Aug 7, 2011, 10:58:15 PM8/7/11
to appto...@googlegroups.com
Hi Hossein,

Is this a solution to monetize ads in our app? Has any of you made money with this yet?

With AI being discontinued/going open source, it's not clear whether Admob or Google Adsense will ever be supported on AI. Hence my question, whether your proposed solution can help us making some click-revenue and buy-revenue from the Ads in AI implemented by you and Mark.

Cheers,

M

francesco giannelli

unread,
Aug 8, 2011, 7:07:46 AM8/8/11
to appto...@googlegroups.com
Hossein yes, I know that, I already did all the store in the DB and get the value on the app, I get that. It's cool because if a fresh new profitable mob campaign comes out you can add it with the TinyDB. 

But this could be done just using mobpartner. IMHO the TinyDB is not necessary, because all you need is a static pool from mobpartner. The only problem is that with the timer the pool seems not to change ads for me as it happens in the browser.

M. Hossein Amerkashi

unread,
Aug 8, 2011, 10:50:40 AM8/8/11
to appto...@googlegroups.com
Francesco,

What would happen if you want to let's say stop your ads OR change your ad campaign to a different type / set of ads? Does your suggestion work for that?

-Hossein

francesco giannelli

unread,
Aug 9, 2011, 4:06:39 AM8/9/11
to appto...@googlegroups.com
You can delete the pool and the static link will point nowhere, or you can edit the pool adding different campaigns removing completely the ones you have and adding new ones.

Yuval

unread,
Aug 9, 2011, 11:51:50 AM8/9/11
to appto...@googlegroups.com
Hello Hossein,

I tried to do what you did but then in the emulator an error occurs:  
Bad arguments to pick random item, the operation pick random item cannot accept the argument *empty string*.
also i put the "admin app" in the "background" meaning i put the storing in the tinywebDB in the screen initialize, maybe thats the problem.
oh and im new to app inventor so can you explain me why do i need to store the links in the tinyWebDB?
and can you send me the source to the admin and user apps so i can compare? 
thanks so much for this tortorial and for help!!

Yuval

unread,
Aug 10, 2011, 10:59:22 AM8/10/11
to appto...@googlegroups.com
Hi Alex,

Did you solve the problem with the bad string saying that I can't select a random item from "text"? 
I have the same problem, so if you solved it can you please help me!!






M. Hossein Amerkashi

unread,
Aug 10, 2011, 12:14:57 PM8/10/11
to appto...@googlegroups.com
That's strange. If you follow this thread and Mark's documentation, I believe you should'nt get the error. Can you post your blocks?

-Hossein

Yuval

unread,
Aug 10, 2011, 2:15:58 PM8/10/11
to AppToMarket
Thank you hossein, I just went through Marks documentation and it
works perfectly!!

Alex C.

unread,
Aug 10, 2011, 8:23:20 PM8/10/11
to appto...@googlegroups.com
sorry I sort of forgot about it, the only thing I can think of is that when trying to get the ads sent to the database, it cannot retrieve them for whatever reason, the most likely because the database is down, and so there is only text in the global variable when your app tries to read it.  Possible solutions would be to create your own tinywebdb or instead of that just create a list in your app of the ads and reference that instead of the database.  This is what I did and although it will be more annoying when putting new ads in it works.

Usama Ali

unread,
Aug 20, 2011, 1:30:37 PM8/20/11
to appto...@googlegroups.com
Hi, whenever I click the add, it says "Error 601 No corresponding activity was found." I don't know much about activity starter so could someone help me with what this means? Thanks

M. Hossein Amerkashi

unread,
Aug 22, 2011, 11:08:15 AM8/22/11
to appto...@googlegroups.com
You probably did not implement the admin part. See HERE

marc1i

unread,
Aug 24, 2011, 9:39:17 AM8/24/11
to appto...@googlegroups.com
Hi all, any luck with monetizing this custom-made advertising machine? Has anybody of you made some advertising revenue with this?

Nick Kliesen

unread,
Aug 25, 2011, 11:22:31 AM8/25/11
to appto...@googlegroups.com
I have all of my blocks matching yours and have made my second app but when I have my phone hooked up it flashes " bad argument Pick random item cannot accept the argument: text" as well as a list index to large and then it list my all of my ads. also what is the actual screen supposed to look like as far as ad placement right mow mins is stuck in the middle of my page 
adsblocks1.JPG
adsblocks2.JPG

M. Hossein Amerkashi

unread,
Aug 25, 2011, 12:07:03 PM8/25/11
to appto...@googlegroups.com
Nick,

You are missing  adsblocs2.JPG is missing the part that includes the image. Each list entry in there is composed of 2 items seperated by double pipe sign (||). See HERE.

-Hossein

Nick Kliesen

unread,
Aug 25, 2011, 12:19:56 PM8/25/11
to appto...@googlegroups.com
I fixed that I still get the part about bad agrument. it says "Bad arguments to pick random item   the operation pick random Item cannot accept the argument: text"

M. Hossein Amerkashi

unread,
Aug 25, 2011, 1:36:22 PM8/25/11
to appto...@googlegroups.com
Hoping that Mark and Yuval can provide feedback on this because they have it working with no problem

-Hossein.

Y.M.

unread,
Aug 25, 2011, 3:36:05 PM8/25/11
to appto...@googlegroups.com

Nick,  at first put the "varlistofads" as an empty list, in the "selectrandomad" procedure put the "if" action if the list is not empty(as shown in my first image), put in the tinyDB.GotValue the "if" action, and test if the "valueFromWebDB" is a list (as shown in the second image). hope that would help!!
selectrandomad.JPG
tinydbgotvalue.JPG

Nick Kliesen

unread,
Aug 27, 2011, 11:39:25 AM8/27/11
to appto...@googlegroups.com
Got it thanks. when I add these apps to the market how do I do the admin app do I upload it to the she same app and not activate it or od I make it its own seperate app and activate it but not publish?

M. Hossein Amerkashi

unread,
Aug 27, 2011, 11:51:18 AM8/27/11
to appto...@googlegroups.com
Nick,

Don't publish to market. Just install and run it from your phone - like when you test an AI app, it gets installed on your phone

-Hossein

Nick Kliesen

unread,
Aug 27, 2011, 4:23:02 PM8/27/11
to appto...@googlegroups.com

How do l make it so everyone else see s the ads if it is only on my phone?

M. Hossein Amerkashi

unread,
Aug 27, 2011, 8:36:26 PM8/27/11
to appto...@googlegroups.com
Nick,

You need to read over this thread again. There are 2 parts into this:

1. Admin app
2. User app - to publish in Market

1 is used so that you could save your add in cloud - in this example series, in TinyWebDB. This is the one that you just use your phone and update the ads that are saved in cloud

2 is the app that is published to market and retrieves the ads from the cloud

-Hossein.

Nick Kliesen

unread,
Aug 29, 2011, 3:10:22 AM8/29/11
to appto...@googlegroups.com
I got them to show on my app but when you click on them they give an error cod and dont do anything what am I doing wrong

Mateusz Schoen

unread,
Aug 31, 2011, 6:28:38 AM8/31/11
to appto...@googlegroups.com
Can anyone do a screen of all blocks?

Markus Olszewski

unread,
Aug 31, 2011, 7:29:57 AM8/31/11
to appto...@googlegroups.com

Zrobie za 2h okaj?

M. Hossein Amerkashi

unread,
Aug 31, 2011, 9:02:05 AM8/31/11
to appto...@googlegroups.com
Mateusz,

This thread is full of posting with blocks and attachments in word. Start from top.

-Hossein

Mateusz Schoen

unread,
Aug 31, 2011, 12:13:54 PM8/31/11
to appto...@googlegroups.com
okej, bo mi coś nie działa, nie wyświetla reklam ale błędów nie pokazuje

M. Hossein Amerkashi

unread,
Aug 31, 2011, 1:03:55 PM8/31/11
to appto...@googlegroups.com
Please post in English.

Thanks

Markus Olszewski

unread,
Aug 31, 2011, 1:04:52 PM8/31/11
to appto...@googlegroups.com
ok, he is polish so I was explaing some things to him :)
Message has been deleted

M. Hossein Amerkashi

unread,
Sep 3, 2011, 1:18:19 PM9/3/11
to appto...@googlegroups.com
I will try to consolidate docs and put a final version together

-Hossein

PavementPilot

unread,
Sep 9, 2011, 1:53:06 AM9/9/11
to appto...@googlegroups.com
Well that was an interesting read, and the revisions to blocks has me jumbled and confused. I am looking forward to your final revision. Also in that final, can you explain how to go about getting paid for having these ads running in your apps? Where to register etc.

Markus Olszewski

unread,
Sep 9, 2011, 2:21:29 AM9/9/11
to appto...@googlegroups.com
What you have to do is register with MobPartner http://web.mobpartner.com/en/campaign?affi=149572 and then add your app or game to your account and subscribe to offers.


On 9 September 2011 06:53, PavementPilot <paveme...@gmail.com> wrote:
Well that was an interesting read, and the revisions to blocks has me jumbled and confused. I am looking forward to your final revision. Also in that final, can you explain how to go about getting paid for having these ads running in your apps? Where to register etc.



--
THANKS,
Markus Olszewski
Addictive Gaming
------------------------
 
 

PavementPilot

unread,
Sep 9, 2011, 3:50:24 AM9/9/11
to appto...@googlegroups.com
Ok, Thanks. I did that, and now am waiting for the revision to be completed.

M. Hossein Amerkashi

unread,
Sep 9, 2011, 9:14:52 AM9/9/11
to appto...@googlegroups.com
Have you seen document that Mark put together HERE?

PavementPilot

unread,
Sep 9, 2011, 1:08:18 PM9/9/11
to appto...@googlegroups.com
I have read the doc, and tried to follow it before laying it out in base template. A few things come to mind that are not covered or defined though. There are a few variables in the Screen1.initialize that are not mentioned in the description, such as CURRENT_BAL or label LBL_BALANCE, ADD_BANNER.text and ADD_BANNER.image. Also where do we put these label and images in the layout of the screen. 

Mark Allen

unread,
Sep 9, 2011, 5:07:41 PM9/9/11
to appto...@googlegroups.com
Current Bal & lbl balance are specific to my app & not relevant to your ad server you are building.  Disregard these two.

Add Banner is the box you will make to display your adds.  Add Banner image is the image that will show up when the adds appear from the web service.  (URL you specify)

Add Banner text is always NULL.

Just put the add banner box down at the bottom of your screen in the designer.

use 300w & 50h pixels for the size if you are using mobpartner adds.  Their images are always in this size.
It is loading more messages.
0 new messages