Sunday, October 14, 2012

How to disable the WiFi/any networking or add any network in android :
 
  In android framework, there is a file to configure available networks.
If we disabled particular network in that file, Particular network will be disabled in android.

name of the file need to be modified to disable networks:
frameworks/base/core/res/res/values/config.xml

This file contents are as below:
 
  translatable="false" name="networkAttributes">
        "wifi,1,1,1"
        "mobile,0,0,0"
        "mobile_mms,2,0,2"
        "mobile_supl,3,0,2"
        "mobile_dun,4,0,4"
        "mobile_hipri,5,0,3"
    
 
 
In android framework, Connnectivity manager/service is reponsible for handling available networks.
If I want to add new network, I have to develop a service,NetworkStateTracker  and add the content in the above file.
 
 
Let me say If I want to add ethernet support, ethernet service should be written, launched from ConnectivityService.
we need to develop our own NetworkStateTracker derived class to maintain the state of ethernet.
We also need to add new item in the above file.
   From the above file only, Android will comes to know the available networks.
Let me say if I removed the wifi item, then WiFi wont be detected. Because android framework doesnt know the wifi network is available 
 
 
 

No comments: