7

I'm using three buttons in my app

  1. Feedback button: It allows the user to send feedback via any mail application
  2. A share button which uses a share intent
  3. A "rate app" button which opens my app's page on the play store

All the 3 buttons uses other applications to access the internet.

Do I need to add the android.permission.INTERNET permission in my manifest file?

hippietrail
  • 15,848
  • 18
  • 99
  • 158
user1951690
  • 167
  • 1
  • 4
  • 9
  • if u are using any internet related functions in ur app u have to use that permission – SubbaReddy PolamReddy Feb 05 '13 at 11:01
  • I got a little confused after reading Chris Stratton's answer in this post http://stackoverflow.com/questions/6218231/do-i-need-the-internet-permission-tag-to-provide-links-in-an-app – user1951690 Feb 05 '13 at 11:04

2 Answers2

14

The answer in this case is that no, the permissions are not required in this instance, as Dipendra has pointed out in his answer, as the application is sending it's requests as Intents via external applications and aren't direct requests to the network from within his application.

A little background:

The easiest way you can know whether you need the permission is to use your application on a test device. Does it work as you intended it? Do you get any errors without the INTERNET permission?

If you do, then its clear that you need it! If not (and in the case of this question's scenario), you do not need the INTERNET permission.

The permissions are there as a security feature.

The permission in question is:

public static final String INTERNET

Allows applications to open network sockets.

Constant Value: "android.permission.INTERNET"

If your application needs network sockets, then your application needs permission to use them. Simple as that.

Add the below line to your manifest if you require the permission:

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

The permissions are there to protect the user, so it is about being upfront and clear of what your applications intentions are.

biddulph.r
  • 5,226
  • 3
  • 32
  • 47
  • The first two buttons works fine when I tested the application on my phone. I have not tried the rate button though which directly open the playstore. I'll have to check it. Thank you!! – user1951690 Feb 05 '13 at 11:13
  • I don't understand how can this answer by noted as the right one. as your application relies on other applications to access internet (1) mail applivation, 2) any application that implement your intent 3) web browser) you certainly don't neet INTERNET permission here. The right answer is Dipendra one's – Thierry Oct 20 '13 at 15:05
  • 1
    Granted, Dipendra's answer has more upvotes. I believe that user1951690 marked this as correct because it explains the thought process behind requiring permissions, and asks him to check whether his application works without the permissions. Given that user1951690 hasn't been active since Feb 2013 it is doubtful the answer will be changed. I will add an edit to the main answer to explain this. – biddulph.r Oct 21 '13 at 08:43
5

No you don't need the permission to access internet. Because, all of your internet related tasks are handed over to other applications.

Dipendra
  • 1,547
  • 19
  • 33