tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+

Home Page:https://www.npmjs.com/package/cordova-plugin-wifiwizard2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thread.sleep not is a try - catch

bigt11 opened this issue · comments

on that android side of WifiWizard2.java on line 165 I get the following error

platforms\android\src\android\wifiwizard2\WifiWizard2.java:164: error: unreported exception InterruptedException; must be caught or declared to be thrown
            Thread.sleep(1000L);
                        ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

my quick fix was to put it in a try - catch like you have it on line 174

           try {
                Thread.sleep(1000L);
            } catch (InterruptedException ie) {
                // continue
            }

after that, it compiled for me.

Thanks for reporting this, are you using latest master? If so, try the 3.0.0 branch, that's the one i'm about to merge into master tomorrow once I update the connect method

I am on 2.1.1, did not try 3.0

Yeah you were right, that should def be in a try/catch block, I just commited that update because that's going to cause fail for everyone, thanks for reporting this!

I probably just missed it because i've been working on a complete revamp on the 3.0.0 branch, which i will be merging tomorrow after cleaning it up and fixing the connect method

np, this script is exactly what i was looking for, I'll be playing with this for the next few days on the android side on 7.1.1.

@bigt11 sounds good, let me know if you run into any issues ... I would recommend using the 3.0.0 branch though, I updated a TON of stuff, and I have thoroughly tested it on Android 7 to work correctly, plus updated the README as well:
https://github.com/tripflex/WifiWizard2/tree/3.0.0

I'll be digging into it a lot more tomorrow so just keep an eye on the repo 👍