I see. You are in a closed environment, the routers are under your
control, and you need centralized administration.
Personally, I would set it up like this:
- Phone app: BroadcastReceiver watches for
WifiManager.NETWORK_STATE_CHANGED_ACTION.
When it sees that a Wifi connection has been established, it starts a
service.
The service fetches a special URL from the currently connected router,
passing in the necessary information like device ID, maybe MAC/IP
address, firmware version, whatever. The router's address is the network
gateway, so it doesn't have to be hard-coded in the phone app.
- A special URL on the router, using PHP or whatever returns information
about whether your activity should be started, using whatever logic you
deem necessary.
- Back to phone app: using the information fetched from the router,
displays the activity or does nothing.
If there are several routers, it would be better to set up one
centralized server, reachable through all the routers, that would host
the URL described above. . Then you'd have one place to manage the
configuration (i.e. which phones should display the activity).
-- Kostya
03.08.2010 16:04, StillALearner пишет:
Well Kostya , thanks again..
"Unless the router is under your control"
Yes, am trying with a Router that is configurable and controlled by
us.
"A MAC address is just that - a MAC address, in this case, the Wifi
router will see the address of the phone's Wifi adapter. It has
nothing
to do with any other IDs, such as the cellular network's IMEI, etc.
But
it's guaranteed to be unique."
Got that, but wat i really need to understand is if
android.provider.Settings.System.ANDROID_ID and the physical
(MAC)address that gets logged in the Router are the same ?
"The central issue is where exactly (phone vs. router) you are able to
run the necessary code. It's easy to do on the phone"
Well, here is my scenario
I need to invoke an activity X (via Notification manager ) when am
in Access Point 'A'.Assuming neccessary logic is at the mobile end.
Now when i add a new access point 'B' and need to invoke X (when am
in AP 'A' or 'B') , in this case i need to change the code at mobile
end isn't it ?
All i need is to avoid that.
Rephrasing that ,
Mobile devices has to be independent of the logic written to invoke
notification mgr to call my activity as i need that logic to be
dynamically decided at the server end.
am trying if something like a push notification sent to the device
when in a specific n/w would work out ?! N figuring out like hw 2
implement that !!
Let me know if thats feasible or if am missing out something.
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en