/* * This file is part of TradutorGalego. * TradutorGalego is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * TradutorGalego is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with TradutorGalego. If not, see <http://www.gnu.org/licenses/>. */ package es.galapps.android.tradutorgalego.util; import java.util.List; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; public class InstalledApplicationsUtils { public static boolean isConxuGalegoInstalled(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("es.sonxurxo.android.conxugalego", "es.sonxurxo.android.conxugalego.Verbs")); List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return list.size() > 0; } public static boolean isDiccionarioGalegoInstalled(Context context) { Intent intent = new Intent(); intent.setComponent(new ComponentName("es.galapps.android.diccionariogalego", "es.galapps.android.diccionariogalego.Definitions")); List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); return list.size() > 0; } }