Skip to content Skip to sidebar Skip to footer

Delphi Xe5 Wifimanager And Wifiinfo Coversion

i tried to covert the wifimanager and wifiinfo (android) and i don't understand why i had segmentation fault, i saw that wifimanager worked well, but when i try to call some method

Solution 1:

What is primarily wrong with it is that lack of checking for nil values, which consequently leads to your segmentation fault (at least I'm expecting this to be the case - wm being nil, for example).

You can try referring to the code snippet in this SO answer as a general guide to working with the Android network classes. That should help for now, in lieu of a direct pointer to the error in your code. Try that code out and ensure you understand how it operates. It should then help you identify what is errant in your snippet.

One potential problem with the code is the attributes are using dot-separators, but the RTL Android class attributes, along with the aforementioned snippet, use / as a separator.

Judicious use of logcat (say from within the monitor app) would help identify if this was the case by seeing what the OS throws out as log messages for the period this app executes.

Oh, and one thing that should have been checked first - have you added the Access wifi state permission to your app? That will cause issues with, erm, accessing wifi state information, natch.

Solution 2:

why did you use "Winfo:=TJWifiInfo.Create;"?!...you do not need to create it, it is the getconnectioninfo function that returns a jwifiinfo instance. Why not simply using "Winfo:=wm.getconnectioninfo;"

Post a Comment for "Delphi Xe5 Wifimanager And Wifiinfo Coversion"