Last active
December 21, 2015 04:39
-
-
Save teofiloisrael/6251624 to your computer and use it in GitHub Desktop.
Para poder acceder a webservices desde un dispositivo Android.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Muchas veces los permisos de internet en el AndroidManifest.xml no son sufucientes. | |
//Si en el emulador los webservices remotos funcionan bien, peron en el dispositivo real retornan null, | |
//es posible que se necesit configurar esto: | |
//nota: hay que colocar esto encima de la declaracion de la clase: | |
//@TargetApi(Build.VERSION_CODES.GINGERBREAD) | |
if (android.os.Build.VERSION.SDK_INT > 9) { | |
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | |
StrictMode.setThreadPolicy(policy); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment