Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Blog Reader Android App Getting Data from the Web Moving Work from the Main Thread to an AsyncTask

Dylan Merritt
Dylan Merritt
15,682 Points

How can I request permission to access the Internet in Android Studio?

I am using Android Studio to build the Blog Reader project instead of Eclipse, and in this video Ben goes to AndroidManifest.xml, then opens the permissions tab. However, there does not seem to be an equivalent to this tab in Android Studio. How do I ask permission?

2 Answers

David Hope
David Hope
19,876 Points

You will need to create a uses permission element directly inside the Android Manifest following the opening tag at the very top, and before the start of the application element found within.

Here is an example

 <?xml version="1.0" encoding="utf-8"?> 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
  package="dylan.blog_reader_app" > 

 uses permission goes here

<application

You can find out more about the permissions in the link below. https://developer.android.com/guide/topics/manifest/manifest-intro.html#perms

I hope this helps, Dylan. Good luck with the rest of this project and happy coding!

Rebecca Rich
PLUS
Rebecca Rich
Courses Plus Student 8,592 Points

The internet permission is:

<uses-permission android:name="android.permission.INTERNET" />