Pregunta

on developing an android app with webservices. which uses :

     <uses-sdk android:minSdkVersion="8"
         android:targetSdkVersion="8" />

I am facing problem while importing import android.os.StrictMode; (it cannot be resolved) my code is giving me an exception "java.net.SocketException: Permission denied for android" because of this.if the strictmode is not supported in api 8 . what is the alternative for it?

¿Fue útil?

Solución

Hey StrictMode Class was introduced in API Level 9 and your project target is API Level 8. Please Refer this link. So You are getting the error.

Otros consejos

Go to the AndroidManifest.xml file

In your File the minSdkVersion is 8

<uses-sdk android:minSdkVersion="8" />

Change The SDK version to 9 like shown below

<uses-sdk android:minSdkVersion="9" />

it will solve your problem.

And see below link for more information about StrictMode.

Android - StrictMode

If you still want to go with API Level 8.

Check this link :

Android StrictMode for all platform versions

Thanks.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top