KeyguardManager question

by yesk13 » Mon, 13 Apr 2009 12:13:48 GMT


Sponsored Links
 here is the code for my app

package com.test.bgTest;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.KeyguardManager;

public class BackgroundTest extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final MediaPlayer mp = MediaPlayer.create(this, R.raw.alert);

        KeyguardManager kg = ( KeyguardManager ) getSystemService
( "keyguard" );

    }
}

i want to be able to alert phone owner when pattern login failed.

but how do i use a listener to actually catch the fail attempt to
unlock keyguard.

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



Other Threads

1. How to determine if Activity is on screen



If you use a BroadcastReceiver registered via registerReceiver(), your
PendingIntent/ProximityAlert stuff should work and you can still tie
back into the activity. However, that has the side-effect of forcing
your service to stay in memory all the time, which may or may not be a
good thing, depending on your app.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Training: http://commonsware.com/training

-- 

2. AccountManager.getAuthToken() problem with more than one app

This whole Auth 2.0 thing is a total mess. Did you test it on Android 2.0.1
devices? It didn't crash for you there? Can you support hosted accounts?

I think I will give up on this until Google documents how to use their
implementation (the Google one, not the Android framework). There is just
already too much time sunk here.

Anyway, regarding your actual issue, did the Auth mechanism ask you twice to
allow access to the selected account? I am not quite sure how it determines
the caller, but maybe it might not be the calling app, but the certificate
it was signed with that makes the difference. Did you use the same
certificate to sign both apps?




> 

3. Debugging in Android Open Source

4. Loading a layout from XML inside of a derived class

5. How to determine if Activity is on screen

6. AccountManager.getAuthToken() problem with more than one app

7. Activity lifecycle problem on Nexus One - onStop not called