Network Unreachable (Socket.net Exception)

by Frank Weiss » Sun, 07 Feb 2010 11:15:10 GMT


Sponsored Links
 Re your question about implementing a service that polls for updates, please
look at some of the sample code. For example, Romain Guy's Photostream demo
application has a background service that polls the Flikr API webservice for
updates and displays a notification in the notification bar. AFAIK whether
the access is by phone network or WiFi is functionally irrelevant.

--



Network Unreachable (Socket.net Exception)

by Frank Weiss » Mon, 08 Feb 2010 09:07:22 GMT


 Is the service completely crashing due to the exception or does the service
continue to get the exception subsequently? Are you perhaps wrongly assuming
that the phone is connected to the internet whenever you want it to be?

--


Sponsored Links


Network Unreachable (Socket.net Exception)

by Frank Weiss » Mon, 08 Feb 2010 10:50:10 GMT


 The network unreachable error is always a networking problem. Could be the
local network interfaces (wifi and phone) are turned off or temporarily
disabled, a bad network mask setting, or some router is unable to route an
IP address. It may also be an ipv6 config error. It may be occuring while
trying to resolve DNS (DNS server is unreachable). I have some suggestions:

1) Describe the network environment: emulator or device (which device) WiFi
on or off, wireless network carrier, local network configuration, including
firewalls (if using emulator or WiFi).
2) Test the application in a different network environment (home, office,
friend's house, cafe).
3) Add code that when the exception occurs, tries to access the network by
some other means besides HttpUrlConnection.
4) As 3), but try using a different Android application that accesses the
internet.
5) Try using an IP address instead of hostname.
6) I forgot to add, once the error occurs, how do you get the service to
connect again?

--



Other Threads

1. Cannot access Phone Number on HTC G1

Hi,

I have an application which is trying to access the Phone Number. It
has the Access rights to:
android.permission.READ_PHONE_STATE
and this works in the emulator, however, on my phone it doesn't seem
to be able to access the number. When I go into:
Home => Menu => Setting => About phone => Status
third from the top is 'Phone number' however it has nothing below this
text, that is there is no phone number listed.

I suspect that this is obtained from the SIM card, but I could be
wrong. Does anyone know where I might be able to configure this or
where the number comes from?

Note that if I call someone, my phone number turns up on his/her
phone.

Thanks for any help.

Julius.
--~--~---------~--~----~------------~-------~--~----~

2. Cheatsheets.

Hi. Are there some cheatsheets for Android's SDK? I mean, UI objects
and common things.

Thanks!

--~--~---------~--~----~------------~-------~--~----~

3. For brazilian users and developers...

4. Source code of Gallery Application

5. OMA DM Support

6. Failed to prepare partial IU? Can't install Eclipse plugin.

7. displayDeleteDialog