PackageManager queryIntentServices - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for PackageManager queryIntentServices method.

This code example shows how to use the following methods:queryIntentServices
		//Try to get the openudid from local preferences 
		OpenUDID = manager.mPreferences.getString(PREF_KEY, null);
		if (OpenUDID == null) //Not found
		{ 
			//Get the list of all OpenUDID services available (including itself) 
			manager.mMatchingIntents = context.getPackageManager().queryIntentServices(new Intent("org.OpenUDID.GETUDID"), 0);
			if (LOG) Log.d(TAG, manager.mMatchingIntents.size() + " services matches OpenUDID");
			 
			if (manager.mMatchingIntents != null)
				//Start services one by one 
				manager.startService();
		 
		} else {//Got it, you can now call getOpenUDID() 
			if (LOG) Log.d(TAG, "OpenUDID: " + OpenUDID);
			mInitialized = true;
		} 
	} 
	 
	 
	 
6
CodeRank
This code example shows how to use the following methods:queryIntentServices
		 *  2013/5/23 
		 */ 
		 
	    final PackageManager packageManager = this.activity.getPackageManager();
	    final Intent intent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
	    List<ResolveInfo> list = packageManager.queryIntentServices(intent, 0);
	    return list.size() > 0;
	} 
	 
	private BillingManager(Activity context) {
		Log.d(kClassName, "BillingManager");
		 
		this.activity  = context;
		this.iabHelper = new IabHelper(this.activity);
		 
		this.iabHelper.enableDebugLogging(true); // TODO : Production is false : Debug is true
		 
		if (!isBillingAvailable()) { 
			PFInterface.startAlertDialog("課金制限", "Google Playアカウントを確認してください"); 
		} else { 
6
CodeRank
This code example shows how to use the following methods:queryIntentServices
	 */ 
	@Override 
	public boolean isServiceAvailable(Context context, Class<?> cls) {
	    final PackageManager packageManager = context.getPackageManager();
	    final Intent intent = new Intent(context, cls);
	    return packageManager.queryIntentServices(intent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0;
	} 
	 
	@Override 
	public ActivityInfo getActivityInfo(Context context, Class<?> cls) {
		try { 
			final PackageManager packageManager = context.getPackageManager();
			return packageManager.getActivityInfo(new ComponentName(context, cls), 0);
		} 
		catch (NameNotFoundException e) {
			if(logger != null) {
				logger.error("Failed to locate info for activity [" +
						cls.getName() +
						"]", e);
			} 
5
CodeRank
This code example shows how to use the following methods:queryIntentServices
    } 
 
    public boolean isServiceAvailable() { 
        final PackageManager packageManager = context.getPackageManager();
        final Intent intent = new Intent(context, executorServiceClass);
        final List<ResolveInfo> resolveInfo = packageManager.queryIntentServices(intent,
                PackageManager.MATCH_DEFAULT_ONLY);
        if (resolveInfo.size() > 0) {
            return true; 
        } 
        return false; 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:queryIntentServices
	 * @param flags ( default PackageManager.MATCH_DEFAULT_ONLY ) 
	 *  
	 * @return 
	 */ 
	public static boolean isServiceAvailable(Intent i,PackageManager pm) {
		return pm.queryIntentServices(i,PackageManager.MATCH_DEFAULT_ONLY).size() >0;
	} 
	 
	public static boolean isServiceAvailable(Intent i,PackageManager pm,int flags) {
		return pm.queryIntentServices(i,flags).size() >0;
	} 
	 
	@SuppressWarnings("rawtypes") // have to use raw type here 
    public static void startActivityClass(Context ctx,Class activity_class) {
		ctx.startActivity(new Intent(ctx,activity_class));
	} 
	 
    public static class IntentStartOnClick implements View.OnClickListener{
    	private Intent i;
    	private Activity ctx;
4
CodeRank
This code example shows how to use the following methods:queryIntentServices
        return wrapped.resolveService(intent, flags);
    } 
 
    @Override 
    public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
        return wrapped.queryIntentServices(intent, flags);
    } 
 
    @Override 
    public ProviderInfo resolveContentProvider(String name, int flags) {
        return wrapped.resolveContentProvider(name, flags);
    } 
 
    @Override 
    public List<ProviderInfo> queryContentProviders(String processName, int uid, int flags) {
        return wrapped.queryContentProviders(processName, uid, flags);
    } 
 
    @Override 
    public InstrumentationInfo getInstrumentationInfo(ComponentName className, int flags)
4
CodeRank

Related PackageManager queryIntentServices Questions & Answers:

queryIntentServices Method Overview
Retrieve all services that can match the given intent.
See Code Examples for other Android PackageManager Methods: