0

I've gone through all the search results in Google to find a working code snippet for checking if my android device is connected to the Internet, but there seem to be no working ones.

Thus, I'm looking for an example of code for checking android device internet connectivity status. I only need the code to output a bool.

iksemyonov
  • 4,106
  • 1
  • 22
  • 42
arifcse10
  • 133
  • 2
  • 3
  • 12
  • I have done this in my game using by porting solutions on ObjectiveC for IOS and Java for android. Would it help if I provide an answer based on this? – Striker Apr 27 '16 at 07:43
  • I have added this through use of Java and Jni.Would an answer based on this be useful? – Striker Apr 27 '16 at 07:46
  • @Striker Could you please answer here or share a link – Kuldeep Bhimte Jul 29 '20 at 05:48
  • It has been a really long time since I touched cocos2dx. Here is an example of how cocos2dx may access android's java specific functions: https://discuss.cocos2d-x.org/t/jni-c-java-method-invocation-simple-example/4861 and here is how to test network connectivity: https://stackoverflow.com/questions/1560788/how-to-check-internet-access-on-android-inetaddress-never-times-out – Striker Aug 10 '20 at 02:09

0 Answers0