Moorhen Apps Blog

Moorhen Apps: creators of high quality Android Apps, Themes and Wallpapers

Securing HTTP connections with Android

September11

I’ve seen a lot of people suggesting really complex solutions to how to use Basic Auth on Android, it’s actually really simple, it’s just:

poster.addHeader(BasicScheme.authenticate(
new UsernamePasswordCredentials(username,password), "US-ASCII", false));

Full usage example:

final HttpPost poster = new HttpPost(Constants.COMMAND_URL);
poster.addHeader("Content-Type", "application/json; charset=utf-8");
				
poster.addHeader(BasicScheme.authenticate(
new UsernamePasswordCredentials(username,password), "US-ASCII", false));
				
final HttpParams params = new BasicHttpParams();
params.setParameter(CoreProtocolPNames.USER_AGENT, Constants.UA);
HttpConnectionParams.setConnectionTimeout(params, cmd.connTimeout);
HttpConnectionParams.setSoTimeout(params, cmd.soTimeout);
				
HttpClient client = new SSLHttpClient(params);
client = client.sslClient(client);
final HttpResponse response = client.execute(poster); 

Thanks to http://janis.peisenieks.lv/en/76/english-making-an-ssl-connection-via-android/

Android doesn’t really work well with SSL, so use these files:
http://www.moorhenapps.com/code/SSLHttpClient.java
http://www.moorhenapps.com/code/SSLFactory.java

Our Sister Site is Live

June20

Many of you know that Moorhen Apps branched out into creating websites earlier in the year. Well we’ve had such a success doing this that we’ve made this into a sister company, White Wolf Web Designs. You can see some of the wonderful things we offer at www.whitewolfwebdesigns.com. We do template based websites (cheap and quick), flash websites, wordpress websites, custom websites and many more. Plus printed and digital advertising. So feel free to browse around and contact us for more information.

Moorhen Apps joins Facebook!

May30

Do you love our apps, games, themes or wallpapers ? Have you had a site created by us ? Well if so you could consider liking us on Facebook. And as a little added incentive, if we get 100 likes by the end of June then we’ll give 10 half price website vouchers to 10 lucky winners. If we find this works out well then we’ll keep up the targets until August, with some very nice prizes to give away!

Ghost guide problems

May30

We are having technical problems with our servers. We apologise for this, and aim to have the service working as soon as possible.

Please bare with us, thank you.

posted under About Us | No Comments »

New Cookie Law

May17

New laws passed recently requiring all EU websites to ask users permissions to read or write cookies (A cookie stores information such as your facebook login so that you don’t have to login all the time, wikipedia link) on their website. We are not compliant with this law, but are working towards it. However, we feel that this law harms EU business’, some people are estimating it will cost £10 billion for the UK to become compliant. Please help fight this, by signing the petition here.

More information at nocookielaw.com

« Older Entries