Help to do a trick on the Lock screen

by Renan » Fri, 20 May 2011 09:30:36 GMT

Sponsored Links

I'm doing an App that need's to interfere with the Lock Screen...

I have a service running, and i need in some point of my service, to
UNLOCK the screen, just as if the user touch-slided the unlock thing
on the screen.

How can i do that???



Other Threads

1. Alarm in sleep mode


In an appwidget I declare a repeating alarm to refresh a widget in
every 10 seconds:

    public void onUpdate(Context context, AppWidgetManager
appWidgetManager, int[] appWidgetIds) {
                Intent update = new Intent(REFRESH);
                PendingIntent intent = PendingIntent.getBroadcast(context, 0,
update, 0);
                AlarmManager alarms =
System.currentTimeMillis(), 10000, intent);

                startUpdateService(context, appWidgetIds);

        protected static int refresh = 0;

        public void onReceive(Context context, Intent intent) {
                super.onReceive(context, intent);

                if (REFRESH.equals(intent.getAction())) {

                        AppWidgetManager mgr = 
                        ComponentName provider = new
ComponentName(context.getPackageName(), getClass().getName());
                        int[] appWidgetIds = mgr.getAppWidgetIds(provider);

                        startUpdateService(context, appWidgetIds);

I use AlarmManager.RTC, because I don't want my widgets to be updated
in sleep mode.

At every update I increase the "refresh" variable which counts the
number of updates. And I display this value in the widget.
The phone go sleep mode, and after a while when I use my phone again I
realize that the widget was updated
in every 10 seconds (because the variable increased in every 10

What should I do to prevent my widgets be updated in sleep mode?
Can I detect somehow that the screen is off, or a phone is in sleep
mode? Or the phone wasn't in sleep mode? Why?

Thank you,


2. Set credentials for a secured http connection via a Webview with setHttpAuthUsernamePassword

I would like to use a WebView to connect to a secure website over
HTTPS, accept its certificate and automatically handle credentials
(given previously by the user).
This far, I ve got the Webview working and accepting the certificate
using the following website:
But although I try to set the credentials or to handle them in a
method, nothing happens, I just end up at the login page without even
any error messages.

I couldnt find out the answer myself and I couldnt find it on the
Internet answer, so I post here ... Anyone up for this challenge? =o)
Here is my code:

package ********;

import android.os.Bundle;
import android.webkit.HttpAuthHandler;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class ConnectorWebView extends Activity {
        WebView mWebView;
        String mUsrName;
        String mPassC;

    public void onCreate(Bundle savedInstanceState) {

        //      Getting info from Intent extras
                //      Get it if it s different from null
                Bundle extras = getIntent().getExtras();
                mUsrName = extras != null ? extras.getString("username") : null;
                mPassC = extras != null ? extras.getString("passcode") : null;

        mWebView = (WebView) findViewById(;
"CertificateAuthentication", mUsrName, mPassC);

        mWebView.setWebViewClient(new WebViewClient() {
            public void onReceivedHttpAuthRequest  (WebView view,
HttpAuthHandler handler, String host, String realm){
                        handler.proceed(mUsrName, mPassC);

                public void onReceivedSslError (WebView view, SslErrorHandler
handler, SslError error) {
                 handler.proceed() ;



3. [WTAi] Apa semua froyo ada setting proxy nya

4. [WTA] Speed Dial Motorola Cliq

5. Default orientation of device

6. How I get Command in Home Screen In Android

7. Painting in webkit's webview