Enable usb debugging (under settings/applications/development) programatically from within app

by QR » Thu, 12 Aug 2010 04:26:40 GMT


Sponsored Links
 usb debugging is another name for the Android Debug Bridge (ADB). The
item you're looking for is here:
 http://developer.android.com/reference/android/provider/Settings.Secure.html #ADB_ENABLED




--



Enable usb debugging (under settings/applications/development) programatically from within app

by Kostya Vasilyev » Thu, 12 Aug 2010 04:49:55 GMT


 ... but that is a Secure setting and, as such, can only be manipulated by
applications signed with a special key (that the platform knows about).

--
Kostya Vasilyev --  http://kmansoft.wordpress.com 

12.08.2010 0:26  "QR" <qro...@gmail.com> :

usb debugging is another name for the Android Debug Bridge (ADB). The
item you're looking for is here:
 http://developer.android.com/reference/android/provider/Settings.Secure.html #ADB_ENABLED




developer.android.com/reference/android/provider/Settings.Syst...


--


Sponsored Links


Enable usb debugging (under settings/applications/development) programatically from within app

by Mathias Lin » Thu, 12 Aug 2010 09:37:27 GMT


 Thanks for the info. But as I understand it, the settings are read
only:

"Secure system settings, containing system preferences that
applications can read but are not allowed to write. These are for
preferences that the user must explicitly modify through the system UI
or specialized APIs for those values, not modified directly by
applications."

.. or could you please tell me about the special key - couldn't find
any information about where to get or register such key. With
'platform knows about' you mean the key needs to be registered with
the device first outside the app?
(Since I'm in full control of the devices and bundle the app together
with a device for distribution, that would be doable).






>



Enable usb debugging (under settings/applications/development) programatically from within app

by FrankG » Thu, 12 Aug 2010 16:00:29 GMT


 Hi Mathias,

The Settings-App uses a persistent system property to enable/disable
adb.


The property_service inside  the system controls which "process-id"
is allowed to set the different properties. Any Property starting
with
"persistent.service.*" can only be set by AID_SYSTEM.

So you app must be a system app to be able to set this kind
of properties and for this you have to sign it with the platform key
of the particular device.

Good luck !

  Frank







> >



Enable usb debugging (under settings/applications/development) programatically from within app

by Kostya Vasilyev » Thu, 12 Aug 2010 19:03:46 GMT


 "Ordinary" applications can't change Secure settings.

The built-in settings application can change secure settings because it 
has a special key that the firmware knows about. Unless you create your 
own firmware, you can't give your application the same functionality.


Now, any reason why you couldn't enable adb "by hand", before handing 
over the device with the application to the customer?


- Kostya

12.08.2010 5:37, Mathias Lin :
Thanks for the info. But as I understand it, the settings are read only: "Secure system settings, containing system preferences that applications can read but are not allowed to write. These are for preferences that the user must explicitly modify through the system UI or specialized APIs for those values, not modified directly by applications." .. or could you please tell me about the special key - couldn't find any information about where to get or register such key. With 'platform knows about' you mean the key needs to be registered with the device first outside the app? (Since I'm in full control of the devices and bundle the app together with a device for distribution, that would be doable).
... but that is a Secure setting and, as such, can only be manipulated by applications signed with a special key (that the platform knows about). -- Kostya Vasilyev -- http://kmansoft.wordpress.com 12.08.2010 0:26 "QR"<qro...@gmail.com> : usb debugging is another name for the Android Debug Bridge (ADB). The item you're looking for is here: http://developer.android.com/reference/android/provider/Settings.Secu... to enable usb debuggi...
I was looking at Permission.WRITE_SETTINGS andhttp://
developer.android.com/reference/android/provider/Settings.Syst...
but couldn't find any appropriate setting there.
--



Enable usb debugging (under settings/applications/development) programatically from within app

by Mathias Lin » Fri, 13 Aug 2010 22:42:26 GMT


 Thanks for the info. It's clear now.

"enable adb by hand": I don't want to deliver the device with adb
enabled, because I don't want the end-user to be able to do anything
with adb.

