本文介绍了如何找到Internet连接是否可用在Android上4G?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用以下code对于Wheather的Intenet连接如是否可用,它工作正常高达3G系统。但它不工作的4G技术。任何人都懂得如何找到Internet连接Avlable或不4克?如果任何机构有演示code的话,请提供它

I have used Following Code For Wheather Intenet conection is available or not, its works fine upto 3G systems. but Its not working for 4G technology. Anybody have idea about How find Internet connection is Avlable or not on 4g?if any body have democode for it, please provide it

code:

public static boolean checkConnection(Context c)
{
        ConnectivityManager mConnectivityManager = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
        TelephonyManager telephonyManager = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);

        if(mConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected() || telephonyManager.getDataState() == TelephonyManager.DATA_CONNECTED)
            return true;
        else
            return false;
    }

在此先感谢Nirav modh

Thanks in AdvanceNirav modh

推荐答案

使用TYPE_WIMAX
但它在API级别8

use TYPE_WIMAX
but it's in API level 8

这篇关于如何找到Internet连接是否可用在Android上4G?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-02 22:36