check whether the flash can play or not.

@param context
@param mWebView
@param showInstall show install page or not.
@return return  the plugin exist or not.
540545
public static boolean check(Context context, WebView mWebView, boolean showInstall) {
        if (context == null) return false;

        boolean flashPluginExist = isPluginExist(context);

        if (mWebView != null) {
            if (!flashPluginExist && showInstall) {
                mWebView.addJavascriptInterface(new AndroidBridge(context), "android");
                String content = "<html>\n" +
                        "<head></head>\n" +
                        "<body>\n" +
                        "<br/><br/>\n" +
                        "\n" +
                        "<h3>Sorry, We have found that you haven't installed adobe flash player's plugin!</h3>\n" +
                        "\n" +
                        "<p>\n" +
                        "<h4>\n" +
                        "    You can click <a href=\"#\" onclick=\"window.android.goMarket()\"> <b> here</b></a> to\n" +
                        "    install it.</h4>\n" +
                        "</p>\n" +
                        "</body>\n" +
                        "</html>\n";
                mWebView.loadData(content, "text/html", "UTF-8");
            }
        }

        return flashPluginExist;
    }
198894
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
    public static boolean hasUsbHostFeature(Context context) {
        return hasUsbHostFeature(context.getPackageManager());
    }
1165268
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasCompassSensorFeature(Context context) {
        return hasCompassSensorFeature(context.getPackageManager());
    }
963730
public static Intent openPlayStore(Context context, boolean openInBrowser) {
        String appPackageName = context.getPackageName();
        Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
        if (isIntentAvailable(context, marketIntent)) {
            return marketIntent;
        }
        if (openInBrowser) {
            return openLink("https://play.google.com/store/apps/details?id=" + appPackageName);
        }
        return marketIntent;
    }
875656
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
    public static boolean hasUsbAccessoryFeature(Context context) {
        return hasUsbAccessoryFeature(context.getPackageManager());
    }
1340760
public static EvernoteInstallStatus getEvernoteInstallStatus(Context context, String action) {
        PackageManager packageManager = context.getPackageManager();
        Intent intent = new Intent(action).setPackage(PACKAGE_NAME);

        List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (!resolveInfos.isEmpty()) {
            return validateSignature(packageManager);
        }

        try {
            // authentication feature not available, yet
            packageManager.getPackageInfo(PACKAGE_NAME, PackageManager.GET_ACTIVITIES);
            return EvernoteInstallStatus.OLD_VERSION;

        } catch (Exception e) {
            return EvernoteInstallStatus.NOT_INSTALLED;
        }
    }
1246788
@Override
	public boolean isShowing() {
		if (markedAsVisible) {
			if (viewPort.getResolution() >= wmsConfig.getMinimumResolution() && viewPort.getResolution() <
					wmsConfig.getMaximumResolution()) {
				return true;
			}
		}
		return false;
	}
