Help to do a trick on the Lock screen

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


Sponsored Links
 Hello!

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???

THanks!

-- 



Other Threads

1. Alarm in sleep mode

Hi,

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

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

                startUpdateService(context, appWidgetIds);
     }

        protected static int refresh = 0;

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

                if (REFRESH.equals(intent.getAction())) {
                        refresh++;

                        AppWidgetManager mgr = 
AppWidgetManager.getInstance(context);
                        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
seconds).

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,
T.

-- 

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

Hi,
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:
http://damianflannery.wordpress.com/2010/09/28/android-webview-with-https-loadurl-shows-blankempty-page/
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.app.Activity;
import android.net.http.SslError;
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;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.Connwebview);

        //      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(R.id.webview);
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.setHttpAuthUsernamePassword("myhost.com",
"CertificateAuthentication", mUsrName, mPassC);

        mWebView.setWebViewClient(new WebViewClient() {
                @Override
            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() ;
                 }
        });

        mWebView.loadUrl("https://myhost.com/user_area");
    }
}

-- 

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