Comments (4)
I run in to this confusion all of the time when working with people that are using my product.
Don't think of airplane mode as anything special to handle.
All the app should care about is "do I have any network connection", which doesn't have much/anything to do with airplane mode.
The app should just watch network connectivity events and only try to connect if there is any network connection (and only warn/toast if there is no network connection).
from onebusaway-android.
With this commit, that's essentially what happens. The only difference is the toast message, which will give a hint to the user that they can't connect perhaps because Airplane Mode is on.
Many of OneBusAway's users are relatively tech unsavvy -- the reason why I added that check in the first place is I got a bunch of email complaints that the app wasn't working, only to find out that the user had enabled Airplane Mode.
from onebusaway-android.
Understood, but you still are treating airplane mode as something special.
I recommend renaming your "isAirplaneMode()" to something like "!isAnyNetworkConnectionAvailable()", and change the method to do just that.
The difference may seem subtle or petty, but can be pretty important.
In my product I have to run as a service and stream audio in the background, so I have to real-time detect this by creating a PhoneStateListener and a BroadcastReceiver for ConnectivityManager.CONNECTIVITY_ACTION that takes action whenever any connection is lost or established.
from onebusaway-android.
isAirplaneMode() I think is named correctly, because that's exactly what it does -- it returns true if Airplane Mode is enabled, false otherwise. It seems like "!isAnyNetworkConnectionAvailable" is what isConnected does.
If you'd like to improve OneBusAway's handling of no connectivity situations beyond what I've done, I'd encourage you to file a Pull Request.
from onebusaway-android.
Related Issues (20)
- refactor: Refactor Conditional Logic
- Hard to Distinguish Between Different Routes in Trip Planner
- [GSoC] Studies and Surveys Feature
- Visibility Issue: Button text color should contrast with the background
- Add a custom region by simply tapping on a URL HOT 1
- User Reported Bug: Plan Trip Time Picker looks broken in dark mode HOT 1
- User reported bug: "Updating your reminders" notification pops up from time to time HOT 1
- System Settings:
- Crash in weather feature HOT 3
- remove broken feature
- Crash `android.content.res.Resources$NotFoundException` in setWeatherImage()
- Donation Overlay close button is missing with larger font sizes HOT 2
- App dependencies need to be updated HOT 2
- Missing Finnish Translation
- Issue weather view is being visible on starred routes/stops
- [BUG] Backup Storage Functionality Broken on Android 13 and Above - Storage Permissions HOT 2
- Make analytics much more useful to transit agencies HOT 1
- Add Option To Show / Hide Weather View
- Allow users to disable 3D map experience when they zoom in
- Warning icon overlaps with long route name HOT 2
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 onebusaway-android.