[android-developers] Re: HttpURLConnection headers

2009-10-06 Thread Kiran Mudiam

Hello Lucas,
Have you been able to solve this problem.

I have tried to use the apache httpclient classes to get my networking
going and that does not seem to help either.

I am interested in the x-up-subno header that ATT adds.

I looked thro the source of the WebView, WebViewCore, BrowserFrame
classes from the android src and noticed that the loading is happening
via a native method

-
 public void loadData(String baseUrl, String data, String mimeType,
String encoding, String failUrl) {
mLoadInitFromJava = true;
if (failUrl == null) {
failUrl = ;
}
if (data == null) {
data = ;
}

// Setup defaults for missing values. These defaults where
taken from
// WebKit's WebFrame.mm
if (baseUrl == null || baseUrl.length() == 0) {
baseUrl = about:blank;
}
if (mimeType == null || mimeType.length() == 0) {
mimeType = text/html;
}
nativeLoadData(baseUrl, data, mimeType, encoding, failUrl);
mLoadInitFromJava = false;
}
--


thanks,
kiran

On Sep 16, 12:23 pm, Lucas roll...@gmail.com wrote:
 That is not an option. Because also i need some more headers that are
 not being added and that i can't add by hand.

 Indeed once of the headers i need is added by the operator APN, and
 for some reason when connecting by code it is
 not being added.

 Below there is more info about this:

 Here are the headers i get when connecting though 
 browser:http://bannergame.googlecode.com/files/device_browser.png

 And here the ones i get when connecting through 
 code:http://bannergame.googlecode.com/files/device_code.png

 The header i need besides the User-Agent is the **x-up-subno*** which
 is a special header that ATT adds and identify the GSM seem card that
 the device is using.

 Do you know why this is not added? How can i force the connection
 though the APN wap setting? Or how can i mimic Webkit connection from
 code?

 Thanks,

 Lucas

 On Sep 15, 7:37 pm, Mark Murphy mmur...@commonsware.com wrote:



  rollbak wrote:
   Does anyone know we i get different behaviors?

  Because WebKit does not useHttpURLConnection.

   How i can i connect in the same way the browser does?

  Set your own User-Agent header via methods onHttpURLConnection.

 http://stackoverflow.com/questions/480153/how-to-modify-the-header-of...

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  _Beginning Android_ from Apress Now Available!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: HttpURLConnection headers

2009-09-16 Thread Lucas

That is not an option. Because also i need some more headers that are
not being added and that i can't add by hand.

Indeed once of the headers i need is added by the operator APN, and
for some reason when connecting by code it is
not being added.

Below there is more info about this:

Here are the headers i get when connecting though browser:
http://bannergame.googlecode.com/files/device_browser.png

And here the ones i get when connecting through code:
http://bannergame.googlecode.com/files/device_code.png

The header i need besides the User-Agent is the **x-up-subno*** which
is a special header that ATT adds and identify the GSM seem card that
the device is using.


Do you know why this is not added? How can i force the connection
though the APN wap setting? Or how can i mimic Webkit connection from
code?

Thanks,

Lucas

On Sep 15, 7:37 pm, Mark Murphy mmur...@commonsware.com wrote:
 rollbak wrote:
  Does anyone know we i get different behaviors?

 Because WebKit does not useHttpURLConnection.

  How i can i connect in the same way the browser does?

 Set your own User-Agent header via methods onHttpURLConnection.

 http://stackoverflow.com/questions/480153/how-to-modify-the-header-of...

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _Beginning Android_ from Apress Now Available!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: HttpURLConnection headers

2009-09-15 Thread Mark Murphy

rollbak wrote:
 Does anyone know we i get different behaviors? 

Because WebKit does not use HttpURLConnection.

 How i can i connect in the same way the browser does?

Set your own User-Agent header via methods on HttpURLConnection.

http://stackoverflow.com/questions/480153/how-to-modify-the-header-of-a-httpurlconnection

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Beginning Android_ from Apress Now Available!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---