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

23 views
Skip to first unread message

gaamd...@gmail.com

unread,
Oct 20, 2016, 10:40:12 AM10/20/16
to 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

unread,
Oct 20, 2016, 8:48:19 PM10/20/16
to 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

unread,
Oct 21, 2016, 12:00:40 PM10/21/16
to 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

unread,
Oct 21, 2016, 10:50:31 PM10/21/16
to CodenameOne Discussions
Try the cn1lib from nick Connectivity.cn1lib (you can get it in the Codename One Settings -> Extensions).
Reply all
Reply to author
Forward
0 new messages