嗨,我无法理解为什么我的
Android应用程序通过WiFi访问互联网时不起作用.该应用程序能够在使用自己的3G连接时工作.它没有连接到WIFI.但如果我通过WiFi(网络共享)分享我的iPhone中的3g连接,Android设备可以访问服务器.我在各种设备中检查了应用程序,并将清单更改为如下,仍然没有响应.
未连接的代码是登录页面.我按照正常的PHP脚本,但它没有连接到WiFi中的脚本,
提前致谢
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cs.nott.ac.uk.app"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:name="android.hardware.wifi" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:icon="@drawable/launch"
android:label="@string/app_name" >
<activity
android:name=".activities.LoginActivity"
android:clearTaskOnLaunch="true"
android:icon="@drawable/ic_launcher"
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=".activities.MainActivity"
android:clearTaskOnLaunch="true" >
</activity>
<activity android:name=".activities.qr.RefresherActivity" >
</activity>
<activity android:name=".activities.SummaryActivity" >
</activity>
<activity android:name=".activities.management.ManagementandReflection" >
</activity>
<activity android:name=".activities.qr.QR_MaterialActivity" >
</activity>
<activity android:name=".activities.qr.Starting_offActivity" >
</activity>
<activity android:name=".activities.qr.DifferentialActivity" >
</activity>
<activity android:name=".activities.qr.ThingsActivity" >
</activity>
<activity android:name=".activities.qr.InvestigationsActivity" >
</activity>
<activity android:name=".activities.qr.RisksActivity" >
</activity>
<activity android:name=".activities.qr.TeachingActivity" >
</activity>
<activity android:name=".activities.management.SocialActivity" >
</activity>
<activity android:name=".activities.management.PsychologicalActivity" >
</activity>
<activity android:name=".activities.management.BiologicalActivity" >
</activity>
<activity android:name=".activities.management.AssessmentActivity" >
</activity>
<activity android:name=".activities.management.ReflectionsActivity" >
</activity>
<activity android:name=".activities.management.learningActivity" >
</activity>
<activity android:name=".activities.SummaryPatientsActivity" >
</activity>
<activity android:name=".activities.FinalSummaryActivity" >
</activity>
<activity
android:name=".activities.ConfirmActivity"
android:clearTaskOnLaunch="true" >
</activity>
</application>
</manifest>
最佳答案 通过创建用于身份验证的新线程解决了该问题,这对于应用程序在4.0或更高版本上工作是必要的