When PortalDetectorService called isWifiConnectedFromContext(), the ConnectivityManager was reporting the networking type as not wifi (cell network or something). This seems to be a bug in the framework.
On portal login, centrally map portal URLs to login HTTP requests to attempt to build a database of login requests. Eventually, the database could be downloaded, and if the user connects to a portal with a known URL, the login request could be automatically sent, without user interaction.
This is a large task, with both a client component and some sort of web-based server component (using Parse, so no actual server coding is needed).
As a user, I want to be able to disable wifi while I'm moving between a lot of captive portals I don't want to connect to, then have it reactivate automatically in the future.
java.lang.RuntimeException: Error executing request
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.executeRequestOrThrow(HttpResponseContentsDetector.java:80)
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.onCheckForPortal(HttpResponseContentsDetector.java:56)
at com.zachklipp.captivate.captive_portal.PortalDetector.checkForPortal(PortalDetector.java:50)
at com.zachklipp.captivate.service.PortalDetectorService.checkForPortal(PortalDetectorService.java:164)
at com.zachklipp.captivate.service.PortalDetectorService.onHandleIntent(PortalDetectorService.java:147)
at com.zachklipp.captivate.util.StickyIntentService$WorkerThread.handleMessage(StickyIntentService.java:114)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:130)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: java.net.UnknownHostException: www.apple.com
at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
at java.net.InetAddress.getAllByName(InetAddress.java:256)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:428)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.executeRequestOrThrow(HttpResponseContentsDetector.java:76)
... 8 more
Should figure out where the user likely is with high confidence (e.g. search based on lat/long, title of login page?), and provide minimal UI on the login screen to allow checkin on various services. UI should be extremely small, and allow the user to choose which services to checkin to and how in a separate UI (either slide-in, dialog, or settings).
java.lang.RuntimeException: Error executing request
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.executeRequestOrThrow(HttpResponseContentsDetector.java:80)
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.onCheckForPortal(HttpResponseContentsDetector.java:56)
at com.zachklipp.captivate.captive_portal.PortalDetector.checkForPortal(PortalDetector.java:50)
at com.zachklipp.captivate.service.PortalDetectorService.checkForPortal(PortalDetectorService.java:164)
at com.zachklipp.captivate.service.PortalDetectorService.onHandleIntent(PortalDetectorService.java:147)
at com.zachklipp.captivate.util.StickyIntentService$WorkerThread.handleMessage(StickyIntentService.java:114)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: java.net.SocketException: Network unreachable
at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)
at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:244)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
at java.net.Socket.connect(Socket.java:1074)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:153)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
at com.zachklipp.captivate.captive_portal.HttpResponseContentsDetector.executeRequestOrThrow(HttpResponseContentsDetector.java:76)
... 8 more
Some portals will time you out after a couple hours, the signin screen should allow you to specify this timeout, if you know it in advance, and update portal status automatically.
This timeout should be remembered, either for each:
The broadcast intent fired by PortalDetectorService when the portal status changes allows other apps to determine portal state, without even binding to the service. This should be mentioned in the main README file (for viewing on GitHub), and near the bottom of the Play Store app description.