Page 1 of 2

Java Scanner class not working on mobile device

Posted: Sun Jun 03, 2018 11:52 pm
by qqbb
Hi,
I believe there is a bug when using the Scanner class on this website. For example the following code (below) works fine on computer (OSX, Safari) but not on Android phone even though the program itself runs. On Android, the String str turns out empty it seems. Any ideas why this is?

import java.util.Scanner;

public class ScannerTest {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter text: ");
String str = scanner.nextLine();
System.out.println("Your text was: " + str);
}
}

Re: Java Scanner class not working on mobile device

Posted: Mon Jun 04, 2018 2:55 pm
by dbremmen@gmail.com
You are right, the scanner is not working as expected on android. We will review this bug and inform when It's fixed
Thanks!!
David

Re: Java Scanner class not working on mobile device

Posted: Wed Jun 06, 2018 2:06 am
by dbremmen@gmail.com
Hi,
We just released a new version with the scanner fixed for android. Please check if it's working now and thanks for reporting this issue. Also if you find another issue or think about some needed feature just post it in the forum
Regards
David

Re: Java Scanner class not working on mobile device

Posted: Thu Jun 07, 2018 2:13 am
by qqbb
Hi David

Thanks for the quick reply! The problem still exists for me with no visible difference to the earlier version. The Scanner class still doesn't read what is typed on my phone at least (Android 7.0, Chrome and Opera) in the code below (same code as before). How did you get it to work for you?

http://www.browxy.com/SubmittedCode/101088

Good luck with fixing!

Re: Java Scanner class not working on mobile device

Posted: Thu Jun 07, 2018 2:27 am
by dbremmen@gmail.com
Hi!

Oh I see. I think that you are using the old browxy version. We freeze that version in favor of the beta version at: https://www.beta.browxy.com.
I tested the code with this URL -> https://www.beta.browxy.com/#USER_170551
Can you try using that URL to see if the scanner is working?

Thanks!

Re: Java Scanner class not working on mobile device

Posted: Thu Jun 07, 2018 5:27 am
by qqbb
Hi,

Ah yes, I have been using the older version as the beta version has been a bit tricky to use, but originally tested the bug on the beta version too. I tried the beta version now with your fix and it almost works on Android but still needs fixing. The scanner now shows the string except for the last character. E.g. if the input is "hello world" it will print out "hello worl" in that code. On macOS the same code works as it should though.

Btw, thanks for working on this site! It is the only site I found where the Scanner class can be used interactively. unlike the other sites I tested where the scanner input needs to be entered before running the code.

Re: Java Scanner class not working on mobile device

Posted: Tue Jun 12, 2018 9:40 pm
by dbremmen@gmail.com
Hi!
Sorry for the delay in the response.
Yes you are right, in Android when the autocomplete is activated this error occurs. We are working in a new version to handle that problem. We will post again here when released!
Thanks again for using browxy!
David

Re: Java Scanner class not working on mobile device

Posted: Fri Jun 15, 2018 2:55 pm
by qqbb
I'm not sure what you mean by auto-complete, but I'm not aware of any auto-complete being used when I tested that it doesn't work on Android.

Re: Java Scanner class not working on mobile device

Posted: Sat Jun 16, 2018 7:51 pm
by dbremmen@gmail.com
Hi!
We fixed the problem in android. To test it we used this program: https://www.beta.browxy.com/user/jpconver/ScannerTest2
Please try again and tell us if it's working as expected now.
Thanks!
David

Re: Java Scanner class not working on mobile device

Posted: Sun Jun 17, 2018 6:30 am
by qqbb
It works!

I don't know if you consider the following a bug, but I noticed that the output shows a '?' instead of the euro currency symbol '€' and Scandinavian letters such as å,Å,ä,Ä,ö,Ö. The input on the other hand does show these same characters correctly.

Thanks for fixing it!