Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

android - Detect 3G or Wifi Network restoration -


is possible implement phonestatelistener(or other mechanism) detect when either 3g or wifi network connection restored ?

i see both listen_data_connection_state , listen_data_activity (cellular) in api's summary. mean 3g ?

thanks

better approach use android.net.connectivitymanager class. register receiver , monitor broadcasts.

private class connectionmonitor extends broadcastreceiver {      @override     public void onreceive(context context, intent intent) {         string action = intent.getaction();         if (!action.equals(connectivitymanager.connectivity_action)) {             return;         }         boolean noconnectivity = intent.getbooleanextra(             connectivitymanager.extra_no_connectivity, false);         networkinfo anetworkinfo = (networkinfo) intent             .getparcelableextra(connectivitymanager.extra_network_info);         if (!noconnectivity) {             if ((anetworkinfo.gettype() == connectivitymanager.type_mobile)                 || (anetworkinfo.gettype() == connectivitymanager.type_wifi)) {                 // handle connected case             }         } else {             if ((anetworkinfo.gettype() == connectivitymanager.type_mobile)                 || (anetworkinfo.gettype() == connectivitymanager.type_wifi)) {                 // handle disconnected case             }         }     } }  private synchronized void startmonitoringconnection() {     intentfilter afilter = new intentfilter(         connectivitymanager.connectivity_action);     registerreceiver(mconnectionreceiver, afilter); } private synchronized void stopmonitoringconnection() {     unregisterreceiver(mconnectionreceiver); } 

where

mconnectionreceiver = new connectionmonitor(); 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -