Java Scanner class not working on mobile device
Java Scanner class not working on mobile device
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);
}
}
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);
}
}
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: Java Scanner class not working on mobile device
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
Thanks!!
David
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: Java Scanner class not working on mobile device
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
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
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!
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!
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: Java Scanner class not working on mobile device
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!
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
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.
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.
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: Java Scanner class not working on mobile device
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
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
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.
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: Java Scanner class not working on mobile device
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
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
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!
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!