Android experience in cmwap and other proxy access points
Text/rslhg
1. Some Rom will still get the proxy value set by cmwap In the WiFi environment, so when getting the proxy, judge the mobile network environment. If it is GPRS, no proxy will be obtained.
Connectivitymanager = (connectivitymanager) Context
. Getsystemservice (context. connectivity_service );
Networkinfo activenetworkinfo = connectivitymanager
. Getactivenetworkinfo ();
If (activenetworkinfo! = NULL ){
Int type = activenetworkinfo. GetType ();
// Todo prevents the mobile agent from reading data under WiFi
If (type = connectivitymanager. type_mobile ){
// Fetch proxy
} Else {
// Do not retrieve the proxy
}
}
2. when some rom WebKit are in cmwap, WebKit cannot be connected or is disconnected, you need to add webview in onresume. enableplatformconfigurications ();, onstop add webview. disableplatformconfigurications ();. However, if you need to load the page as soon as you enter this activity, the first page of load will not be loaded and will stay for a long time without error pages and do not call webviewclient. onreceivederror. I have tried sethttpauthusernamepassword.
Personal solution:
Mwebpage. Post (New runnable (){
@ Override
Public void run (){
Mwebpage. loadurl (URL );
}
});
At this time, the first load page will soon call webviewclient. onreceivederror. You can set a flag in webviewclient. onreceivederror and reload the first page.