Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 119
Registered: ‎10-13-2015
Accepted Solution

Mobile SDK online or offline mode

Hi,

 

Exist some method in the API to ask about the state of connection (online or offline)

 

Best Regards,

Marti.

Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: Mobile SDK online or offline mode

Hi,

 

No, but:

Frequent Contributor
Posts: 119
Registered: ‎10-13-2015

Re: Mobile SDK online or offline mode

Hi Lukasz.

 

I added the "cordova-plugin-network-information" in the gruntfile.

 

addPlugins:
options:
command: "plugin"
action: "add"
plugins: [
"cordova-plugin-whitelist"
"cordova-plugin-statusbar"
"cordova-plugin-splashscreen"
"cordova-plugin-transport-security"
"cordova-plugin-geolocation"
"cordova-plugin-file"
"cordova-plugin-device"
"cordova-plugin-inappbrowser"
"cordova-plugin-network-information"
]

 

I rebuild the application and added the following line

 

 

   var networkState = navigator.connection.type;

 

The result is: allways returns connection status == UNKNOWN

 

Any Idea?

 

Frequent Contributor
Posts: 119
Registered: ‎10-13-2015

Re: Mobile SDK online or offline mode

I solved the problem.

After added the "cordova-plugin-network-information" in the gruntfile is necesary execute "grunt androide"

I tried with "grunt runandroide" and the plugin was not loaded.

 

The correct order is:

 

  • add the "cordova-plugin-network-information" in the gruntfile.
  • grunt androide
  • grunt runandroide

 

 

Frequent Contributor
Posts: 119
Registered: ‎10-13-2015

Re: Mobile SDK online or offline mode

I suggest to add the plugin by default in the next release

Highlighted
Technical Evangelist
Posts: 184
Registered: ‎07-30-2015

Re: Mobile SDK online or offline mode

As soon as we start working on "Online/offline mixed mode" we will add it.

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.