Programming the trackball light

by Boardy » Tue, 23 Mar 2010 01:51:48 GMT

Sponsored Links
 Hi all,

I am currently looking into developing an app for the android
platform. Before getting started on my app I have been going through
the development guide for android.

I was looking at flashing the trackball light when I perform a
notification event.

        NotificationManager mNotificationManager = (NotificationManager)

        int icon = R.drawable.notification_icon;
        CharSequence tickerText = "Hello";
        long when = System.currentTimeMillis();

        Notification notification = new Notification(icon, tickerText,

        Context context = getApplicationContext();
        CharSequence contentTitle = "My notification";
        CharSequence contentText = "Hello world!";
        Intent notificationIntent = new Intent(this, Hello.class);
        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
notificationIntent, 0);

        notification.setLatestEventInfo(context, contentTitle,
contentText, contentIntent);
        notification.defaults |= Notification.DEFAULT_SOUND;
                long[] vibrate = {0, 500, 100, 200, 100, 500, 100,
500, 200, 500};
        notification.vibrate = vibrate;
                notification.defaults |= Notification.DEFAULT_LIGHTS;
        mNotificationManager.notify(HELLO_ID, notification);

I have put in notification.defaults |= Notification.DEFAULT_LIGHTS;
thinking that this was for the trackball LED but I think its the led
at the top of the phone, that one that lights up to show that its

How would I flash the light on the trackball. I have an HTC Hero.
Thanks for your help


Other Threads

1. Need Advice: In-App Purchase of Physical Goods

I'm going to be releasing a game to the market soon, and I'd like to
offer users the ability to purchase shirts, mugs, and other shiny
things for physical delivery.

I really want to keep the process brain-dead easy.  I'd like to NOT
require the user to re-authenticate with any particular checkout
service.  Click buy, enter the quantity and shipping address, verify
and submit.

Seems like Google's in-app purchases are a viable option, although I'd
need to pass the 30% fee on to the user in this case, since it is a
physical good with manufactured cost.  It would be nice to NOT do

Has anyone else done something similar?  How would you approach doing
something like this?

Thanks for any opinions...


2. Transactions in android market not clearing?

I was wondering why the payout from 4/24 was lower than it should
based on the number of sales.  But it looks like transactions since
about 9:00 pm EDT on 4/24 haven't cleared.  Is anyone else noticing
this? (Grey circles in the charge and ship columns in the Orders tab)



3. Android jtwitter app

4. Cannot update/upload apps in Developer Console

5. Amazon Sales

6. Xml parsing using SAX parser

7. How to debug NPE when stack trace does not show any reference to my app code?