GPS application gets killed on screen timeout

by sagar » Mon, 13 Apr 2009 12:03:54 GMT


Sponsored Links
 Hi ,

I can see on OMAP zoom2 platform, the moment screen timeout happens my
application is getting terminated. I have a Google map based LBS
application which is running on Zoom. I have implemented the
interfaces given in gps.h to libhardware_legacy/gps.cpp .

GPS application talks to android framework and Framework talks to
libhardware to get the GPS info. Now I can see that the moment screen
timeout happens and the display goes off, my application killed.
Actually from the framework the stop interface (hgps_stop() )  gets
called on screen timeout.

I am wondring why this is happening, as I am not sending any stop
request form my GPS application to the libhardware.

Is it something related to Android power manager, that android Power
manager does not know about my application is running?


Thanks and regards,
Saghar

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



Other Threads

1. Problems with SSL Socket connection

I have socket based Transport. SSL cerificate also is in use in this
case.
I use this transport from standart Swing client - works fine. When I
try set it up to
Android application bacame following Exception :

05-27 08:31:24.332: WARN/System.err(223):
java.security.NoSuchAlgorithmException: SSLContext SSL implementation
not found
05-27 08:31:24.342: WARN/System.err(223):     at
org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:
104)
05-27 08:31:24.352: WARN/System.err(223):     at
javax.net.ssl.SSLContext.getInstance(SSLContext.java:58)
05-27 08:31:24.352: WARN/System.err(223):     at
com.dukascopy.transport.common.mina.ssl.SSLContextFactory.createClientSSLContext(SSLContextFactory.java:
158)
05-27 08:31:24.352: WARN/System.err(223):     at
com.dukascopy.transport.common.mina.ssl.SSLContextFactory.getInstance(SSLContextFactory.java:
80)
05-27 08:31:24.362: WARN/System.err(223):     at
com.dukascopy.transport.client.ClientConnector.run(ClientConnector.java:
105)


Have looked at many Android forums, and didn't find any solution...
Except this ->
http://stackoverflow.com/questions/995514/https-connection-android

But TLS is not ok for me.

I can not belive that on Android SDK is not possible create SSL
connection in standart way. (not http connection...)

Thanks! Hopefully anybody have experience with this

-- 

2. Ringtone picker calls onActivityResult() too early

I'm using the RingtoneManager to pick a ringtone. However, my
onActivityResult() method is getting invoked too soon. As soon as the
ringtone picker dialog appears, onActivityResult() is invoked with a
non-RESULT_OK result code, even before I select any ringtones or
select the "OK" button. Then, after choosing a ringtone and selecting
"OK", onActivityResult() doesn't get called any more.

Here are the pertinent sections of my code. Note that this.toast() is
just a wrapper to send a toast.

    private boolean menuChoice(MenuItem item) {
        switch (item.getItemId()) {
        case 0:
            this.ringtonePicker();
            return (true);
        }
        return (false);
    }

    public void ringtonePicker() {
        Intent intent = new
Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select
ringtone");
        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT,
false);
        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT,
true);
        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,
RingtoneManager.TYPE_NOTIFICATION);
        this.startActivityForResult(intent, 999);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode,
Intent intent) {
        this.toast("onActivityResult: " + requestCode + ", " +
resultCode);
        if (resultCode != RESULT_OK) {
            this.toast("result code not " + RESULT_OK);
            return;
        }
        if (requestCode == 999) {
            this.toast("request code is OK");
            Uri uri =
intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
            if (uri != null) {
                String ringTonePath = uri.toString();
                this.toast("ringtone path: " + ringTonePath);
            }
            else {
                this.toast("no ringtone path");
            }
        }
        else {
            this.toast("request code not OK");
        }
        super.onActivityResult(requestCode, resultCode, intent);
    }

The only toast messages I get are "onActivityResult: 999, 0" and
"result code not -1", and these occur when the ringtone picker first
shows up, and before I pick any ringtones or select "OK".

The onActivityResult() method doesn't get called any more, even after
I pick a ringtone and select "OK".

What could I be doing wrong which would cause onActivityResult() to be
called with a failure before I even pick a ringtone? ... even though
the ringtone picker shows up properly?

Thanks in advance.

-- 

3. how to download file from android web view file link?

4. parallax

5. JTwitter OAuth

6. Javascript problem with Webview runing under a HTC Desire

7. Homescreen widget stops responding on FroYo