Code example for ConnectException

0
	public static void setCommonParams(List<NameValuePair> params) throws ConnectException {
		if (appContext == null) {
			throw new ConnectException("The appContext is null.");
		} 
		if (TextUtils.isEmpty(app_id)) {
			throw new ConnectException("The app_id is null.");
		} 
		if (params != null) {
 
			params.add(new BasicNameValuePair("client_type", "android"));
			params.add(new BasicNameValuePair("mac", mac));
			params.add(new BasicNameValuePair("app_id", app_id));
			params.add(new BasicNameValuePair("version", v));
			params.add(new BasicNameValuePair("latitude", latitude == 0 ? "" : String.valueOf(latitude)));
			params.add(new BasicNameValuePair("longitude", longitude == 0 ? "" : String.valueOf(longitude)));
		} 
	} 
 
	private static void setAuthInfo(String host, boolean isDev) {
		if (BetterHttp.getHttpClient() != null) { 
			if (isDev) {