Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7967731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:58:09+00:00 2026-06-04T06:58:09+00:00

I’ve developed an android phonegap application. The app make use of native admob ad

  • 0

I’ve developed an android phonegap application. The app make use of native admob ad code where the ad is displayed at the bottom of the app. I chose the native method instead of javascript intergration because the native version allow me to have more option to modify in admob website. My question: Is it possible to hide/unhide admob ad from javascript?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:58:10+00:00Added an answer on June 4, 2026 at 6:58 am

    You can implement a plugin which will show/hide the ad banner.
    Here is an example:

    com.example.AdBanner:

    public class AdBannerPlugin extends Plugin {
        public static final String BROADCAST_ACTION_SHOW_AD_BANNER = "com.example.SHOW_AD_BANNER";
        public static final String BROADCAST_ACTION_HIDE_AD_BANNER = "com.example.HIDE_AD_BANNER";
        private static final String ACTION_SHOW_AD_BANNER = "showBanner";
        private static final String ACTION_HIDE_AD_BANNER = "hideBanner";
    
        /**
         * @see Plugin#execute(String, org.json.JSONArray, String)
         */
        @Override
        public PluginResult execute(final String action, final JSONArray data, final String callbackId) {
            if (ACTION_SHOW_AD_BANNER.equals(action)) {
                final Intent intent = new Intent();
                intent.setAction(BROADCAST_ACTION_SHOW_AD_BANNER);
                this.ctx.getApplicationContext().sendBroadcast(intent);
                return new PluginResult(OK);
            } else if (ACTION_HIDE_AD_BANNER.equals(action)) {
                final Intent intent = new Intent();
                intent.setAction(BROADCAST_ACTION_HIDE_AD_BANNER);
                this.ctx.getApplicationContext().sendBroadcast(intent);
                return new PluginResult(OK);
            } else {
                Log.e(LOG_TAG, "Unsupported action: " + action);
                return new PluginResult(INVALID_ACTION);
            }
        }
    }
    

    In your main activity:

    private BroadcastReceiver adReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(final Context context, final Intent intent) {
            if (BROADCAST_ACTION_SHOW_AD_BANNER.equals(intent.getAction())) {
                //check if the ad view is not visible and show it 
            } else if (BROADCAST_ACTION_HIDE_AD_BANNER.equals(intent.getAction())) {
                //check if the ad view is visible and hide it
            }
        }
    };
    
    @Override
    public void onResume() {
        final IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(BROADCAST_ACTION_HIDE_AD_BANNER);
        intentFilter.addAction(BROADCAST_ACTION_SHOW_AD_BANNER);
        registerReceiver(adReceiver, intentFilter);
        super.onResume();
    }
    
    @Override
    public void onPause() {
        unregisterReceiver(adReceiver);
        super.onPause();
    }
    

    In plugins.xml:

    <plugin name="com.example.AdBanner" value="com.example.AdBannerPlugin"/>
    

    Now you can hide ad banner from javascript:

    cordova.exec(onSuccess, onFail, 'com.example.AdBanner', 'hideBanner', []);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am writing an app with both english and french support. The app requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.