Different AlarmClock applications for every phone?

by Thomas » Fri, 12 Mar 2010 01:50:07 GMT

Sponsored Links
 I have a widget that should launch the AlarmClock when its clicked.
After searching for a result it seems to me that every phone can have
its own AlarmClock-application, and that what I am trying to do isnt
really possible?

I have been using this for HTC Hero:
resolved = packageManager.resolveActivity(i,

And this if not HTC Hero:
resolved = packageManager.resolveActivity(i,

This way I can check if the AlarmClock application is there. But now
it seems that the Nexus One has yet another application. Does anyone
know the component name and class for the Nexus AlarmClock?

I can see that this will be a growing list of checks, so is there a
better way?



Different AlarmClock applications for every phone?

by Dianne Hackborn » Fri, 12 Mar 2010 02:49:14 GMT

 There is no standard alarm clock API in the platform.  Heck, some devices
may not even have one.


Sponsored Links

Different AlarmClock applications for every phone?

by Thomas Ermesjo » Fri, 12 Mar 2010 03:02:31 GMT

 So anyone with a Nexus One can check their logcat to see what the Alarmclock
classname for the nexus is?


2010/3/11 Dianne Hackborn <hack...@android.com>


Different AlarmClock applications for every phone?

by Mark Murphy » Fri, 12 Mar 2010 03:11:06 GMT


You should not be doing this. The alarm clock is an application, not
part of the SDK.


Some applications that may exist on Android have publicly documented
Intents, such as:


The alarm clock is not one of them.

Now, if you want to allow the user to choose an application to launch,
by pulling up a list of available activities from the PackageManager,
that's perfectly reasonable.

But please don't go around hard-wiring class names in your code.

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

_Android Programming Tutorials_ Version 2.0 Available!


Different AlarmClock applications for every phone?

by Thomas Ermesjo » Fri, 12 Mar 2010 03:30:18 GMT

 >Now, if you want to allow the user to choose an application to launch,

Thanks. Good idea.

2010/3/11 Mark Murphy <mmur...@commonsware.com>


Other Threads

1. Download image from server


I have to download an image from server.But I got an error "D/skia
( 197): xxxxxxxxxxx jpeg error 53 Not a JPEG file: starts with 0x%02x

I have to perform two continues Http connection.First is used to get
server response and second to get image from the server.First task is
performed correctly but while downloading image I got the given
eror.So the problem in getting image from server.

My code is:

public ImageView getView(String myImageURL) {
        ImageView i = new ImageView(this);

        try {
                /* Open a new URL and get the InputStream to load data
from it. */
                URL aURL = new URL(myImageURL);
                URLConnection conn = aURL.openConnection();
                InputStream is = conn.getInputStream();
                /* Buffered is always good for a performance plus. */
                BufferedInputStream bis = new BufferedInputStream(is);
                /* Decode url-data to a bitmap. */
               // Bitmap bm = BitmapFactory.decodeStream(bis);
                Bitmap bm = BitmapFactory.decodeStream(is);
               // bis.close();
                /* Apply the Bitmap to the ImageView that will be
returned. */
           } catch (IOException e) {
                Log.e("DEBUGTAG", "Remtoe Image Exception", e);

        /* Image should be scaled as width/height are set. */
       // i.setScaleType(ImageView.ScaleType.FIT_CENTER);
        /* Set the Width/Height of the ImageView. */

        return i;

This code works fine when I performed this task alone in another

2. How do I use View(Context context,AttributeSet attrs) constructor??

I'm trying to convert an Xml string into a view by parsing out the
attributes into a set, and keep getting the following exception...

java.lang.ClassCastException: android.util.XmlPullAttributes

is called whenever I attempt to call Xml.asAttributeSet(XmlPullParser

Code below:

   XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
   XmlPullParser xpp = factory.newPullParser();
   xpp.setInput(new StringReader(XML_STRING));
   int eventType = xpp.getEventType();
   while (eventType!=XmlPullParser.END_DOCUMENT)
        eventType = xpp.next();
                View v = new View(this,Xml.asAttributeSet(xpp));
   catch (Exception e)

3. UnsupportedClassVersionError with 0.9 and Eclipse layout editor

4. Google Android Developers...

5. best performing xml parser for android?

6. changing path r.java

7. T-Mobile will be restricting voice over internet protocol (VoIP) applications.