Android Context Get getChannelNo(Context context)

Here you can find the source of getChannelNo(Context context)

Description

get Channel No

License

Apache License

Declaration

public final static String getChannelNo(Context context) 

Method Source Code

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

import android.content.Context;

import android.content.pm.ApplicationInfo;

import android.content.pm.PackageManager;

public class Main {
    public final static String getChannelNo(Context context) {
        String appKey = "";
        try {//from   w w  w . j a  v a2  s  .  com
            ApplicationInfo ai = context.getPackageManager()
                    .getApplicationInfo(context.getPackageName(),
                            PackageManager.GET_META_DATA);
            if (null != ai && null != ai.metaData) {
                appKey = ai.metaData.getString("channel");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return appKey;
    }
}

Related

  1. getBoolean(Context context, String key, boolean defValue)
  2. getBroadcastAddress(Context context)
  3. getCarrier(Context context)
  4. getCertificateFingerprint(Context ctx, String packageName)
  5. getCertificateFromSDCard(Context context)
  6. getConnectedType(Context context)
  7. getConnectedType(Context context)
  8. getContactDisplayNameByNumber(Context context, String number)
  9. getContactName(Context ctx, String phoneNumber)