android - 计算各大洲服务器的下载速度/丢包/抖动/延迟值 (Android)

标签 android network-programming video-streaming rtsp packet

我需要计算以下内容:

  • 上传,
  • 下载速度
  • 丢包
  • 抖动
  • 各大洲服务器的延迟
  • 本地和有关移动运营商的详细信息

谁能告诉我跟踪这些东西的最佳方法是什么?

我需要准确度才能

最佳答案

请找到获取延迟的代码。如果它解决了您的问题,请将其标记为解决方案,以便帮助其他人找到答案。

public String getLatency()
         {
            String latency ="";
                    String ip = "ip address of the server";
                    String pingCmd = "ping -c 25 " + ip;
                    try {
                        Runtime r = Runtime.getRuntime();
                        Process p = r.exec(pingCmd);
                        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                        String inputLine;
                        String latencyResult = null;
                        while ((inputLine = in.readLine()) != null)
                        {
                            latencyResult = inputLine;
                        }
                        String[] keyValue = latencyResult.split("=");
                        String[] value = keyValue[1].split("/");
                        latency = value[1];                  
                    }
                    catch (Exception e)
                    {
                      LogWrite.d(TAG, "Exception..."+e);
                    }
            return latency ;                    
             }`

关于android - 计算各大洲服务器的下载速度/丢包/抖动/延迟值 (Android),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21255416/

相关文章:

c - 通过 UDP 套接字发送缓冲区时,延迟有时会增加

java - com.google.gson.JsonSyntaxException : java. lang.IllegalStateException:应为 BEGIN_OBJECT 但在第 1 行第 2 列为 BEGIN_ARRAY

java - 功能 android 模块 - 不允许使用应用插件 : 'com.android.feature'

java - 如何指定要在 SSL session 中使用的密码套件

python - DNS 响应未到达目的地

android - 是否可以在 YouTube Android 播放器上叠加一些 View ?

android - 如何获得两个位置之间的行驶距离?

android - VideoView 播放状态或 MediaController 播放/暂停的事件

ffmpeg - 通过 ffplay 播放 USB 网络摄像头流时获取 "unable to decode APP fields"

c# - 在 ASP.NET 中上传流和播放视频