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. display data from database in proper order

Hi all,
            In my application I am showing data to the user from
database using SimpleCursorAdapter. But here I am facing problem - It
retrieves and show all data correctly but size of each column is vary
(because if suppose thereare 5 columns and first row has column 2 as
string - "Hall" and second row has column  2 as "My Dining Hall
Number1" then data is not displayed properly, means this column ends
where all columns pf row 1 finished. So what to do? How to assign
fixed size to each column? or there is any way using that I can
display some data in first line and if string is big then other part
is displayed on next line of same column. my xml file is as

<?xml version="1.0" encoding="utf-8"?>

<TableLayout xmlns:android="http://schemas.android.com/apk/res/
android"

    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <TableRow>
                <TextView android:id="@+id/roomName"
                android:gravity="center"
                android:layout_weight="0.5"/>

                <TextView android:id="@+id/switchName"
                android:gravity="center"
                android:layout_weight="0.5"/>

                <TextView android:id="@+id/startDate"
                android:gravity="center"
                android:layout_weight="0.5"/>

                <TextView android:id="@+id/totalTime"
                android:gravity="center"
                android:layout_weight="0.5"/>

                <TextView android:id="@+id/startMin"
                android:gravity="center"
                android:layout_weight="0.5"/>

       </TableRow>
 </TableLayout>

-- 

2. Problem in Browser App

When i try to scroll in webview(say for example YAHOOMAIL inbox page).
There are multiple Focus-Ring is visible around the check box in that
page.
This happen only when i touch the screen and drag it.

Regards
Yogendra.

-- 

3. help: keluar dari FTM Mode gmn? urgent

4. [WTS]Samsung Galaxy S dan Galaxy Tab Case/Screen Guard/Dock Charger+Sync etc

5. Which platform manifest for android-2.6.37-rc7?

6. Custom bootanimation

7. New Android Market Client Update