Acquiring host address from manual WiFi Direct connection - android

I have connected 2 devices via WiFi Direct. This is done manually, and therefore no code has been written for this. In order to send data between the devices, I need the "client" to be able to acquire the host address for the "server".
Is this possible? And if so, any tips on how to go about it?
PS: I know very little of networking, so please excuse any faulty logic.

This is possible for sure. Even you can setup and automate wifi-direct connection via code.
here is nice repo you can refer. https://github.com/mayfourth/WiFi-Direct-File-Transfer

Related

Redirect Traffic in Hotspot Network

I'm not sure if this is possible, I'm trying to redirect traffic from a mobile app that is connected to the internet through a hotspot wifi from my laptop. The app is Sending requests to a cloud server, and the idea is that the traffic should first go through a proxy that is listening to a local port in my laptop, as per this rough sketch:
I believe this could maybe be solved using iptables, but I'm using Windows, I've looked into netsh but so far I haven't found a command (such as portproxy) that suits my needs, partly because I don't know if this is possible at all. I'm purposefully being a bit general here but if there's any questions we can go more in-depth.
Can someone give me a hint here?

Connect to Android TCP Server App from Internet (w/o Router): Impossible?

I'm trying to write an Android app to accept TCP connections from the Internet. Sounds simple but despite weeks of head-banging, I've found no solution and now believe it impossible. I would love to have someone tell me I'm wrong.
I was encouraged by the "ServerSocket()" API function. I was able to create a listening socket (e.g. on port 2000) and connect to it from another app within my device. Unfortunately I find it is bound to (unrouteable) local address 10.0.0.150 which, of course, cannot be seen from the Internet.
I was also able to successfully connect by pointing my device to my local WIFI router and using the router's "Port Forwarding" feature to relay incoming connections to MyPublicIp:2000 to 10.0.0.150:2000. But this is not usable in the field (over an LTE connection) where I have no router.
I've searched StackOverflow and other sites but found no good answer (but plenty of inapplicable or obtuse ones).
From my reading, I hear that most (all?) carriers do not allow incoming connections to be routed to user devices, which may explain my dilemma.
PLEASE: Someone tell me I'm wrong.
I think it is possible.
Looking information about my mobile operator (mobile provider): it can provide a static IP address and my mobile device is available for incoming sessions, but only need to pay for this service.

WiFi Direct Connectivity as a service

I am doing an android project. I am using wifi direct to establish communication between two modules. My doubt is that while using the wifi direct to connect to another device a dialog prompts whether to connect to that device. I want to avoid that prompt, It should be connected as it identifies a wifi module. that is by my understanding it should work as a background service. I am a beginner in android programming please help me out in solving this.
Thank You
Midhun

How to read the data of a dhcp server?

I want to know about all the device that are connected to the dhcp server.
I have the IP of the device it may be a android phone or printer but I think dhcp is having the information of this devices.
I got something like the "vendor information " in the dhcp protocol stack.
My doubt is I have to identify at least a android phone is on the network ,
Is it possible by this.or how to Identify a android phone is one the network.I have the IP of the android also but I am not getting any information from any way.
I got something like nmap but this tool is not giving a perticular details of the phone.The information provided by the nmap is confusing I am not able to identify whether it is a phone or a linux system as both the system having linux as the os.
Then i got this dhcp -vendor information : but I don't have any idea about how to read these data..
kindly give any suggestion.....Needed for my project.
Thanks
The problem you will have is that modern day switches will stop you sniffing traffic destined for specific MAC addresses so if its hard-wired then you are going to run into trouble. If on the other-hand its a unsecured WiFi connection, or a network with hubs (rare now!) rather than switches then you may have a chance.
You'd need to switch the ethernet controller into promiscuous mode and listen for the DHCP REQUEST and DHCP OFFER commands, inspect the contents and see whats going on.
Another method would be to listen for ARP and RARP requests on the network and use a hardware lookup table for the MAC id to determine who makes the chip-sets, its not going to give you awesome accuracy since a lot of chips are re-used on different devices but it may give you a little bit more info.
In terms of the DHCPd server, unless you have access to that physical machine I'm afraid your probably out of luck, DHCP is a designed as a offering protocol, not a querying protocol.

How do I get my Android app to communicate with the server over a VPN?

I have an android application that talks to a server app running on grails (Groovy on Grails).
Android app basically establishes a connection with this address:
url="http://192.168.2.53:8080/tma/majBtm/androidToDesktop";
It all works fine when both the server and the android phone are connected in the same lan network.
Now the problem arises when I want the phone to talk to the server while the phone is outside the local network (I need it to use edge).
I came across VPN networks which I think might help me out. (the server has dynamic IP)
So what i did was go to dyndns.com and created a new hostname and have the app successfully run on the server. The host I created was - tmagrails.dyndns.com
How do I make my phone connect to this network? What changes am I supposed to make in order to get things working?
Also, I really want to know if this is the right approach. If not, is there any way to get things going for me?
Please advice.
First you need to set up port forwarding so that port 8080 is forwarded to your 192.168.2.53 ip address. A google search on your router model should tell you how to do this. If you want to make your app more secure you will also need to look at SSL and TLS While this won't garantee your app is secure it will stop the network traffic to your app being easily read if you were to access it from an open wifi hotspot.

Categories

Resources