Android Context Get getSignatures(final Context context)

Here you can find the source of getSignatures(final Context context)

Description

get Signatures

License

Apache License

Declaration

private static Signature[] getSignatures(final Context context)
            throws PackageManager.NameNotFoundException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;

public class Main {
    private static Signature[] getSignatures(final Context context)
            throws PackageManager.NameNotFoundException {
        PackageInfo packageInfo = context.getPackageManager()
                .getPackageInfo(getPackageName(context),
                        PackageManager.GET_SIGNATURES);
        Signature[] signatures = packageInfo.signatures;
        return signatures;
    }/*from  w ww.  j  a  v a  2 s.c  om*/

    /**
     * Get the application package name.
     *
     * @param context Context
     * @return package name
     */
    public static String getPackageName(final Context context) {
        return context.getPackageName();
    }
}

Related

  1. getScaledDensity(Context context)
  2. getScenario(Context context, String filename, int widgetid, int defaultScenario)
  3. getSeed(Context context)
  4. getSelectedLangCodes(Context context, int[] indexes, boolean[] selectedItems, int codeResourceId)
  5. getServiceMetaData(Context context, Class serviceClass, String key)
  6. getSizeName(Context context)
  7. getSmiledText(Context context, CharSequence text)
  8. getSmsId(Context context)
  9. getString(Context context, String key, String defValue)