How to get versionName in jni at cocos2d-x 3.0

I want to create an utility class to get current version of app (for android, it located in versionName).
With Build class, i could got platform version with these codes:

import android.os.Build;
public class UtilityTool{
public static String getPlatformVersion() {
return Build.VERSION.RELEASE;
}
}

But how to get versionName? If coding like these:

public class UtilityTool{

public static String getPlatformVersion() {
return Build.VERSION.RELEASE;
}

public void getAppVersion() {
PackageInfo pInfo = null;
try {
pInfo = getPackageManager().getPackageInfo(
“com.rubiconproject.testing”, PackageManager.GET_META_DATA);
} catch (NameNotFoundException e) {
return “1.0”;
}
return pInfo.versionName;
}

It will report error because getPackageManager which needs ‘extends Activity’
But in cocos2d-x 3.0, the Native Activity has replaced old Activity, so how to resolve this issue in 3.0 alpha?