How to listen for touch events from *Lock Screen* and *Home Screen*

by Dianne Hackborn » Mon, 27 Jul 2009 12:58:52 GMT


Sponsored Links
 Depends on how you define better.  Allowing apps to see users draw their
lock pattern would be not too cool, for example.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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



Other Threads

1. Optus telco in Australia now allowing paid apps from Market

Hi,

Good news, after a year of blocking, Optus telco in Australia now
allowing paid apps from Market.

Hopefully Australian developers can soon offer paid apps as well ? :-)

Regards

-- 

2. Help converting C# code (Isn't there anyone that will help out here)

I am trying to convert a C# game to Android and need some help with
the graphics stuff.

Can anyone show me how to convert this to Java?

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace MyGame
{
 public partial class MyButton : Button
 {
   GraphicsPath path;
   GraphicsPath innerPath;

   private bool _clicked = false;
   public bool Clicked
   {
     get { return _clicked; }
     set
     {
       _clicked = value;
       Invalidate();
     }
   }

   public MyButton()
   {
     InitializeComponent();
   }

   protected override void OnPaint(PaintEventArgs pevent)
   {
     Graphics g = pevent.Graphics;
     g.SmoothingMode = SmoothingMode.AntiAlias;

     // Create painting objects
     Brush b = new SolidBrush(this.ForeColor);

     // Create Rectangle To Limit brush area.
     Rectangle rect = new Rectangle(0, 0, 150, 150);

     LinearGradientBrush linearBrush =
       new LinearGradientBrush(rect,
       Color.FromArgb(20,20,20),
       this.ForeColor,
       225);

     path = new GraphicsPath();
     innerPath = new GraphicsPath();

     path.AddArc(0, 0, 270, 270, 180, 90);
     path.AddArc(120, 0, 30, 30, 270, 90);
     path.AddLine(150, 0, 150, 85);
     path.AddArc(100, 100, 100, 100, -90, -90);
     path.AddLine(100, 150, 0, 150);
     path.AddArc(0, 120, 30, 30, 90, 90);

     innerPath.AddArc(10, 10, 250, 250, 180, 90);
     innerPath.AddArc(130, 10, 10, 10, 270, 90);
     innerPath.AddLine(140, 0, 140, 90);
     innerPath.AddArc(90, 90, 100, 100, -90, -90);
     innerPath.AddLine(90, 140, 10, 140);
     innerPath.AddArc(10, 130, 10, 10, 90, 90);

     this.Region = new Region(path);

     PathGradientBrush pgbrush = new PathGradientBrush(innerPath);
     pgbrush.CenterPoint = new Point(75, 75);
     pgbrush.CenterColor = Color.White;
     pgbrush.SurroundColors = new Color[] {
                            Color.FromArgb(250,this.ForeColor) };

     if (_clicked == false)
     {
       g.FillPath(linearBrush, path);
       g.FillPath(b, innerPath);
     }
     else
     {
       g.FillPath(linearBrush, path);
       g.FillPath(pgbrush, innerPath);
     }

     // Dispose of painting objects
     b.Dispose();
     pgbrush.Dispose();
     linearBrush.Dispose();
   }

   protected override void OnMouseEnter(EventArgs e)
   {
     this.Cursor = Cursors.Hand;
     base.OnMouseEnter(e);
   }

   protected override void OnMouseLeave(EventArgs e)
   {
     this.Cursor = Cursors.Arrow;
     base.OnMouseLeave(e);
   }

   protected override void OnMouseDown(MouseEventArgs mevent)
   {
     _clicked = true;
     base.OnMouseDown(mevent);
   }

   protected override void OnMouseUp(MouseEventArgs mevent)
   {
     _clicked = false;
     base.OnMouseUp(mevent);
   }
 }
}

-- 

3. Can anyone hook me up with an Exchange email account that I could use for testing?

4. Control a graphic with android buttons

5. external input device

6. Programmatically setting a new default ringtone without the ringtone picker

7. Setting new default ringtone without using RingtonePicker?