One, add network permissions to Android
Add a line of code in the Androidmanifest.xml file to allow Internet permissions
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/89/5B/wKiom1gQcB3zvgxIAAAZlBInjMs436.png "title=" Qq20161026165756.png "alt=" Wkiom1gqcb3zvgxiaaazlbinjms436.png "/>
Second, add check permission to a method
First, define a permission constant, add the context parameter to the method, check whether the permission is allowed by the context's Checkcallingorselfpermission method, and if allowed, throw an exception if not allowed
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/89/5C/wKiom1gQdy_DjkoZAABF48oUAH0621.png "title=" Qq20161026172805.png "alt=" Wkiom1gqdy_djkozaabf48ouah0621.png "/>
In the Manifestactivity.xml file, you need to add a line permission code to register this permission, and then add a line Uses-permission code that allows authorization
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/89/59/wKioL1gQd3_x6-tEAAAqWC9gZLo772.png "title=" Qq20161026172927.png "alt=" Wkiol1gqd3_x6-teaaaqwc9gzlo772.png "/>
Third, add permissions to an activity
1) If the activated activity and the activated activity are in an application, you will need to add permission to the activated activity information in the Manifestactivity.xml file.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/89/59/wKioL1gQfgfyXFVzAAAReQW_cFM649.png "title=" Qq20161026175711.png "alt=" Wkiol1gqfgfyxfvzaaareqw_cfm649.png "/>
And then declare the permission at the top
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/5C/wKiom1gQfjDCWVwBAAAVb4UwVKY603.png "title=" Qq20161026175758.png "alt=" Wkiom1gqfjdcwvwbaaavb4uwvky603.png "/>
2) If the activity being activated is not in an application, add the permission information to the activated activity in Manifestactivity.xml and add the Intent-filter information action
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/89/5C/wKiom1gQfvSQnYuoAAAvr76RM5o336.png "title=" Qq20161026180112.png "alt=" Wkiom1gqfvsqnyuoaaavr76rm5o336.png "/>
The same permission is declared above
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/89/5C/wKiom1gQf26AxHf_AAAVb4UwVKY153.png "title=" Qq20161026175758.png "alt=" Wkiom1gqf26axhf_aaavb4uwvky153.png "/>
Add use-permission code to the manifestactivity.xml of the application that started the activity
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/89/5A/wKioL1gQf76BJVQlAAARtC5JsIk059.png "title=" Qq20161026180439.png "alt=" Wkiol1gqf76bjvqlaaartc5jsik059.png "/>
"Learning Notes" Android permissions action