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. Using intent with startActivity from inner class

Hi,

I am trying to use an intent from an inner class which should be
callable from different Activities/outer classes. I receive the
following compilation error: "The constructor Intent(InnerClass,
Class<OtherClass>) is undefined".

The code below illustrates what I am trying to achieve.
Any help would be greatly appreciated.

Thanks,
Alex

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class OuterClass1 extends Activity {
@Override
   public void onCreate(Bundle savedInstanceState) {
      ...
      new InnerClass(this);
      ...
   }
}

public class OuterClass2 extends Activity {
@Override
   public void onCreate(Bundle savedInstanceState) {
      ...
      new InnerClass(this);
      ...
   }
}

public class InnerClass {

   public InnerClass(Activity ac){
      ...
      Intent i = new Intent(ac, FooBar.class); // This line compiles

      // Next line doesn't compile - "The constructor Intent
(InnerClass, Class<OtherClass>) is undefined"
      ac.startActivity(i);
      ...
   }
}


-- 

2. Google Maps Api -> No image displayed

Hello folks,
In my map view i have NO image displayed.
I did get an apiKey from my keystore fingerprint.
I using the ant script that affirms to sign the apk with the same keystore.
I have proper permissions and library usage.
But still I got no image.
If anyone has a clue for displaying the map in my simulator i will be very
happy.
Regards,
Raphal
Extracts from the manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  android:versionCode="1"
  android:versionName="1.0">
  *<uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission
android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
/>*
  <uses-sdk android:minSdkVersion="5" />
  <application android:label="@string/application_name">
  *<uses-library android:name="com.google.android.maps" />*
  <activity android:name="InitializationActivity"
android:label="@string/application_name">
  <intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
  </activity>
  </application>
</manifest>

Extracts from the layout.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <com.google.android.maps.MapView
  android:id="@+id/map_view"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
*  android:apiKey="0U4YsOFH1B2CbsN0un0AcdDlD30t4i-EDL3h4JQ"*
  />
</ScrollView>
Extract from the activity which extends MapActivity with proper override.
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.map_test);
  MapView map = (MapView) findViewById(R.id.map_view);
  map.setClickable(true);
  MapController mc = map.getController();
  double latitude = 47.3869316;
  double longitude = -2.9516315;
  GeoPoint location = new GeoPoint((int) (latitude * 1000000.0), (int)
(longitude * 1000000.0));
  mc.setCenter(location);
  mc.setZoom(10);
  map.setEnabled(true);
  map.setSatellite(true);
  map.invalidate();
  }


Installing the application
...
-package-resources:
  [echo] Packaging resources
 [aaptexec] Creating full resource package...

-package-debug-sign:
[apkbuilder] Creating MapTest-debug-unaligned.apk and signing it with a
debug key...
*[apkbuilder] Using keystore: C:\Documents and
Settings\raphael\.android\debug.keystore*

debug:
  [echo] Running zip align on final apk...
  [echo] Debug Package: C:\MapTest\bin\MapTest-debug.apk

BUILD SUCCESSFUL
Total time: 5 seconds
C:\SVNLOCAL\DexemGuiDynamic>adb install -r bin\MapTest-debug.apk
1087 KB/s (1061868 bytes in 0.953s)
  pkg: /data/local/tmp/MapTest-debug.apk
Success

-- 

3. R.id.faver_andrecents

4. Mouse cursor on Android emulator (Non x86 platforms)?

5. Dymanic View Populated From DB Schema

6. support of jdbc for sqlite

7. Android SDK and ADB