• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Permission not needed

Hi All,

I'm in the middle of learning about permissions for Android. I built a basic app that launches a web page using the following code;

Code:
        Uri uri = Uri.parse("http://www.google.com");
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        startActivity(intent);

I have no permissions at all in the manifest, yet, the web page launches without any issues. Should this fail when I launch? (Or at least asked permission when I install?)

Is "debuggable" bypassing this requirement?

Thanks in advance for any help.
 
Thanks for the reply.

I removed that code and added the following;

Code:
        ContentResolver cr = getContentResolver();
        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
        int count = cur.getCount();
        Toast.makeText(contect, Integer.toString(count), Toast.LENGTH_LONG).show();

This code crashes if I don't have permission (stopped unexpectedly error, not a permission error.) and runs if I add

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

to the manifest. The other weird thing is it never asks me for permission, it apparently just grants it.
 
Thanks for the reply.

I removed that code and added the following;

Code:
        ContentResolver cr = getContentResolver();
        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
        int count = cur.getCount();
        Toast.makeText(contect, Integer.toString(count), Toast.LENGTH_LONG).show();
This code crashes if I don't have permission (stopped unexpectedly error, not a permission error.) and runs if I add

Code:
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
to the manifest. The other weird thing is it never asks me for permission, it apparently just grants it.

don't think it'll ask you for permissions in debugging mode (on phone or emulator) but get the apk and install it manually , it should state the permissions before you press on install
 
Thanks for the reply. I tried manually installing via the command line, but get the same results. Is there a setting somewhere that makes the .apk file a "production" file?
 
Thanks for the reply. I tried manually installing via the command line, but get the same results. Is there a setting somewhere that makes the .apk file a "production" file?

via command line ? why ? :S
actually , do you know where the permissions are asked ? it's when you press on the file in the phone , you get a page with all the permissions and install/cancel
 
I've tried both the command line and via Eclipse. In either case clicking on the file just launches it. If I look at the file via "settings" it says it can access private data, but never asks me to allow it.
 
When installing the app through debugging tools it just installs without prompting. When installing normally (Via Market or via the Package Installer on the phone that's called via Astro or similar) it will display the permissions before installing.
 
Back
Top Bottom