package basic.BuilderTypeManager.model;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

/**
 * Created by fanwang on 9/8/16.
 */
public class BuildTypeUtil {

    /**
     * get meta value from application
     * @param metaName
     * @param context
     * @return  meta value
     */
    public static String readMetaDataFromApplication(String metaName, Context context){
        String metaValue = null;
        try{
            ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
            metaValue = appInfo.metaData.getString(metaName);
        }catch (Exception excepton){
            excepton.printStackTrace();
        }

        return metaValue;
    }

}
