Comments (2)
Register a listener for TIME_TICK such that, when the screen is on and portal state is needs_signin, the portal detector is fired every minute. This should be stopped whenever the screen turns off (and restarted when it's back on, if the conditions are still true), and when the portal state changes (to unknown, no_portal, or signed_in).
This differs from #3 in that the timer is only running when the portal isn't signed in.
from captivate.
A better solution
This allows finer-grained control over timing, and handles on SCREEN_ON cases.
Write custom version of IntentService (same API), with one change: doesn't automatically stop the service/thread when the queue is empty. The service then stops itself manually whenever state is not SIGNIN_REQUIRED or SIGNING_IN.
When it is in one of those states, schedule a refresh check every 30 seconds (using sendDelayed), unless the screen has been turned off.
When entering either of those states, or SIGNED_IN (i.e. whenever the device is on a portal), register a handler for the screen on broadcast intent. The handler should simply call startService, which will handle both of the following cases:
- SIGNIN_REQUIRED or SIGNING_IN: starts the update loop timer
- SIGNED_IN: checks if session has timed out, which is basically issue #3
from captivate.
Related Issues (20)
- App shows up in Recent Apps after signing in to portal
- The signin activity should show the favicon instead of the captivate icon
- Update old code to use v4 support library
- Notification should stay visible until signed in, in case signin activity is closed early
- Show toast when signed in
- Use ActionBar progress bar instead of custom
- Make PortalSigninActivity ActionBar split HOT 1
- Move version number in About activity to ActionBar
- Allow auto-checkin to Foursquare/Facebook/Google on login HOT 1
- Show favicon in notification (like Gmail notifcations)
- Portal tracking, to eventually support auto-login
- Login activity shouldn't be full-width on landscape tablet HOT 1
- Signin shows up in Recent Apps HOT 1
- As a user, I want to optionally re-signin after an interval for auto-timeout portals.
- java.lang.IllegalArgumentException, probably due to WebView bug
- As a user, I want to optionally have the device vibrate when portal is detected
- Notification icon is white-on-light on 2.2
- Portal detection broken HOT 1
- Switch to using Android Support Library for pre-Honeycomb ActionBar implementation HOT 1
- Add notification option/actionbar icon to disable wifi for a finite time
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from captivate.