CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Thu, 09 Apr 2009 18:17:36 GMT


Sponsored Links
 Hello,

Although the manifest file in my application contains

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

the operation,

mTelephonyManager.enableLocationUpdates();

fails with

04-09 14:01:01.754: WARN/System.err(5495):
java.lang.SecurityException: Neither user 10026 nor current process
has android.permission.CONTROL_LOCATION_UPDATES.

Could anyone help me understand where I am making a mistake, and how
to correct it?

Thanks.

Alex Donnini
--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by Mike Lockwood » Thu, 09 Apr 2009 18:29:56 GMT


 The CONTROL_LOCATION_UPDATES permission has:
android:protectionLevel="signature", which means only applications
built into the system image can have this permission.

Mike






-- 
Mike Lockwood
Google android team

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Thu, 09 Apr 2009 19:56:52 GMT


 Thanks for the response.

This means that applications do not have access to cell (tower)
location tracking information, is this right?

What is  the CONTROL_LOCATION_UPDATES permission used for?

Do you have any suggestions as to how an application could track the
the cell (tower) a phone is connected/closest to?

Doesn't the maps application do that when users select the wireless
network as the tracking vehicle?

Thanks.

Alex Donnini




--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Fri, 10 Apr 2009 02:16:13 GMT


 Hello,

Although the manifest file in my application contains

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

the operation,

mTelephonyManager.enableLocationUpdates();

fails with

04-09 14:01:01.754: WARN/System.err(5495):
java.lang.SecurityException: Neither user 10026 nor current process
has android.permission.CONTROL_LOCATION_UPDATES.

Could anyone help me understand where I am making a mistake, and how
to correct it?

Thanks.

Alex Donnini
--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by Richard Schilling » Fri, 10 Apr 2009 07:33:08 GMT


 I have the SDK version 1.1r1 on my machine, and Actually don't see
this API call in the current version.  What version of the SDK are you
using?

Anyway, I assume you want to cell tower location and such.  Try
creating a listener, and then registering your listener with the
TelephonyManager.

Start by giving your application the following permissions:

     android.permission.ACCESS_FINE_LOCATION
     android.permission.ACCES_COARSE_LOCATION

Then, create your listener:


// implement both phone state listener and location listener.
public class PhoneSignalListener extends PhoneStateListener
        implements LocationListener{


        /**
         * @param signalStrength signal strength in ACU.
         */
        public void onSignalStrengthChanged(int signalStrength){

                float signalPercent = ((float)signalStrength)/31f * 100f;
                SignalStrength.setSignalStrength(signalPercent);
                SignalStrength.setSignalStrengthASU(signalStrength);

        }

        public void onCellLocationChanged(CellLocation cellLoc){}

        public void onLocationChanged(Location loc) {}

        public void onProviderDisabled(String arg0) {}

        public void onProviderEnabled(String arg0) {}

        public void onStatusChanged(String arg0, int arg1, Bundle arg2) {}

}



And then you register it with TelephonyManager.  In your application's
main activity (Activity.onCreate()):

public class MyActivity extends Activity{


    public void onCreate(Bundle savedInstanceState) {
        TelephonyManager telManager = (TelephonyManager)
this.getSystemService(Context.TELEPHONY_SERVICE);
        telManager.listen(new PhoneSignalListener(),
                        PhoneStateListener.LISTEN_SERVICE_STATE |
                        PhoneStateListener.LISTEN_SIGNAL_STRENGTH |
                        PhoneStateListener.LISTEN_CELL_LOCATION);
    }
}


As the phone location changes you get the information delivered,
wrapped in a pretty package with a bow, to the Phone signal listener.


Richard Schilling
Root Wireless




--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Fri, 10 Apr 2009 10:18:54 GMT


 Hello Richard,

Thanks very much. This is very helpful. I am using the same SDK
version but in this case I was not using the SDK.

I had been experimenting with LocationListener too. I had been using
onLocationChanged.

Again, Thanks.

Alex Donnini

On Apr 9, 7:32pm, Richard Schilling <richard.rootwirel...@gmail.com>



--~--~---------~--~----~------------~-------~--~----~



CONTROL_LOCATION_UPDATES permission failure

by alexdonnini » Fri, 10 Apr 2009 23:58:48 GMT


 ello again Richard,

I have a quick question.

The SignalStrength class and setSignalStrength methods in the two
lines below are not part of the Android SDK or other Android telephony
related classes. Did you write it, or did you find it somewhere else?

SignalStrength.setSignalStrength(signalPercent);
SignalStrength.setSignalStrengthASU(signalStrength);

Thanks.

Alex Donnini

On Apr 9, 10:18pm, alexdonnini <alexdonn...@ieee.org> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to listen for outside touch events for PopupWindow

I want to listen for outside touch events for PopupWindow so that i
can dismiss it when user touched outside of popup window. I'm calling
popupWnd.setOutsideTouchable(true); but how that popup window is
informed of outside touch events?

--~--~---------~--~----~------------~-------~--~----~

2. Send files as MMS

Does anyone know how to send a byte buffer as an MMS messages?

--~--~---------~--~----~------------~-------~--~----~

3. building android for dream and for a new target

4. Sending data to an application running of device from host

5. 3D in android

6. Can't display MyLocationOverlay

7. An android application to display cursor position