add map version
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,6 +49,26 @@ public class AppUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static final String MOGO_MAP_SDK_VERSION = "MAP_SDK_VERSION";
|
||||
|
||||
public static String getCustomMapSDKVersion(Context context){
|
||||
return getApplicationMetaValue(context,MOGO_MAP_SDK_VERSION);
|
||||
}
|
||||
|
||||
private static String getApplicationMetaValue(Context context,String metaName){
|
||||
try {
|
||||
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(),PackageManager.GET_META_DATA);
|
||||
Bundle bundle = applicationInfo.metaData;
|
||||
if (bundle != null){
|
||||
return bundle.getString(metaName);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public static String getApplicationLabel( Context context, String pkgName ) {
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
|
||||
Reference in New Issue
Block a user