{"id":283,"date":"2020-01-03T10:02:55","date_gmt":"2020-01-03T10:02:55","guid":{"rendered":"http:\/\/vladymix.es\/?p=283"},"modified":"2020-01-03T10:02:55","modified_gmt":"2020-01-03T10:02:55","slug":"verificar-conexion-a-internet","status":"publish","type":"post","link":"https:\/\/vladymix.es\/wordpress\/index.php\/2020\/01\/03\/verificar-conexion-a-internet\/","title":{"rendered":"Verificar conexi\u00f3n a internet"},"content":{"rendered":"\n<p>Fuente:<\/p>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/32547006\/connectivitymanager-getnetworkinfoint-deprecated\">https:\/\/stackoverflow.com\/questions\/32547006\/connectivitymanager-getnetworkinfoint-deprecated<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\nNetworkInfo activeNetwork = cm.getActiveNetworkInfo();\nif (activeNetwork != null) { \n    \/\/ connected to the internet\n    if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {\n        \/\/ connected to wifi\n    } else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {\n        \/\/ connected to mobile data\n    }\n} else {\n    \/\/ not connected to the internet\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Fuente: https:\/\/stackoverflow.com\/questions\/32547006\/connectivitymanager-getnetworkinfoint-deprecated<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=283"}],"version-history":[{"count":3,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":286,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/283\/revisions\/286"}],"wp:attachment":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}