Development by Davis: “Open source makes you bolder” plus 4 more |
- Open source makes you bolder
- Public policy: The big opportunity for health record data
- SAS v. WPL decision addresses boundaries of copyrights on software
- Using DialogFragments
- Your mother was right, so send her an e-card
Posted: 09 May 2012 06:00 AM PDT I earn a living at a public library in the Washington, DC area. About a year ago I was trying to explain Twitter to someone for the fifth time that week. The person listening to me just wasn't getting it. "I need to give a public talk about Twitter here at this library," I muttered to myself. "That way I won't have to explain Twitter to every person who doesn't get it." |
Public policy: The big opportunity for health record data Posted: 09 May 2012 04:00 AM PDT A few weeks ago Colin Hansen - a politician in the governing party in British Columbia (BC) - penned an op-ed in the Vancouver Sun entitled Unlocking our data to save lives. It's a paper both the current government and opposition should read, as it is filled with some very promising ideas. In it, he notes that BC has one of the best collections of health data anywhere in the world and that, data mining these records could yield patterns - like longitudinal adverse affects when drugs are combined or the correlations between diseases - that could save billions as well as improve health care outcomes. |
SAS v. WPL decision addresses boundaries of copyrights on software Posted: 08 May 2012 11:48 AM PDT Last week the European Court of Justice (ECJ), the highest court in the European Union on matters of EU law, issued a judgment in the case of SAS Institute Inc. v. World Programming Ltd, C-406/10, which was referred to the court for a preliminary ruling by the UK's High Court of Justice for England and Wales, Chancery Division. |
Posted: 08 May 2012 11:13 AM PDT [This post is by David Chandler, Android Developer Advocate — Tim Bray] Honeycomb introduced Fragments to support reusing portions of UI and logic across multiple activities in an app. In parallel, the showDialog / dismissDialog methods in Activity are being deprecated in favor of DialogFragments. In this post, I'll show how to use DialogFragments with the v4 support library (for backward compatibility on pre-Honeycomb devices) to show a simple edit dialog and return a result to the calling Activity using an interface. For design guidelines around Dialogs, see the Android Design site. The LayoutHere's the layout for the dialog in a file named
Note the use of two optional attributes. In conjunction with The Dialog CodeThe dialog extends DialogFragment, and since we want backward compatibility, we'll import it from the v4 support library. (To add the support library to an Eclipse project, right-click on the project and choose Android Tools | Add Support Library...).
The dialog extends DialogFragment and includes the required empty constructor. Fragments implement the Showing the DialogNow we need some code in our Activity to show the dialog. Here is a simple example that immediately shows the EditNameDialog to enter the user's name. On completion, it shows a Toast with the entered text.
There are a few things to notice here. First, because we're using the support library for backward compatibility with the Fragment API, our Activity extends FragmentActivity from the support library. Because we're using the support library, we call After loading the initial view, the activity immediately shows the EditNameDialog by calling its show() method. This allows the DialogFragment to ensure that what is happening with the Dialog and Fragment states remains consistent. By default, the back button will dismiss the dialog without any additional code. Using the DialogNext, let's enhance EditNameDialog so it can return a result string to the Activity.
For user convenience, we programmatically focus on the EditText with If the user focuses on an EditText, the soft keyboard will automatically appear. In order to force this to happen with our programmatic focus, we call The We can dismiss the dialog one of two ways. Here we are calling dismiss() within the Dialog class itself. It could also be called from the Activity like the show() method. Hopefully this sheds some more light on Fragments as they relate to Dialogs. You can find the sample code in this blog post on Google Code. References for learning more about Fragments: |
Your mother was right, so send her an e-card Posted: 08 May 2012 07:45 AM PDT Your mother was right--about a lot of things most likely--but we think your mother was right because she always told you it is better to share. Sharing is a very important part of the open source way, so tell your lovely mom thanks for teaching you values like sharing with this e-card. |
You are subscribed to email updates from Developers by Davis To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No hay comentarios:
Publicar un comentario