bostwick wrote: > The included Chronometer widget doesn't quite have the functionality I > wanted, so I copied its code into my own package.
The source code to Android is not necessarily designed to be pulled out and used in isolation elsewhere. Some classes will work that way (e.g., I have cloned AsyncTask and MatrixCursor), but others will not because they have dependencies on other open-source-but-not-in-the-SDK classes and methods. > Looking through the android source, you can see stock widgets using > the RemotableViewMethod all over the place, but for some reason, my > code can't. That is probably used by the firmware build process. > So, my question is this: What can I do to enable the > RemotableViewMethod annotation in my custom widgets? Most likely, you can't. > Is there > something I should be doing differently in order to code custom > widgets? Well, your underlying problem didn't make it into your paste. You are failing on a NullPointerException (line #42 of the paste), and you need to track that down. AFAIK, the RemotableViewMethod annotation will not affect you if you are using a widget in an activity. > I know that part of the problem is just my lack of experience with the > Android SDK, and I don't fully understand what the RemoteViews class > does or why it's needed, and the two sentence description in the API > docs doesn't help much there. If someone could explain just the > logistics of this class, that would also be helpful. Mostly, in terms of the SDK, RemoteViews is used for app widgets -- those doodads you can put on the home screen. Since the home screen runs as its own process, it can't execute your code. Instead, via RemoteViews, you effectively serialize a bunch of UI operations that get sent from your own process to the home screen for execution. UI widgets (android.widget.*) that work with RemoteViews get the @android.view.RemotableViewMethod to indicate what can and cannot be used in this fashion, AFAICT. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

