• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connecting Internet from android code

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am only able to connect internet through emulator browser. I am not able to connect to Internet through application code even after setting proxy in emulator and also inserting values to system table. It is throwing unknown host exception. I tried with one more option that setting proxy in application Run Configuration. But it is throwing Authentication scheme ntlm not supported error. I have given Internet permission in manifest also. Please let me know some solution for connecting Internet through code.

Thanks & Regards,
Rashmi
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version of SDK are you using?
 
rashmi swamy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
android SDK 2.2
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For 2.2, you don't have to explicitly setup proxy in the emulator(i.e. you wont have to change an entry in the System table, nor start with -proxy switch, neither would you have to create additional APNs).

In your java code, if you are running from behind a proxy just add your credentials to the HttpClient instance.

Something like:

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The 2.2 emulator has an issue with networking that most real devices don't have (namely, it doesn't support IP6). Try a 2.1 emulator or an actual 2.2 device.
 
rashmi swamy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankyou Monu.
I have put your code in my activity class and trying load www.google.com through web view. But it is not working. Please give me some solution.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:The 2.2 emulator has an issue with networking that most real devices don't have (namely, it doesn't support IP6). Try a 2.1 emulator or an actual 2.2 device.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic