Since your intent is to launch something on the phone, I don't see why you would want to detect connection on the Wifi router side.

In your app, watch for broadcast actions defined here:

http://developer.android.com/reference/android/net/wifi/WifiManager.html

In particular, NETWORK_STATE_CHANGED_ACTION is fired whenever Wifi connection is established or broken.


As for automatically invoking an activity - I would suggest you use a Notification, which would launch an activity when selected. Displaying an Activity in the middle of whatever the phone user is doing is just plain wrong.


Finally, if you still want to detect established connections on the router/hotspot side, you'd need to add something to the router's firmware. More specifically, you'd need to add code or scripts to its DHCP server implementation.

This might be easy with some routers (e.g. running DD-WRT or the like), and much more difficult, or impossible, with others.

If you did, you'd be able to use the phone's MAC address as the unique identifier you require. However, without implementing yet another router / phone protocol, you'll never know if a connecting device is Android based.

-- Kostya

30.07.2010 11:37, StillALearner пишет:
Hello All,
I am trying to create an application based on Wi-Fi and i would need
some suggestion on the same ,
The scenario am trying is,say, when a user with our android
application enters a specific Wi-fi Hotspot, i need an activity to be
invoked from my app.
Basically I can have a service running as a part of my app and
whenever i scan for that specific hot-spot i can call up the
activity , BUT , i need to do the otherway round.. i mean instead of
running a service in the mobile and utilizing its resource, i want the
Wi-fi Hotspot to monitor and if the device is inside the vicinity it
needs to invoke a notification from which the activity can be
invoked...
Few things that i would like to understand is
I) When a wifi hot-spot is detected in our android phone what actually
happens at the Wi-Fi Hot spot end ??
2) When our device obtains an IP address from the wi-fi n/w will our
device's unique ID or its equivalents be available at the wi-fi
provider end ??



--
Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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

Reply via email to