What permission do I need to access Internet from an Android application?

前端 未结 13 1664
名媛妹妹
名媛妹妹 2020-11-22 03:50

I get the following Exception running my app:

java.net.SocketException: Permission denied (maybe missing INTERNET permission)

How do I solv

13条回答
  •  醉话见心
    2020-11-22 04:17

    If you want using Internet in your app as well as check the network state i.e. Is app is connected to the internet then you have to use below code outside of the application tag.

    For Internet Permission:

    
    

    For Access network state:

    
    

    Complete Code:

    
    
     
     
    
    
    
    
        
            
                
    
                
            
        
    
    

提交回复
热议问题