Open tripflex opened 6 years ago
This is great! I'd love to contribute to the project after I add Java and Xcode to list of technologies I know.
Anyway, may I suggest adding root support as a polyfill for whenever Android may disallow reading/changing system properties? I know it might be a bit of increased development time, but I think would come quite handy for dealing with embedded devices.
Also, it might be a longshot, but while you are planning to implement httpOverWifi
, it would be awesome to also have a variation of nanoHTTPD (as an extension, really) in the codebase. (Again, it may be off the subject of WifiWizard2, but I just feel it would be right to do so.)
On the testing matter, I have a collection of Android devices which I'd be glad to be of service using/testing them with WifiWizard2.
Last but not least, thanks for all the work you do rewriting the codebase, it's much appreciated. :)
@DRSDavidSoft no problem! I doubt i'll add the nanohttpd, but in regards to the root polyfill, do you mean like this: https://github.com/N0ps32/cordova-plugin-root
@tripflex about root polyfill, yes, exactly like that. Although I'm noy sure if for iOS something similar would be applicable, but still in Android it would be useful once root permissions is granted to the host app.
Should this be a separate issue?
@DRSDavidSoft nope it's fine here, i'll try and add it in as well with the update to 3.0.0, keep an eye on this issue, the 3.0.0 branch, and the PR for 3.0.0 for updates
So after forking this repo and updating it, adding async methods, and testing on older devices (Android only so far), specifically Lollipop and Marshmello, I think the best way to move forward is to go ahead and refactor the majority of code base to fix issues found along the way.
Refactoring
connect
to automaticallyadd
network and then enable Because Android doesn't actually "connect" to networks, you just add the network config and then enable the wifi, i'm going to convert theconnect
method to automatically add/update the wifi configuration (without throwing errors if unable to update, or add), and as long as there's a valid network ID for the SSID, enable the network .. only throwing errors when connection fails, or no net id was able to be obtainedOreo issues for modifying existing networks, enabling/disabling/removing networks now only allow the UID that created/added the network to remove/modify, etc.
Because of this, if you want to connect to a network (which code wise is done with
enableNetwork
), it must be done after adding the network configuration, as only the UID that created the configuration, and modify the stateCurrent Known Issues
Runtime.getRuntime()
but honestly not sure, don't know enough about Android to fix it at this timeiOS
New Features
[x] Add permissions handling, specifically
ACCESS_FINE_LOCATION
to prevent requiring GPS enabled[x] Add
bindAll
argument toenable
andconnect
to setbindProcessToNetwork
orsetProcessDefaultNetwork
to route all connections from application through wifi (regardless of whether wifi has internet)[ ] Add helper method to get wifi signal strength https://github.com/devstepbcn/react-native-android-wifi/blob/master/android/src/main/java/com/devstepbcn/wifi/AndroidWifiModule.java#L319
Connecting your App to a Wi-Fi Device AnyDevice Example Code
[ ] Possible integrate discontinued features from hotspot plugin #4
[x] Add methods to obtain IP address and other network information cordova-plugin-networkinterface
[x] Add method to check for internet access
isConnectedToInternet
cordova-plugin-network-information