how to check in intenet connction is avaliable

by RTX » Mon, 01 Jun 2009 05:19:08 GMT


Sponsored Links
 some times when internet connction is down for conctivity reasons
my app crashes
i want to know how to check intrnet connction before i make a request
ftom the web

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



how to check in intenet connction is avaliable

by Mark Murphy » Mon, 01 Jun 2009 05:21:54 GMT


 


 http://developer.android.com/reference/android/net/ConnectivityManager.html 

You might try requestRouteToHost() or getActiveNetworkInfo().

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

Warescription: Three Android Books, Plus Updates, $35/Year

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


Sponsored Links


how to check in intenet connction is avaliable

by Mark Murphy » Mon, 01 Jun 2009 18:53:34 GMT


 


The OP needs try/catch, to be certain. I held that truth to be
self-evident. ;-)

However, there is merit in determining at a point in time whether
Internet connectivity exists. For example, you might disable menu
choices that imply the use of a connection.

In this case, I assumed he wanted those connectivity methods as part of
his diagnostics, to confirm his suspicion that the device indeed had no
connectivity at the time of the crashes.

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

Need help for your Android OSS project?  http://wiki.andmob.org/hado 

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



Other Threads

1. easy stuff please reply

hello guys i am writing the data in text file with help of

 fos = new FileOutputStream(file);
               out1 =new OutputStreamWriter(fos);
               out=new DataOutputStream(fos);
               String Dpass = new String ("1008");

               out.writeChars(Dpass);

but in file due to char it is leaving space after each charactor.so
how should i store so the will be no sapce.


also which api should i used to delete containt of the file?

thank you
--~--~---------~--~----~------------~-------~--~----~

2. Youtube request - search

I have a request about YouTube APK.
I'm using G2 and Galaxy, but there're some inconvenient functions in
search.
Please check the process below.

[Occurrence Process]
1. menu
2. youtube
3. press manu key - Search - type 'car'
4. press scroll videos to down until they stop ''loading more videos''
5. count displayed videos and compare with information about search
result (number of searched videos)


I've checked that Youtube was displayed '1000000 results for "car"'
But only 100 videos were searched.
I know that YouTube mobile can get 1000 results from video search.
(http://code.google.com/apis/youtube/faq.html#over_1000)

So for UX, please improve next Youtube APK as,

- there should be possibility to enter others results "next page" or
"show more results'' "show all results''
or
- there should display correct searching count and also display
limitation search count using Context or Toast Noti.

Please check this request and apply in next version.

Br,
Zeros.
--~--~---------~--~----~------------~-------~--~----~

3. Any else having problems with Market publishers site?

4. Text View

5. nfs

6. Itemized overlay and Hellomapview

7. How to reference (icon) drawables delivered with Android in XML