Still trying to get my head around permissions - can anybody help?

by Mark H. Nichols » Wed, 16 Jun 2010 08:14:40 GMT


Sponsored Links
 Richard,
        




I'm brand new to Android development myself, so I could be completely wrong 
here. I suspect that it isn't a permissions issue as much as it is a restrict 
API issue. As you state above, ordinary applications aren't allowed to call the 
goToSleep(). 

What I think you want is the list of restricted API calls, or rather a list of 
the "internal to Google" content providers. By examining the source code you 
could discover these and perhaps utilize them, but at your own peril. 

Was a widget to put the phone to sleep a learning exercise or part of an 
application you wanted to develop?
Mark

--



Still trying to get my head around permissions - can anybody help?

by Richard C. Cox » Thu, 17 Jun 2010 03:54:08 GMT


 Hi Mark,

Thanks for the response.

Yeah, goToSleep may be restricted in the API, but it says nothing about that 
in the SDK Documentation.  I based my assumptions about it being a permission 
issue on a comment I saw over at the Stack Overflow forums.  Somebody mentioned 
that they got a security exception when they tried to call one of the Power 
Manager functions and the response was...it's a level 2 permission, which 
effectively makes it off limits to user programs.

So, I'm not sure.  I guess I was wondering if there was any documentation 
available to definitively states what API object methods an ordinary 3rd party 
application can and can't use.  

Oh, and the app I was writing was a bit of both.  Learning the API and trying 
some practical code bits to see what my app can and can't do.  

Regards,

Richard



--


Sponsored Links


Other Threads

1. Limitations of the MapView and MapActivity design

I was surprised to see a couple major shortcomings in the design of MapView
and MapActivity.

First, MapView requires itself to be hosted in a MapActivity. According to
the documentation,

A MapView can only be constructed (or inflated) by a
MapActivity<http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapActivity.html>.


This seems pretty weak considering that WebView is at least, if not more
complicated, than MapView and does not have such a requirement. This
limitation means that the application developer is locked into a particular
base class when hosting a map view. Consider the thought experiment about
what would happen if other controls followed the same pattern. If WebView
required itself to be hosted in a WebActivity and ImageView required itself
to be hosted in an ImageActivity, it would not be possible to construct a
user interface that showed a map, a web page, and an image in the same view.
There are other engineering solutions to solve the problem of sharing
various network and file system threads without requiring a specific base
class.

Second, even more limiting is that there can only be a single MapActivity in
the process. According to the documentation,

Only one MapActivity is supported per process. Multiple MapActivities


This means I am forced in my app to choose a single place where a map can be
displayed. Unfortunately, there are multiple places in the app where it is
interesting to show a map. The iphone version of the app shows maps in
multiple places, but this is not possible with the android version because
of this limitation.

Has anybody else had to make compromises to their application because of
these limitations? Is the Google engineer who owns this API aware of
the limitations? Are there any proposals to fix it? Is the best workaround
simply to use a WebView that uses the javascript API? Thanks.

-Jon

--

2. SAX parsing problem..

Hi friends,

              I am new to android. Can any one send me the example on sax
parsing. I got the code  but it's clumsy. So please send me the sample on
Sax parsing






Regards,
Abhilash

-- 

3. How to disable back button..?

4. Portrait and Landscape in Emulator

5. What is the structure of the Android PackageManagerService?

6. Update --- WTI: Silicon Case untuk Nexian Journey

7. oot: Android 3kg