sachit
sachit

Reputation: 31

permission of Android Manifest File

Can we give the permission of the android manifest file in the java file. if we want to take the permission of internet() in our application ,so can we give it in the java file.

Upvotes: 1

Views: 768

Answers (3)

sachit
sachit

Reputation: 1138

no you can not do this because all the file and folder are initialize in the starting so you can not change any kind of file and folder at run time or in other source

Upvotes: 0

Kumar Vivek Mitra
Kumar Vivek Mitra

Reputation: 33534

Its a thumb rule in android.......... Any permission needed, is to be specified in the AndroidManifest.xml file. Android manifest configure, install, and runs the App... Its a centralized location to check various parameters of the app.

Upvotes: 1

Nanne
Nanne

Reputation: 64399

No. The requested permissions are also used to show to you in the market for example, it would be strange if you could later on add internet permissions to the program.

You either need the permission (even if it is only once/sometimes) or you don't. And you need to specify that in the XML. There is no valid reason to even want to do so in the code: if you need internet, you need to request the permission. It's as simple as that :)

Upvotes: 2

Related Questions