Code example for PackageManager.NameNotFoundException

Methods: printStackTrace

		try { 
			PackageInfo packageInfo = packageManager.getPackageInfo(
					getPackageName(), 0);
			version = packageInfo.versionName;
		} catch (NameNotFoundException e) {
		return version;
	public String getDownloadFormat() {
		return PreferenceManager.getDefaultSharedPreferences(this).getString(
				"download_format", JamendoGet2Api.ENCODING_MP3); 
	public String getStreamEncoding() {
		// According to JBQ: ogg files are supported but not streamable 
		return JamendoGet2Api.ENCODING_MP3; 
Stop searching for code, let great code find you!  Add Codota to your java IDE