When executing an HttpUriRequest
using the AndroidHttpClient
, it will throw an java.lang.IllegalArgumentException: Host name may not be null
when the url is faulty.
In my application, the user can input his own url. When for example http://195.168.0.q
is entered, the IllegalArgument
is thrown, and the app crashes.
How can I prevent this (preferably, without catching exceptions)?