jd-alexander / flender Goto Github PK
View Code? Open in Web Editor NEWAnnotation triggered connectivity checking for Android
License: Apache License 2.0
Annotation triggered connectivity checking for Android
License: Apache License 2.0
Great library! I've lost count of the amount of boilerplate I have written for precisely these kinds of connectivity checks.
One thing I have noticed is there is a problem with the way isNetworkConnected
works in Lollipop and above. Referring to this code:.The issue is that if you have both WiFi and mobile data switched on, then all network data is transmitted on whatever whichever network has internet connection. For example, take this scenario:
In this case, you will be told that you have WiFi connectivity, however if you make any HTTP requests etc, those will go over your mobile data. This may not be what you want. You might want to explicitly communicate with your Chromecast in this example.
The solution is to use the new APIs introduced in ConnectivityManager class in API 21 for this purpose - [requestNetwork
](https://developer.android.com/reference/android/net/ConnectivityManager.html#requestNetwork%28android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback%29) and setProcessDefaultNetwork
.
More info here.
Having said all of that, I would understand if you do not want to support these complex use cases in this library since it is really meant to be a simple network check annotation lib!
When i add you lib and build project - memory usage grows to up. In my project i have several libs
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.google.code.gson:gson:1.7.2'
compile 'org.parceler:parceler-api:0.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.hotchemi:android-rate:0.4.3'
compile 'com.hannesdorfmann:swipeback:1.0.0'
compile 'com.makeramen:roundedimageview:2.1.0'
but when i add you lib its more time write - Building gradle....
hi alex will you update your lib to support gradle 1.4.+?
i'm using this lib before with gradle 1.3 on my prev project, works really well. but now unfortunately i need to use gradle 1.4.+ for my next project. but i won't hate u if u don't ๐
Hello.
It is common, that you give users possibility to choose, if they wants to use only wifi or mobile as well.
Is it possible, to specify net type dynamically? Via Flender.
or as annotation parameter?
Regards.
Can't use this awesome plugin in Android Studio 2.0 beta. If you can tell when the next update is coming out?
In my current project I am displaying Snackbar when network is unavailable.
Can we somehow get a callback if the Network comes back again, so that I can remove Snackbar. I am not showing Snackbar for few seconds, but using Snackbar.LENGTH_INDEFINITE
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.