문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top