You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- This will probably be the answer, once I check it, I will accept it. It's really interesting, but I don't need to know if the server is a Hotspot, since there's no server in my application (all the devices send and receive UDP broadcasts). Thank you very much.olivarra1– olivarra12012-12-29 17:04:43 +00:00Commented Dec 29, 2012 at 17:04
- There's a small problem with that code. This checks for all interfaces, and if it's not the loopback, then it sets the address to that loopback. But I tried it in my device, and it has 3 interfaces, the loopback (127.0.0.1) that gets discarted correctly, the Hotspot (192.168.1.1) and the "ISP" (10.52.121.XXX). Then it doesn't get the Hotspot wifi, but the last interface there is (in my case, it was the ISP one). Checking if the IP is a private one should be enough anyway, but is there any other way of fixing that?olivarra1– olivarra12013-01-01 10:23:50 +00:00Commented Jan 1, 2013 at 10:23
- I have updated my answer you can check that now there is one more condition, where name of interace is checked. Names differs on different phone but usually it is eth0 or wlan0, but it should be checked if there are some other names used for wifi interfaceMP23– MP232013-01-01 14:57:26 +00:00Commented Jan 1, 2013 at 14:57
- yes, there is another name. In my case it is the ap0.Gaucho– Gaucho2014-10-13 14:55:45 +00:00Commented Oct 13, 2014 at 14:55
- 1FYI, Samsung devices use a different address, I believe it is 192.168.68.1Jared– Jared2014-11-26 21:30:24 +00:00Commented Nov 26, 2014 at 21:30
| Show 1 more comment
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. python-3.x), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
default