hoerresb / WifiWizard

A Cordova plugin for managing Wifi networks
Apache License 2.0
205 stars 176 forks source link

Error while getting WiFi Network information (SSID) plugin #42

Closed algae514 closed 9 years ago

algae514 commented 9 years ago

Hi Team,

Thank you for your great plugin. I have tried to use this plugin but got struck with a minor glitch, would you be able to help me out. I posted it at stack but no one replied so thought of putting it here,

Here is the link to the problem at stack: http://stackoverflow.com/questions/32629233/error-while-getting-wifi-network-information-ssid-in-phonegap-app-using-com-py?noredirect=1#comment53172329_32629233

hoerresb commented 9 years ago

It's hard to say. I don't see anything wrong with the code being used. It sounds like you might be missing the ios code being called for the plugin.

Did you run phonegap plugin install https://github.com/parsonsmatt/WifiWizard.git to install?

algae514 commented 9 years ago

Yes I did, try that. Also, I am using it only for android at the moment. My guess is it has some issue with version. I will perform further search and update you back.

I went through your code and everything seems fine to me.

Thanks a lot for the reply.

hoerresb commented 9 years ago

No problem. I just tested your code on my setup and it works fine on android. Sounds like you are on the right track with the version issue. Let me know if anything comes up. Thanks.

lepermunna commented 9 years ago

What platform are you trying to run your code on?

algae514 commented 9 years ago

Hi,

Sorry for the delayed response. phonegap version update has caused a bit of problem. I fixed it. Set my phonegap version to 3.7 and updated source to npm. Added below line in config.xml

placed below line in config :

I am testing it on device Android. I copied the js file from github latest version. I tried using isWifiEnabled and that returns me the same error . Incorrect action parameter

I believe the java file must be latest on in version 0.1.0 (I tried without version as well, and got the same error.)

I am using phonegap build, is there a possibility that there is something wrong at the build side, may be it's not working only when built from there ?

I did not try from local however till now. Even if I did, I still am dependent on phonegap build for my final apk at the moment.

Thanks again for your support !!!

algae514 commented 9 years ago

Hi Again,

I downloaded the apk from phonegap build and I opened apk using apktool Under the created apk folder, under below location smali\com\pylonproducts\wifiwizard\ there was a file called WifiWizard.smali

I don't know much about it but I guess it does not have the variables getCurrentSSID or isWifiEnabled.

couldnt attach the file, but I guess you can try the same process and get the smali.

Thank You.

algae514 commented 9 years ago

Based on the above WifiWizard.smali generated, I tried list listNetworks call, and it worked perfectly fine.

Below are first few lines of code of WifiWizard.smali

.class public Lcom/pylonproducts/wifiwizard/WifiWizard; .super Lorg/apache/cordova/CordovaPlugin; .source "WifiWizard.java"

static fields

.field private static final ADD_NETWORK:Ljava/lang/String; = "addNetwork"

.field private static final CONNECT_NETWORK:Ljava/lang/String; = "connectNetwork"

.field private static final DISCONNECT_NETWORK:Ljava/lang/String; = "disconnectNetwork"

.field private static final LIST_NETWORKS:Ljava/lang/String; = "listNetworks"

.field private static final REMOVE_NETWORK:Ljava/lang/String; = "removeNetwork"

.field private static final TAG:Ljava/lang/String; = "WifiWizard"

Thank You

algae514 commented 9 years ago

Issue resolved, source needed to be updated to npm and only then version 0.2.9 would work. otherwise I was using 0.1.0

sample below

<gap:plugin name="com.pylonproducts.wifiwizard" source="npm" version="0.2.9"/>

Thank you for your support !!!

hoerresb commented 9 years ago

Glad you got this figured out. As always, if you run into any other problems let us know. Thanks. On Oct 5, 2015 4:01 PM, "algae514" notifications@github.com wrote:

Closed #42 https://github.com/parsonsmatt/WifiWizard/issues/42.

— Reply to this email directly or view it on GitHub https://github.com/parsonsmatt/WifiWizard/issues/42#event-427379613.