[android-developers] InetAdress bug or documentation ambiguity or some other explanation?

2010-12-27 Thread bc
I am stumped. InetAdress.isReachable simply does not work. By that I
mean, it always returns false for an external host.

I have tried searching the internet to see if anybody else is having
the same problem, I have found a few people have had the same problem,
but cannot really find an explanation why.

I have tried this on multiple devices with the same result.

boolean blnResult =
InetAddress.getByName(localhost).isReachable(2);

The above line of code works every time. If I change the localhost
to an external host that I can verify isReachable, the result is
always false.

blnResult =
InetAddress.getByName(www.google.com).isReachable(2);
blnResult = InetAddress.getByName(4.2.2.2).isReachable(2);

The above lines always return false, even though I can use a terminal
emulator on the same device and get a true result.

Can somebody more experienced with Android or perhaps a Google
engineer please give a plausible explanation for this.

-- 
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: InetAdress bug or documentation ambiguity or some other explanation?

2010-12-27 Thread bc
Thank you for the replies.

Perhaps I should give a little background on this phenomena. A few
years ago I created a free server monitor. The monitor has always had
ping checks, port checks, and http(s) checks. I was doing ping checks
via the isReachable method. I have never had issues with the
isReachable method until recently. By recently I mean late last
summer, I began getting more and more complaints from users that ping
is not working. I usually gave the canned response to ping not working
because the ping portion of the application had been stable and
working for about a year and a half.

Now, as it turns out, I cannot get it to work.

I am thinking I need to remove the Ping feature from my application.
However, the backlash from users when a feature is removed is usually
quick and severe. Even though the application is free I really want
this to be a last resort. Is there an alternative to isReachable?





On Dec 27, 11:54 am, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Dec 27, 2010 at 12:46 PM, bc clarkbrianc...@gmail.com wrote:
  I am stumped. InetAdress.isReachable simply does not work. By that I
  mean, it always returns false for an external host.

  I have tried searching the internet to see if anybody else is having
  the same problem, I have found a few people have had the same problem,
  but cannot really find an explanation why.

  I have tried this on multiple devices with the same result.

  boolean blnResult =
  InetAddress.getByName(localhost).isReachable(2);

  The above line of code works every time. If I change the localhost
  to an external host that I can verify isReachable, the result is
  always false.

  blnResult =
  InetAddress.getByName(www.google.com).isReachable(2);
  blnResult = InetAddress.getByName(4.2.2.2).isReachable(2);

  The above lines always return false, even though I can use a terminal
  emulator on the same device and get a true result.

  Can somebody more experienced with Android or perhaps a Google
  engineer please give a plausible explanation for this.

 http://stackoverflow.com/questions/2935325/android-debugging-inetaddr...

 isReachable() attempts to connect to port 7, which may be eaten by
 firewalls. This is a legacy holdover from Java -- I would recommend
 trying to do something more meaningful, like an HTTP GET request on a
 known good URL if you are trying to see if a Web service is reachable.

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

 Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
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] InetAddress.isReachable

2010-12-25 Thread bc

Has anybody else had any problems using isReachable?

boolean _blnStatus =
InetAddress.getByName(localhost).isReachable(55000);

I have tried unreasonable timeouts (55000 ms) and it never works? When
I use localhost it returns true almost instantly. If I try an external
host (one I know that is working) it always returns false after the
timeout.

I have verified this issue on the emulator, HTC G1 (ADP1) running 1.6,
and an HTC Incredible running 2.2 update 1. I have tried both SDK r06
and r08.

I am completely stumped. This has always worked in the past. Only
recently have I noticed this no longer works. Has something changed in
the API?

-- 
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] How to get phyaddr from MemoryHeapPmem??

2009-05-22 Thread bc

hi,
i add pmem and pmem_adsp to my kernel,and mydroid is working fine.but
i can only get virtaddr from MemoryHeapPmem(use getBase()),i can not
get phyaddr,but the pmem driver can use PMEM_GET_PHYS to get
phyaddr,so ,i must modify MemoryHeapPmem,add a method like getPhyAddr
() ?is here other way?
thanks.
--~--~-~--~~~---~--~~
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: native C++ SIP stack on Android

2009-02-07 Thread bc

i port a sip stack,and use jni,it can work now,but,how can i let phone
use the stack,just like gsm?

On Jan 9, 1:08 am, David Turner di...@android.com wrote:
 first, you cannot have C++ code in the kernel.

 however, depending on how your stack is designed, you may be able to use it
 from Java through JNI

 given that you give absolutely no information about your stack's interface,
 it's really difficult to answer your question

 On Thu, Jan 8, 2009 at 5:57 PM, pinguin e...@vinacom.de wrote:

  Can i port SIP stack written in C++ to android and let it running as
  service in kernel ?
  and the GUI will communicate with SIP stack through JNI ?

--~--~-~--~~~---~--~~
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] sip ua in android

2009-02-07 Thread bc

i port a sip ua(osip) for android,it can work in android,but,how can i
warp this as a part of android phone,jast like gsm?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---