hypery2k / cordova-hotspot-plugin

A Cordova plugin for managing HotSpot networks on Android
MIT License
37 stars 50 forks source link

Hotspot creation #26

Closed cajay01 closed 8 years ago

cajay01 commented 8 years ago

I am trying to create hotspot using this plugin i used method cordova.plugins.hotspot.createHotspot("myHS", "WPA2PSK", "pass@123", successCB, errorCB); when this method is invoked wifi gets switch off and I got error to start hotspot as "Got unknown error during hotspot start"

hypery2k commented 8 years ago

Strange. Have to look what may cause. But currently don't have much time for this

hypery2k commented 8 years ago

can you please attach the message which is passed to errorCB?

paoloSantinelli commented 8 years ago

Hi,

I have the same problem when I try to create the hotspot. The message passed to errorCB is: "Hotspot start failed.: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference".

Best!

hypery2k commented 8 years ago

please retry with latest master:

cordova plugin add https://github.com/hypery2k/cordova-hotspot-plugin.git

and report here again

paoloSantinelli commented 8 years ago

Hi, and thank you for the help.

I have just retried using the latest master but I still get an error message, a bit different than the previous one: "Unknown error during hotspot configuration: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference".

Thanks

hypery2k commented 8 years ago

can you please retry again. Should be working now

webmaster-imaginet commented 8 years ago

Great! now it working!!!

paoloSantinelli commented 8 years ago

Hi, yes! It works! Now, the plugin is able to create the hotspot (calling cordova.plugins.hotspot.createHotspot(.....) ) fine. Besides it does the network configuration in the right way including network mode and password. Thank you! Now I have to play with the plugin in order to better understand how it works. I have a doubt: sofar, each time I run my App I create the hotspot, maybe what I have to do is create the hotspot only at the first run of the App or when the hotspot doesn't exist, and then only start and stop the hotspot.

Thank again. Paolo

hypery2k commented 8 years ago

I've released version 1.1.2

Regarding you're question. You can enable or disable only the hotspot too: https://github.com/hypery2k/cordova-hotspot-plugin/blob/master/PLUGIN_USAGE.MD#cordova.plugins.hotspot+startHotspot https://github.com/hypery2k/cordova-hotspot-plugin/blob/master/PLUGIN_USAGE.MD#cordova.plugins.hotspot+stopHotspot