title: android Inapp Billing: remove ads
body: <p>In my android app, im showing some small ad banners at the bottom of the screen in some activities. I now want to give the user the opportunity to remove this ads via in-app billing.</p>
  
  <p>What is a good way to implement that?</p>
  
  <p>As the ads are showing up immediatly after the start of some activities, querying googles service for purchased items every time i am showing an ad seems to be bad as it takes some time to connect to the service.
  I thought about querying googles service once while in a splash screen, using a boolean in my application context singelton to store the information if adfree is purchased. In the activities <code>onCreate</code>, I then check if boolean <code>isPremium</code> is true. If this is the case, im setting the visibility of the adview to false <code>findViewById(R.id.adview).setVisibility(false)</code>.</p>
  
  <p>Is this safe?
  Im not sure if the ApplicationManager can kill my ApplicationContext where the variable is stored without killing all activities.</p>