Code example for UnsupportedEncodingException

Methods: getMessage

0
	 */ 
	public static InputStream stringToInputStream(String text) {
		try { 
			return new ByteArrayInputStream(text.getBytes("UTF-8"));
		} catch(UnsupportedEncodingException e) {
			Log.e(TAG + "stringToInputStream()  ", "Error occured" + e.getMessage());
			return null; 
		} catch(Exception e) {
			Log.e(TAG + "stringToInputStream()  ", "Error occured" + e.getMessage());
			return null; 
		} 
	} 
 
	/** 
	 * Check Internet connection availability. 
	 * @param context 
	 * @return  
	 */ 
	public static  boolean isNetworkAvailable(Context context) {
		if(context == null) { return false; }
		ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);