I have a react web app and a react-native mobile app. I want to add a "Slow Internet Connection Detected!" warning whenever the users network connection is slow.
Checking the speed at one instant is fine (By checking the time taken to complete a download of known size).
I want to detect the internet speed of the user at all times such that whenever the speed drops the warning comes on.
I am not able to find a way to do that. Please suggest a solution.
Related
I implement GPS signal tracking in my WebView android app and it can get continued while device display is turned off.
Prevent to stop javascript while turn off display.
This is due to android operating system. For battery optimization android kill all processes running in the background. so that's why it stop working after some time. you need some permission (Like Batter Optimization) and some service that run in background.
we are developing a web application (HTML/CSS/JS) on Tizen SSSP4 and SSSP5 devices.
According to SAMSUNG changing tthe version number of the application in sssp_config.xml will cause the display to update next time the application is to be launched.
However when I update the app version and reboot the display using
b2bapis.b2bcontrol.rebootDevice
it will sometimes update, yet other times it will not. Usually it will not update on the first time, yet update if I call the same API once more after the display has restarted. Sometimes the display will get stuck and no longer update even if I reboot multiple times using the API.
I checked the web connection, which is fine. The display is connected via cable, between the display and my server is but a switch. Also I see the display in WEINRE using a webhook all the time.
Has anyone encountered this problem? What can be done to resolve this? Is there something that must be done when unloading the app in order to release the API properly?
Thanks.
I've recently noticed my build time has increased considerably, sometimes taking a full minute to load. On the console I still see "Building JavaScript bundle: finished" fairly quickly but the screen takes much longer to refresh. Is there a reason something like this would be happening?
Try using Expo in a Simulator on your development machine and determine if it is taking as long as on your device:
If it is faster than on your test device, then you should check the
network connection on your test device
If it is as slow as on the test device, then you could try to remove node_modules and reinstall them with 'npm install' or 'yarn'. Expo will be redownloaded aswell as all other packages.
In my case, it was a different solution.
I followed the instructions given by jimmylee on the Expo SDK forums, which say:
If you are behind a VPN, try disabling the VPN.
If you are using windows 10, run CMD on your machine and type
ipconfig. Take a look at the first Ethernet Adapter. If it doesn’t say
Ethernet Adapter Ethernet it means Expo is taking the IP address of
something else.
To fix this, go to network connections and disable the adapter that it
should not be pointing at.
Connect your computer to the network and your phone to the same
network. Restart Expo.
So, go to Settings > Network & Internet.
Click Change Adapter Options:
Then disable the unneeded Ethernet:
Then restart Expo.
If the connection is made but bundle building is very slow - Try disconnecting from the network both devices, the system and the mobile, and reconnect. Also, don't forget to clear the 'recently in development' projects and start the project again.
It will certainly increase the speed of building by far, especially for windows it works very well.
I was going through the same problem.
I used expo on multiple devices and clearly it depends on the device also, i.e, whether it is able to handle it or not.
Second, for the slow device, i came up with a solution.
I just turned off the fast Refresh.
Fast Refresh keeps a watch on the development side and keeps reloading whenever we make a change.
By deactivating it, we need to refresh the app on our own. But this helped me.
Due to multiple refreshes and continuous bundling, expo gets slow (as per me) thus disabling this feature may help (infact helped me a lot).
STEPS TO DO THAT;
In your expo go app, shake your device. An option panel will open.
There will be an option to disable fast refresh. Simply click that and you are done.
One website I regularly access on my iPad has various JavaScript elements which stop working after around 15 minutes of use (it appears not to be after a set number of actions, if I do one interaction then leave it 15 minutes I have the same problem).
The problem happens on two different iPads on the same network. A fairly old iPad 3 with latest iOS 9.3.5 and a brand new iPad Mini 2 also with latest iOS. If I use mobile internet connection (tethered to my phone) rather than my in-house Wifi I don't have the problem.
The problem doesn't occur on desktop browsers, even when running as an iPad by updating the agent.
The website owners are supposedly investigating, but have said they can't recreate on their mobile test devices. Don't know how hard they have tried mind you!
Originally I though that the only thing that can make the website work again was to switch off and power on again the iPad. Closing the tabs, or the whole browser, or clearing history etc, makes no difference, only powering off and on again. I have more recently figured out that just disconnecting from the network and reconnecting, then reloading the page appears to reload the failing Javascript elements.
Using private browsing until the problem occurs and then closing down the tab, leaving private browsing, and then re-entering has certainly cleared all information as I have to login to the website again, but the problem persists.
So my question is, what could a network do to stop loading javascript parts of a webpage that disconnecting and reconnecting would fix? i.e. what might I have to fix on my home network? If there is any other information I can give, please do let me know.
Is it possible to keep a html 5 web pages WebSocket connection open in Mobile-Safari once the screen is locked?
I want to send my users continuous updates throughout the day and it seems silly that their screens should always have to be unlocked to receive those notifications.
Are there any other options?
I don't think it's possible to keep the connection open while the browser is in the background, or when the screen is locked, the reason being that the app is essentially frozen in memory. Here's a quote from a similar question:
the reason you cant keep a network socket open, is that without your app jumping to the foreground when it receives a connection, it cannot respond to network traffic(because if it is not in the foreground its memory content is frozen).
However, I did find this page on Push Notifications for Websites that shows you 'how to sign up your users to receive notifications even when your site is not running in Safari'.
There are some other options: if you want to send continuous updates, you could write an app and either follow the instructions on Apple's site to keep a socket open permanently, or you could configure the app to implement Push Notifications.
I'm sorry I couldn't find a quick fix, but I hope at least one of these options works for you!
I have found a hacky way to keep WebSocket alive in Mobile Safari.
Basically it's the same solution as for this question.
Create an infinity looping audio file to keep Javascript running:
<audio loop src="http://www.sousound.com/music/healing/healing_01.mp3"></audio>
Note: some user interaction is required to initiate the audio file.
It would be nice if a WebSocket kept the browser alive in the same manner as an audio or video file.
PS this also works on Android.