Back to project page MordazaCrush.
The source code is released under:
GNU General Public License
If you think the Android project MordazaCrush listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.confederacionpirata.mordazacrush; // w w w .ja va 2 s. c o m import android.app.Application; import android.content.Context; import android.content.pm.PackageManager.NameNotFoundException; public class MCApp extends Application { public static final String LOGTAG = "MordazaCrush"; private static Context context = null; private static String appVersionName; private static int appRevision; public static Context getContext() { return context; } @Override public void onCreate() { super.onCreate(); // app context context = super.getApplicationContext(); // version try { android.content.pm.PackageInfo pi = getPackageManager() .getPackageInfo(getPackageName(), 0); appVersionName = pi.versionName; appRevision = pi.versionCode; } catch (NameNotFoundException e) { e.printStackTrace(); } } public static String getAppVersionName() { return appVersionName; } public static int getAppRevision() { return appRevision; } }