I've been following this discussion with some interest. I have no
opinion at this point, but here's a data point that might be
interesting.

I'm developing an app with a particular set of POIs (points of
interest). Originally the manifest had <uses-permission
android:name="android.permission.CALL_PHONE"/> and the POI detail
activity had a button that would invoke the call activity with:

                                String phoneUri = "tel:" + phone.getText();
                                Intent i = new Intent(Intent.ACTION_CALL, 
Uri.parse(phoneUri));
                                startActivity(i);

It turned out to be a pain in the neck because to test or demo the
app, clicking that button would actually initiate a call - I'd have to
quickly press the red hangup button in the the phone call activity to
cancel the call.

I changed the intent from Intent.ACTION_CALL to Intent.ACTION_VIEW to
fix that. Now pressing the button just starts the dialer activity with
the given phone number, but the user has to press the green button to
initiate the call. (I would like to display the name of the POI in the
call activity as well, but haven't figured that out.)

Consequently I was able to remove <uses-permission
android:name="android.permission.CALL_PHONE"/> from the manifest
without losing any functionality.

I suppose the lesson is that there are scenarios where delegating an
action to another app with the right permission(s) is an ideal
solution. I find it an intriguing general approach, but some of the
comments in this thread have pointed out problems with it such as "DLL
hell" and something about permission chaining.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to