2

Currently I'm looking at attempting a web request and seeing if that fails to determine if I'm online or not, but ideally it'd be nice if there was some hook in the OS that would alert me when I'm offline and go online.

Does anyone know if this is possible today?

TheTodd
  • 445
  • 4
  • 12

2 Answers2

2

It looks like the com.palm.connectionmanager has what you need:

http://webos101.com/Connection_Manager

http://webos101.com/Code_Snippets

Enjoy!

Scott
  • 36
  • 2
2

The links above point to the webOS101 site providing information on how to do this in Mojo. It is still valid in Enyo, but seemingly a little more work to get it going. In a Kind you have to add a component like this:

        {name: "getConnMgrStatus",
        kind: "PalmService",
        service: "palm://com.palm.connectionmanager/",
        method: "getStatus",
        onSuccess: "statusFinished",
        onFaulure: "statusFail",
        onResponse: "gotResponse",
        subscribe: true}

Then when you want to get the status make a call like this:

    getStatus: function() {
    this.$.getConnMgrStatus.call();
}

This code also subscribes you to the status so the onSuccess, onFailure, and onResponse functions will get called everytime there's a change. You may or may not want this. Be sure to add in those functions.

I'm still leaving Scott's answer as the answer because it lead to this approach in Enyo. Please comment if you have any tips.

TheTodd
  • 445
  • 4
  • 12