How to enable the GPS setting automatic

by Louis » Mon, 04 May 2009 09:55:42 GMT


Sponsored Links
 Hi, All:

Anybody know how to enable the GPS setting automatic? Seems the
"Toggle Settings" app can handle it, but I didn't find out any
solutions for it yet.

Please help me if you have time.

Best regards,
Louis.
--~--~---------~--~----~------------~-------~--~----~



How to enable the GPS setting automatic

by Raphael » Mon, 04 May 2009 10:06:05 GMT


 


You can't do that with the 1.5 SDK. Feel free to search the forum for
the (many) threads on the subject.

R/


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


Sponsored Links


How to enable the GPS setting automatic

by Louis » Mon, 04 May 2009 10:18:10 GMT


 By the way, I just found next in android codes

public class SecuritySettings
    ...
    private void setProviders(String providers) {
        // Update the system setting LOCATION_PROVIDERS_ALLOWED
        Settings.System.putString(getContentResolver(),
                Settings.System.LOCATION_PROVIDERS_ALLOWED,
providers);
        if (Config.LOGV) {
            Log.v("Location Accuracy", "Setting
LOCATION_PROVIDERS_ALLOWED = " + providers);
        }
        // Inform the location manager about the changes
        mLocationManager.updateProviders();
    }

....

But seems the "mLocationManager.updateProviders();" didn't public in
SDK yet, any suggestions for it?

Best regards,
Louis.



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



Other Threads

1. Change Tab Drawable when it is selected

Hi all

I need to be able to change the icon on a tab when it is selected, and
change it back when it is deselected. How would I go about doing this?

I have this code so far:

[code]
  public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TabHost tabs = (TabHost)this.findViewById(R.id.tabs);
        tabs.setup();
        TabHost.TabSpec one = tabs.newTabSpec("one");
        one.setContent(R.id.content1);
        one.setIndicator("Shoutbox", this.getResources().getDrawable
(R.drawable.sound_36));
        tabs.addTab(one);

        TabHost.TabSpec two = tabs.newTabSpec("two");
        two.setContent(R.id.content2);
        two.setIndicator("Forum", this.getResources().getDrawable
(R.drawable.document_36));
        tabs.addTab(two);

        TabHost.TabSpec three = tabs.newTabSpec("three");
        three.setContent(R.id.content3);
        three.setIndicator("PM's", this.getResources().getDrawable
(R.drawable.lock_36));
        tabs.addTab(three);
        tabs.setCurrentTab(1);
    }
    @Override
    public void onTabChanged(String arg0)
    {
        if (arg0 == "content2")
        {
                TabHost tabs = (TabHost)this.findViewById(R.id.tabs);

        }
    }
[/code]

Thank you!

Vista06

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

2. new android.hardware.camera class

Now since CameraDevice class has been replaced by Camera class.......can
somebody please help me to write a code to open a camera and click a picture

I tried this but does not work

Button click = new Button(this);
        click.bringToFront();
        click.setText("Click me");
        click.setOnClickListener(new View.OnClickListener(){
            public void onClick(View v)
            {
                android.hardware.Camera camera = Camera.open();
                camera.setPreviewCallback(new Camera.PreviewCallback()
                {
                    public void onPreviewFrame(byte[] imageBytes, Camera
camera)
                    {
                        System.out.println("In preview");
                    }
                });

                camera.takePicture(null, null, new Camera.PictureCallback()
                {
                    public void onPictureTaken(byte[] imageBytes,Camera
camera)
                    {

                        System.out.println("picture taken");
                        camera.release();
                    }

                });
            }


        });

thanks for the help

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

3. 802.1x, PEAP, Campus Domain tester

4. Help me to test APK file on your real device

5. Application crashes on G1, but runs on emulator. Need help.

6. adb device detection of G1 on Linux

7. How shall I need design my application when the device be rotated?