Adding Nag-Screen for your apps

22 Aug

The wiktionary definition for Nag Screen is “A message displayed by a nagware program to encourage the user to purchase the full version.” The Nag Screen could be useful when you have a LITE version of your app that user can test. However, you want to encourage user to purchase the full version.

Approach below shows you how to implement the Nag Screen for your apps.


Blocks Definition

Initially, we setup 3 global variables as follows:

  1. varTimesUsed – This variable holds total number of times that user has run the app
  2. varNagInterval – How often you want the Nag Screen (pop-up) to display. For example, if set to 5, it will display every 5-time usage of the app
  3. TAG_TIMES_USED – A tag variable that is used to retrieve and store data into our database

Next, in our Initialize block of the screen we:

  1. We attempt to get the total times app has been run. If 1st time (doesn’t exist), then we default to 0, otherwise we get the total number of times run.
  2. Next, increment the returned value by 1 and store it back to our varTimesUsed
  3. We then store the new incremented value into our database (use same tag as the one used to retrieve)
  4. We now use the modulo function to get the remainder when dividing varTimesUsed by varNagInterval. If remainder is zero, it means the varNagInterval time has been met and we need to display the Nag Screen
  5. Lastly, the IF control statement is used to check and see if remainder is 0.
  6. If zero, it means it is time to display the Nag Screen and we use a Notifier which displays the Nag AND total number of times the app has been used.
  7. If not-zero, we simply don’t do any thing.

Join AppyBuilder community at



Posted by on August 22, 2014 in Uncategorized


2 responses to “Adding Nag-Screen for your apps

  1. shuvo5320

    September 5, 2014 at 3:56 pm

    Hi, Sir I would like to give a THANK YOU. It’s a great initiative that you gave a life to App Inventor, Please keep it up and add more and more features. I Have a question also Please answer me sir.

    How can I change background image when it’s in landscape mode?
    I uploaded two image for background of my app in MIT App Inventor 2. Once I set a background image for portrait orientation it’s ok, but when it’s come to landscape same image is showing. I want show different images when device change it’s orientation. I have tried in some ways with the screen’s logic blocks in the block section. How can I do that?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: