+ final String user=PreferenceManager.getDefaultSharedPreferences(context).getString("username", null);
+ final String password=PreferenceManager.getDefaultSharedPreferences(context).getString("password", null);
+ if(user == null || password == null)
+ return commands;
+
+ conn.setRequestProperty("Authorization", "Basic "+Base64.encodeToString(
+ (user+':'+password).getBytes(), Base64.NO_WRAP));