-
-
Save fnzainal/7623f32ad0983610df29967fedcd032c to your computer and use it in GitHub Desktop.
android build details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example; | |
import android.app.Activity; | |
import android.content.pm.PackageManager; | |
import android.content.pm.PackageInfo; | |
class PackageManagerInfo extends Activity { | |
public void onCreate() { | |
super.onCreate(); | |
try { | |
PackageInfo packageInfo = getPackageManager() | |
.getPackageInfo(getPackageName(), 0); | |
String versionName = packageInfo.versionName; | |
int versionCode = packageInfo.versionCode; | |
String packageName = packageInfo.packageName; | |
} catch (PackageManager.NameNotFoundException e) { | |
e.printStackTrace() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment