jumaallan / androidnetworkmanager Goto Github PK
View Code? Open in Web Editor NEWA library to check the Internet Connection Status in Android (WiFi and Mobile Data)
Home Page: https://androidstudy.com
A library to check the Internet Connection Status in Android (WiFi and Mobile Data)
Home Page: https://androidstudy.com
This will result to less confusion when using the Library, for new users @chweez. I suggest we refactor the Tovuti
and NetworkUtil
methods, which are the backbone methods in this project
I'm not sure why, but sometimes it's cause to this exception, I think you should add try{}catch(Exception e){}
to ignore those exceptions (if you don't know too what it the reason for this problem).
For now I added manually this to my onStop():
try{
Tovuti.from(this).stop();
}catch(Exception ignored){}
It will be nicer if it will be in the library class and not in my activity onStop().
I would change it be myself, but I can't find the Tovuti.java
from some reason, it's show me only the class from java/com/androidstudy/networkmanager
(the androidstudy project) while in this morning I saw another file (where the monitor methods return void).
Did you merged both projects or I'm toΧ tired so I can't find this simple file? π€·ββοΈ
Important. I'll try to do this as soon as possible. After this i think you should release the next version...
This would help users determine what to do depending on the connection type the phone has, like pull updates if connected to WiFi, or perform background tasks. And maybe allow basic app functionality using mobile data
What about if i have connected to wifi but router is not connected to the internet, in that case nothing is happened, isConnected returns true always.
From some reason, the monitor method return void when it should return Tovuti (that we can save in our class and use it in onStop activity method).
In this project: https://github.com/AndroidStudyOpenSource/tovuti
everything look ok, but I downloaded this project because it was updated less then a month ago and there the last update was about 3 months ago (and this is version 0.0.2 while there is only 0.0.1).
I also saw this: #5
what answering on my question, but the documentation wasn't updated accordingly.
So i'd like to know which project should I use and which of them won't be supported soon, because I'm a little bit confused...
UPDATE:
I'm seeing that the second project is not found in gradle, so I can use only this project, so please update the documentation so I'll be able to understand how to use it right.
Thanks,
Ido.
For now, the user must call Tovuti.from(context).stop()
but i want to make it automatic when the Activity
/Fragment
stops.
So, the way Glide implements this feature is by having a view-less Fragment
. The view-less fragment is attached to the activity/fragment where the Monitor
is attached and these Fragment
receives the lifecycle events of the parent/host thus allowing the Monitor
to respond accordingly without user intervention (i.e. calling stop method).
I'll try see if this way will suit us. The only problem is increasing the complexity of the library unnecessarily. What do you think @jumadeveloper?
I would like to add a new feature for Connectivity monitoring and automatic Lifecycle (Activity
, Fragment
, View
and Application
- basically Context
) management to clear listeners. The Listeners will be added to the ConnectivityMonitor
and removed when the host is destroyed i.e. when onDestroy
is called.
Basically, the feature would be what image loaders like Glide and Picasso use to stop inflight requests for images to avoid memory leaks.
Thoughts?
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.