Code example for JSONException

0
	} 
 
	private static void checkEmptyJson(JSONObject json, String key)
			throws JSONException { 
		if (json == null || key.equals("")) {
			throw new JSONException("Empty JSON or key");
		} 
	} 
 
	// code for getting app names 
	// taken from 
	// http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon 
	// thx guys :-) 
	static class PInfo { 
		private String appname = "";
		private String pname = "";
		private String versionName = "";
		private int versionCode = 0;
		@SuppressWarnings("unused") 
		private Drawable icon;