Hello
List<NameValuePair> httpparams = new ArrayList<NameValuePair>();
httpparams .add(new BasicNameValuePair("user", androidUser));
httpparams .add(new BasicNameValuePair("pass", androidpassword));
URI uri = URIUtils.createURI("http", "yourUrl", -1, "/
youractionOrPage",
URLEncodedUtils.format(httpparams , "UTF-8"), null);
HttpGet httpget = new HttpGet(uri);
Enjoy
On Jul 27, 8:43 am, rajesh nair <[email protected]> wrote:
> Members,
>
> I have developed an application using which I can view mjpeg stream being
> streamed from my camera, on my android phone.
> It works fine if a user authentication is not required. But fails when the
> server requires a user authentication.
> Following code is used to read the Mjpeg stream.
>
> //url =http://xyz.xyz.xyz.xyz:80/xyz/mjpeg.cgi
> //usrid = admin
> //password = admin
>
> public static MjpegInputStream read(String url, String usrid, String
> password) {
> HttpResponse res;
> DefaultHttpClient httpclient = new DefaultHttpClient();
> try {
> res = httpclient.execute(new HttpGet(URI.create(url)));
> return new MjpegInputStream(res.getEntity().getContent());
>
> } catch (ClientProtocolException e) {
> } catch (IOException e) {}
> return null;
> }
>
> Could someone please explain to me how I can include the usrid and the
> password to the above code and make it work?
>
> Thanks in advance
> Rajesh
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en