null returned by NetworkManager in getCurrentAccessPoint() and build server.

23 visualizzazioni
Passa al primo messaggio da leggere

gaamd...@gmail.com

da leggere,
20 ott 2016, 10:40:1220/10/16
a CodenameOne Discussions
Hi.
I've got a null returned by this method. It is supposed to get some String. So, i cannot test if I'm connected, and on which source.
Look file cattura0, then file cattura.
How it works? It it implemented in the build server via a CodenameOneImplementation? So, in the class Display there is a reference to a CodenameOneImplementationFactory, but this is not currently imported... So, basically it not exist, it is also injected in the build server (See cattura2)?

In the bless of the Greatest FSM. Ramen.

// Platform ----------------------------------------
IDE: IDEA
Desktop OS: Windows 10 anniversary
Simulator: Bundled with the plugin
Device: My laptop


Cattura0.PNG
Cattura.PNG
Cattura2.PNG

Shai Almog

da leggere,
20 ott 2016, 20:48:1920/10/16
a CodenameOne Discussions
Hi,
getCurrentAccessPoint() can return null based on the API contract.

I would suggest avoiding that API altogether as it's pretty low level and requires device permissions you don't normally want to grant.

gaamd...@gmail.com

da leggere,
21 ott 2016, 12:00:4021/10/16
a CodenameOne Discussions
Thanks. So, if I want to test the connectivity, there is a specific class to use? I can ping a site, using the autodetectedURL "aka google", so testing - in fact - that I'm able to achieve a connection. But how I can test how the framework determine my connection? I want to - for example - block connection if I'm going on mobile data, and not if I'm wifi.

Excuse the english, I'm try my best.
AHHHHR!

Shai Almog

da leggere,
21 ott 2016, 22:50:3121/10/16
a CodenameOne Discussions
Try the cn1lib from nick Connectivity.cn1lib (you can get it in the Codename One Settings -> Extensions).
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi