If you need the almost complete network information then please refer to the code on below link: https://github.com/firebase/firebase-android-sdk/blob/master/transport/transport-backend-cct/src/main/java/com/google/android/datatransport/cct/CctTransportBackend.java The code at link is being used by a google project, so you can trust that it is one of the best ways to determine network information. The code is almost fully cooked, now you just need
Author Archives: Sachin Kumar
To detect if developer options are enabled or not in an android device we could the following code:
Sometime we need to access the value of state before react completes in work of state update, it’s kind of live value that would eventually be stored in the state variable of react. e.g. there may be function which needs latest value of state in the same event loop and may cause issues if it
v0.63 and up Go to xcode, CMD + Shift + O, search for RCTLog.mm Look for the block below: and change it to
List connections: Add IP address: Reload connection: Verify Done. Cheers and Peace out!!!
To get the time in nano seconds or milli seconds use the following code snippet: For more on this look into the IOS docs: mach_absolute_time | Apple Developer Documentation There is another method now, which we can use directly and make it more concise: For more details of the IOS version support check the chromium
If you need to get the time in milliseconds in android then you can use the following code snippet: Now above code snipped will give you time since the system has been rebooted in milliseconds. In some case it would be sufficient to find how may milliseconds has been taken by any operation. Now there
I had to download a file and didn’t want it to be saved (I will tell the purpose in later article). I wanted that whatever the contents that I receive are discarded. Initially Axios was being used for the same thing. But it is better for AJAX requests because they are lightweight and not much
You why you would need that. I used it to detect if screen mirroring is on or not. If length of displays is greater than 1 then screen mirroring is on else not. It’s not hundred percent upto the mark. May be we can use the MediaRouter API too. I haven’t gone through that much
Below the sample code to add the mediaRouter listeners to the mediaRouter: Cheers and Peace out!!!