bertrandmartel / speed-test-lib

:cloud: JSpeedTest : speed test client library for Java/Android
MIT License
381 stars 119 forks source link

onError -- reports back URL #42

Closed profvjreddi closed 7 years ago

profvjreddi commented 7 years ago

Hi,

Great tool. Thank you for providing it.

I am using it in Android, but I am having trouble.

I get an error message. In the onError callback shown below I get the message as the URL. It simply spits out the primary URL path. Callback is shown below, and so is the logged error message.

                @Override
                public void onError(SpeedTestError speedTestError, String errorMessage) {
                    Log.d("onError", "[ERROR] " + errorMessage);
                }

E.g. error message: 05-12 20:01:06.749 2583-3688/com.google.uxbandit D/onError: [ERROR] ipv4.bouygues.testdebit.info

What does it mean to get such an error message? When I access the URL i actually provide "http://ipv4.bouygues.testdebit.info/1M.iso" to start download it all works well elsewhere, as in I am able to download the file through my computer, as well as the Android emulator.

Thanks, vj.

bertrandmartel commented 7 years ago

Hello, can you print the speedTestError to see what type of error shows ?

profvjreddi commented 7 years ago

Hi,

I am running the app on the emulator and it looks like android emulator is having trouble resolving the hostname, as you can see in the attached image:

On May 13, 2017, at 1:04 AM, Bertrand Martel <notifications@github.com mailto:notifications@github.com> wrote:

Hello, can you print the speedTestError to see what type of error shows ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bertrandmartel/speed-test-lib/issues/42#issuecomment-301228001, or mute the thread https://github.com/notifications/unsubscribe-auth/AGfhlCP5r6_VTGnIUkdoQuTox2j4Ial_ks5r5UfWgaJpZM4NZ6sW.

https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png https://github.com/bertrandmartel/speed-test-lib https://github.com/bertrandmartel/speed-test-lib/issues/42#issuecomment-301228001

profvjreddi commented 7 years ago

Ah fixed it — needed to add the second line for instance in addition to the internet only .. odd.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

On May 13, 2017, at 5:07 AM, Vijay Janapa Reddi <jvijay@gmail.com mailto:jvijay@gmail.com> wrote:

Hi,

I am running the app on the emulator and it looks like android emulator is having trouble resolving the hostname, as you can see in the attached image:

> On May 13, 2017, at 1:04 AM, Bertrand Martel > wrote: > > Hello, can you print the speedTestError to see what type of error shows ? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub , or mute the thread . > >
bertrandmartel commented 7 years ago

Maybe it's the same as #4 , specify the DNS server with -dns-server 8.8.8.8,8.8.4.4. But there is no need for ACCESS_NETWORK_STATE. Note that I had this issue with Android Studio < 2.3 and specifying network speed as other than Full, if you don't mind try change network speed to full in your emulator configuration.