608002
public static boolean isAppInstalled(final Context context, final String packageName){
        try {
            context.getPackageManager().getPackageInfo(packageName, 0);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
475096
def load_plugin_from_addonxml(cls, mode, url):
        '''
        '''
        cwd = os.getcwd()
        sys.path.insert(0, cwd)
        module_name = get_addon_module_name(os.path.join(cwd, 'addon.xml'))
        addon = __import__(module_name)

        # Find the first instance of xbmcswift2.Plugin
        try:
            plugin = (attr_value for attr_value in vars(addon).values()
                      if isinstance(attr_value, Plugin)).next()
        except StopIteration:
            sys.exit('Could\'t find a Plugin instance in %s.py' % module_name)

        return cls(plugin, mode, url)
796309
@VisibleForTesting
  Map<String, Plugin> instantiatePluginClasses(Map<PluginClassLoaderDef, ClassLoader> classloaders) {
    // instantiate plugins
    Map<String, Plugin> instancesByPluginKey = new HashMap<>();
    for (Map.Entry<PluginClassLoaderDef, ClassLoader> entry : classloaders.entrySet()) {
      PluginClassLoaderDef def = entry.getKey();
      ClassLoader classLoader = entry.getValue();

      // the same classloader can be used by multiple plugins
      for (Map.Entry<String, String> mainClassEntry : def.getMainClassesByPluginKey().entrySet()) {
        String pluginKey = mainClassEntry.getKey();
        String mainClass = mainClassEntry.getValue();
        try {
          instancesByPluginKey.put(pluginKey, (Plugin) classLoader.loadClass(mainClass).newInstance());
        } catch (UnsupportedClassVersionError e) {
          throw new IllegalStateException(String.format("The plugin [%s] does not support Java %s",
            pluginKey, SystemUtils.JAVA_VERSION_TRIMMED), e);
        } catch (Throwable e) {
          throw new IllegalStateException(String.format(
            "Fail to instantiate class [%s] of plugin [%s]", mainClass, pluginKey), e);
        }
      }
    }
    return instancesByPluginKey;
  }
345420
function hasPlugin(deps, pluginName, version) {
    return !!deps.find(function(dep) {
        return dep.getName() === pluginName && (!version || dep.getVersion() === version);
    });
}
1255222
protected boolean isPluginValid(PluginWrapper pluginWrapper) {
        String requires = pluginWrapper.getDescriptor().getRequires().trim();
        if (!isExactVersionAllowed() && requires.matches("^\\d+\\.\\d+\\.\\d+$")) {
            // If exact versions are not allowed in requires, rewrite to >= expression
            requires = ">=" + requires;
        }
        if (systemVersion.equals("0.0.0") || versionManager.checkVersionConstraint(systemVersion, requires)) {
            return true;
        }

        PluginDescriptor pluginDescriptor = pluginWrapper.getDescriptor();
        log.warn("Plugin '{}' requires a minimum system version of {}, and you have {}",
            getPluginLabel(pluginDescriptor),
            pluginWrapper.getDescriptor().getRequires(),
            getSystemVersion());

        return false;
    }
649747
public boolean isContextSupported(Class<? extends WorkContext> workContextClass)
   {
      if (workContextClass == null)
         return false;

      return supportedContexts.contains(workContextClass);
   }
412631
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static boolean hasJazzhandMultiTouchScreenFeature(Context context) {
        return hasJazzhandMultiTouchScreenFeature(context.getPackageManager());
    }
625079
public static boolean isTopApplication(Context context) {
		ComponentName activity = getTopActivity(context);
		if (activity == null) {
			return false;
		}
		return activity.getPackageName().equals(context.getApplicationInfo().packageName);
	}
379960
def register_plugin(manager):
    '''
    
    '''
    manager.register_blueprint(player)
    manager.register_mimetype_function(detect_playable_mimetype)

    # add style tag
    manager.register_widget(
        place='styles',
        type='stylesheet',
        endpoint='player.static',
        filename='css/browse.css'
    )

    # register link actions
    manager.register_widget(
        place='entry-link',
        type='link',
        endpoint='player.audio',
        filter=PlayableFile.detect
    )
    manager.register_widget(
        place='entry-link',
        icon='playlist',
        type='link',
        endpoint='player.playlist',
        filter=PlayListFile.detect
    )

    # register action buttons
    manager.register_widget(
        place='entry-actions',
        css='play',
        type='button',
        endpoint='player.audio',
        filter=PlayableFile.detect
    )
    manager.register_widget(
        place='entry-actions',
        css='play',
        type='button',
        endpoint='player.playlist',
        filter=PlayListFile.detect
    )

    # check argument (see `register_arguments`) before registering
    if manager.get_argument('player_directory_play'):
        # register header button
        manager.register_widget(
            place='header',
            type='button',
            endpoint='player.directory',
            text='Play directory',
            filter=PlayableDirectory.detect
            )
345427
public static boolean isInstalled(@NonNull final Context context,
                                      @NonNull final String appPackage) {
        try {
            return context.getPackageManager().getApplicationInfo(appPackage, 0) != null;
        } catch (PackageManager.NameNotFoundException ignore) {
            // ignore
        }
        return false;
    }