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. Can compass be used to separate linear acceleration from gravity with accelerometer?

Hi,

I want to be able to detect vertical movement (relative to the z-axis)
on an Android phone. This can be done with just the accelerometer with
some degree of accuracy. However, I see that in Android 2.3 there are
now separate Gravity and Linear acceleration "virtual sensors", that
apparently will use the gyroscope (when available) to separate
accelerometer data into gravity (useful for detecting orientation) and
linear acceleration (useful for detecting movement).

The phone I'm using does not have a gyroscope, but only an
accelerometer and compass. Is it at all possible to use the compass to
separate linear acceleration from gravity in the accelerometer signal?

High-pass filters are a bit simplistic for my intended use, because
they don't really help detect whether movement is up or down and using
raw accelerometer data leads to orientation changes looking very
similar to linear movements.

-- 

2. Attention: Web application developers! Exciting event on Feb 26th in Pune (WebApps 2011)

Hello,

SiliconIndia is organizing WebApps 2011 at Pune on Feb 26th,
2011.Drawing well-renowned thought-leaders, contributors,
influencer's, and organizations in the Web Development space, the
conference offers insight to develop industry-leading Web Development
projects. The conference brings together web developers, web designers
technology enthusiasts, innovators, vendors, and users to experience
the future of Web Applications.

Web-based applications are revolutionizing both the features that can
be delivered and the technologies for developing and deploying
applications. They also involve a diverse collection of issues and
technologies.We have lined up some of the best speakers and the
sessions & networking will be of the highest order.Get hands-on
technical training and gain new skills. WebApps 2011 guarantees
perfect networking and exciting learning success in workshops,
sessions, discussion panels & fascinating keynotes.

TOPICS:
5 New Skills that Every Web Designer Needs to Know
Progressive CSS3 Design
How to Build a HTML5 Website - Live Demo
Accessibility in Web Design
Icon Design

Who should attend: Web Application Developers, Application Managers,
Web Architects, Web and Graphic Designers, Web Development Managers,
Web Strategists, Web Technologists, Business Strategists, E-commerce
Managers, Product Managers, Technologists and Entrepreneurs and Others

DATE: Feb 26, 2011 (Saturday)
TIME: 8.00 AM to 5.30 PM
VENUE: Pune

We have limited Seats. Registration for this game-changing Symposium
is by invitation only. Attendance is limited to maintain an intimate
setting and foster dialogue among all participants.

To request an invitation, please visit:
http://www.siliconindia.com/events/siliconindia_events/index.php?eid=WebAppPune2011
and complete the  form .

And also you can NOMINATE your colleagues and friends who ever is
interested in attending this event.

We will review your submission and let you know. Once we qualify you,
there will be a registration fee of Rs 500 only. This is towards:
Access to Sessions, Tea/ Coffee & Refreshments and Lunch.

Here's your chance to meet tech leaders and get expert instruction and
hands-on tutorials to create the best web applications, tools, and
software.

Thanks ,


-- 

3. Problem in Handler

4. Unable to recover key : Message when exporting android project using Eclipse for release

5. Media Controller in VideoView should never disappear

6. Receiving Exception 'java.lang.RuntimeException: setParameters failed' while using NyARToolkit in Android 2.1

7. Media metadata update