问题
I have developed one SIP based application which is not able to use an internet connection while debugging on an android device. But when debugging on the emulator it works properly. I have given all the permissions in manifest.xml regarding internet connection. Is there any other permission to use the internet connection to run an application on the device? here i have attached my manifest.xml.Any help and suggestions will be appreciated. `
<uses-feature android:name="android.hardware.sip.voip" android:required="true" />
<uses-permission android:name="android.permission.USE_SIP"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-feature android:name="android.hardware.wifi" android:required="true" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CALL_PRIVILEGED"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<application android:icon="@drawable/icon64" android:label="SipDemo" android:debuggable="true">
<activity android:name=".WalkieTalkieActivity"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service android:enabled="true" android:name=".WalkieTalkieActivity"/>
<service android:enabled="true" android:name=".Services"/>
<activity android:name=".WalkieTalkieActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SipSettings" android:label="set_preferences"/>
<activity android:name=".dialer" android:label="@string/app_name"/>
<activity android:name=".timer" android:label="@string/app_name"/>
<activity android:name=".d1" android:label="@string/app_name"/>
<receiver android:name=".IncomingCallReceiver" android:label="Call Receiver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"/>
</intent-filter>
</receiver>
</application>
`
回答1:
To access Internet the only Uses Permission needed is android.permission.INTERNET in Manifest. Please Check your Internet connectivity with a Browser in Phone first.
来源:https://stackoverflow.com/questions/9513943/application-unable-to-access-internet-on-device-while-working-properly-on-androi