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. Using PAD files for Android application releases

Hi All,

I inquired on the asp.pad_support newsgroup about extending PADGen
support for PAD files to include Android and its .apk files, because
it becomes increasingly painful for developers (including me) to keep
their application listings up to date on all Android download/
distribution websites. Appended are two reply messages from the
asp.pad_support newsgroup. Could developers indicate their interest in
using PAD files to have their own websites automatically regularly
polled for any release updates rather than having to "push" through a
diversity of web interfaces?

Thanks

===

Are there examples of mobile phone app sites which accept PAD files?

PAD does not cover every type of software that can be written (e.g.
video
game cartridge, embedded, mainframe, supercomputer, OSS projects) and
PAD
would appear to be behind the curve in mobile (no Android, no iPhone,
no
BlackBerry).  Before leaping to address this area, it would be good to
know
what sites could/would use an improved mobile phone PAD.

Is Android the name of the hardware spec or the name of the OS?  I
think
this issue comes up with iPhone as well.  The apps for iPhone are
basically
Safari web pages.  The platform choices in PAD are meant to reflect
the OS.

--
Dennis Reinhardt
http://www.dair.com

===

Thanks Dennis.


This is in part a chicken-and-egg question. The owners of the Android
distribution websites AndAppStore ( http://andappstore.com ) and
SlideME
( http://www.slideme.org ) appeared open-minded with respect to PADGen
when I asked them some time ago, but of course it only makes sense to
them to support PAD files if it is going to be widely used for Android
applications. For application developers, however, it is definitely a
pain already today to manually keep listings up to date on say five or
more Android websites, each with its own web interface for updating
with
new releases.

Apart from this, there is the myriad of websites that implicitly
support,
through their use of PAD files in submitting applications, any
operating
system covered by PADGen. This is for instance how The vOICe MIDlet
(for
Java ME) amd The vOICe for Android gets listed on download sites like
http://www.download3k.com


I understand that one has to draw the line somewhere.


The OS. Android is the new open-source mobile phone operating system
developed and promoted by Google together with over 30 other companies
in the Open Handset Alliance. See http://code.google.com/android/


The iPhone is closed: applications are exclusively available through
Apple's
App Store, so iPhone seems irrelevant for PAD. I don't know about
BlackBerry,
but I think its downloads run exclusively via the phone's service
provider,
thus limiting distribution channels. Moreover, RIM (maker of the
BlackBerry)
*is* already in PADGen's checkbox list for supported operating
systems! I
really cannot see why Palm is (still) in the list, along with Windows
Mobile
and Symbian, while Android would not be added soon?

The effort seems really minor to me: just add a checkbox for
"Android", and
remove the restriction for the Web Info tab that currently blocks
files with
.apk extension in the download URLs (.apk files currently fail in
PADGen's
"Verify entries").

I may also post your legitimate questions as a probe on one of the
Google
Android forums.

Best regards,

Peter Meijer

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

2. R.java file not being generated by eclipse plugin

Hi

Well  i am using Android SDK 1.0 with Eclipse plugin(0.8) in Eclipse
version 3.4.
get automatically generated. Its strange because i haven't changed any
settings or any file and it just started happening (seemingly)
automatically. The only change which i had made was in mail.xml file
in another project and I don't think it should affect the system wide
settings.

I tried restarting eclipse, resetting ADT and reinstalling SDK but to
no avail.

I also tried copying R.java file from another project to this file but
then it doesn't automatically change when i make any changes to layout
or strings etc.

Searching on google had no similar problem. The closest was of people
whose R.java was not getting updated but they corrected it by deleting
R.java and making some changes in xml files but mine doesn't get
generated in the first place!!


Any help would be much appreciated.

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

3. How many threads are created by android vm for each android application

4. IP address for G1 via USB?

5. Where can I find output of System.out.println?

6. Other languages keyboard layouts

7. Activity.setResult(RESULT_OK, intent) resulting in RESULT_CANCELED