Scenario is that my client (very non-technical) does the data sync
between PC application and Android device (using adb in the
background), so all he needs to do is plug in the device and sync from
within the Android application. In fact, he cannot even leave the
application.
So everything should be handled from the application, incl. enabling
adb end disabling adb when the data sync is completed.

This non-technical client will hand/rent out the device to other
people for daily usage. I don't want those people to be mess around
with adb in any way.







> >>



Enable usb debugging (under settings/applications/development) programatically from within app

by Kostya Vasilyev » Fri, 13 Aug 2010 23:05:38 GMT


  If that's the case, nothing's preventing those other people from doing 
unspeakably terrible things to the device.


Like uninstalling your application altogether.

Nothing - short of building your own firmware, that is.

-- Kostya

13.08.2010 18:41, Mathias Lin :
This non-technical client will hand/rent out the device to other people for daily usage. I don't want those people to be mess around with adb in any way.
-- Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com --



Other Threads

1. Draw event not moving bitmap

hey guys--

I am just getting started with some game development here and was
messing around with some examples i found and some of the lunar lander
stuff.  but I am having trouble on updating the location of the bitmap
(lander).  its actually working but on my action move event after i
update the x and y for the lander i have to call invalidate(); to
force the refresh and i am curious why i have to do that?  i thought
when you created a surfaceview with a holder call back that it always
called ondraw durring the running state..  here is the motion and draw
code... the lander is in its own class and like i said this does work
but i am just trying to figure it out...

public boolean onTouchEvent(MotionEvent event)
        {
                //Log.d("Panel","Surface touched");
                if (event.getAction() == MotionEvent.ACTION_DOWN)
                {
                        // delegating event handling to the lander
                        Log.d("Action Event","ACTION DOWN");
                        lander.handleActionDown((int)event.getX(), 
(int)event.getY());

                        // check if in the lower part of the screen we exit
                        //if (event.getY() > getHeight() - 50)
                        //{
                        //      thread.setRunning(false);
                        //      ((Activity)getContext()).finish();
                        //}
                        //else
                        //{
                        //}
                }
                if (event.getAction() == MotionEvent.ACTION_MOVE)
                {
                        // the gestures
                        Log.d("Action Event","ACTION MOVE");
                        if (lander.isTouched())
                        {
                                Log.d("Action Event","ACTION MOVE is Touched");
                                // the lander was picked up and is being dragged
                                lander.setX((int)event.getX());
                                lander.setY((int)event.getY());
                                invalidate(); //THIS WORKS
                        }
                }
                if (event.getAction() == MotionEvent.ACTION_UP)
                {
                        // touch was released
                        if (lander.isTouched())
                        {
                                lander.setTouched(false);
                        }
                }
                return true;
                //return super.onTouchEvent(event);
        }

        @Override
        protected void onDraw(Canvas canvas)
        {
                lander.draw(canvas);

        }

here is my run loop

public void run() {
                        Canvas canvas;
                        long tickcount = 0L;
                        Log.d(TAG, "Starting game loop");
                        while (running)
                        {
                                tickcount++;
                                canvas = null;
                                // try locking the canvas for exclusive pixel 
editing on the
surface
                                try
                                {
                                        canvas = 
this.surfaceHolder.lockCanvas();
                                        synchronized (surfaceHolder)
                                        {
                                                // update game state

                                                // draws the canvas on the panel
                                                this.gamePanel.onDraw(canvas);
                                        }
                                }
                                finally
                                {
                                        // in case of an exception the surface 
is not left in
                                        // an inconsistent state
                                        if (canvas != null)
                                        {
                                                
surfaceHolder.unlockCanvasAndPost(canvas);
                                        }
                                }       // end finally
                        }
                        Log.d(TAG, "Game loop executed " + tickcount + " 
times");
                }

thank you all for the info... so far so good and getting a handle on
it...

-- 

2. How implement live wallpaper?

the live wallpaper in the desktop is an activity or a picture?

If it is a activity, how can i set the activity on the desktop?

else if it is a picture, how can i let the picture with animation?

-- 

3. parsing only one tag from an XML file at a time

4. encryption and decryption DES

5. Mapview not touchable

6. Failed to rename directory

7. sublist