May 10th, 2009
We get several e-mails each week regarding the availability of a drug reference for the Android platform. Unfortunately, we are unaware of any that are available as standalone applications at this time. Unfortunately, we do not own the rights to any of the currently available drug databases, and therefore cannot create an Android-specific application to use them. If anyone knows of an available database, please let us know (info@agilemedicine.com) and we would be happy to look at creating an application to use it!
In the meantime, as long as 3G or wireless access is available, ePocrates does offer an online version of their application: https://online.epocrates.com/home.
Please feel free to post links to other available references or databases in the comments if you have found one that works well!
Tags: Android, drug reference
Posted in Android | No Comments »
April 18th, 2009
While working on the development of some new applications, I have tried transferring complex variables to new intents. For example:
Transferring a single variable, or set of single variable is easily accomplished by adding them to the intent.
1: Intent i = new Intent();
2: i.setClassName("packageName", "packageName.IntentClass");
3: String term = "data to pass";
4: i.putExtra("packageName.term", term);
5: startActivity(i);
In the called intent, we then get this data by calling getExtras():
1: Bundle extras = getIntent().getExtras();
2: String term = extras.getString("packageName.term");
However, what if we want to pass more complex data? As you can see above, the data types that can be added as extras are somewhat limited. In order to pass an object, it must first implement either the Parcelable or Serializable class. Our next post will be on how to implement the Parcelable class, followed by a post on how to integrate a data service.
Tags: Android, intent, putextra
Posted in Android, Android programming, Code snippets | No Comments »
December 29th, 2008
Quick, easy to use specialty applications are fantastic on mobile platforms. However, for some utilities, a single application with multiple functions can save a lot of “application space” on menus. To help address this, we’ve created AgileMedCalc to work as a multi-function medical calculator. We’ve rolled in one of our past applications, AgileBloodGas, into this application to cut down on multiple apps for users to download.
With the concept of “saving space” in mind, we’ve also included some animations that will allow users to view details about the calculations being performed on the calculators. A coming post will talk about the animations from the Android platform we used to accomplish this task.
Tags: Android, calculator
Posted in Android, Applications | 2 Comments »
December 23rd, 2008
While many of the Google applications already have Android-based ports, some of the more “specialty apps” such as AdSense don’t have a mobile interface. Luckily, the Google API allows for an easy login method using an HTTP Post request. One of our current applications, SimpleAdMonitor, uses this method to download an AdSense user’s daily and all time totals.
While the solution is fairly easy to implement, the actual POST request appears to run quite slowly, at least over the Android emulator and somewhat on the device as well.
The first step to generating an authorized session is to post the user’s login details to the Google ServiceLogin:
1: String login = "https://www.google.com/accounts/ServiceLoginAuth?service=adsense&hl=en-US<mpl=login&ifr=true&passive=true&rm=hide&nui=3&alwf=true&continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth";
2: DefaultHttpClient client = new DefaultHttpClient();
3: String websiteData = null;
4: URI uri = new URI(login);
5: HttpPost method = new HttpPost(uri);
6: method.addHeader("User-Agent", "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.10) Gecko/20071115 Firefox/2.0.0.10");
7: method.addHeader("Pragma", "no-cache");
8: method.addHeader("Content-Type", "application/x-www-form-urlencoded");
On line 1, the address specifies a Google service to authorize against. This service can be changed if you need to access some other application. Once this request is formed, the user’s login information can be added using a NameValuePair list. These are then set on the HttpPost method using setEntity:
1: List <NameValuePair> loginInfo = new ArrayList <NameValuePair>();
2: loginInfo.add(new BasicNameValuePair("Email", username));
3: loginInfo.add(new BasicNameValuePair("Passwd", password));
4: loginInfo.add(new BasicNameValuePair("null", "Sign+in"));
5: HttpEntity entity = new UrlEncodedFormEntity(nvps, HTTP.UTF_8);
6:
7: method.setEntity(entity);
8: HttpResponse res = client.execute(method);
One item to note on line 3 is that the param used for the password is “Passwd”. Once this data is posted, the server will return a response that should be evaluated for a correct login. If the login is valid, the page should respond with a link to a redirect page that needs to again be posted to:
1: String login2 = "https://www.google.com/accounts/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Fgaiaauth&hl=en-US&service=adsense<mpl=login&chtml=LoginDoneHtml";
2: method.setURI(new URI(login2));
3: res = client.execute(method);
At this point, the server should respond with the data from the redirect URL, in this case, the main AdSense page. Further requests can now be made to the server using the same method without needing to re-authorize the user. As I mentioned previously, there are some latency issues with this method that I haven’t quite sorted out yet. The lag isn’t horrible, but is fairly significant when waiting for two fairly small pieces of data. Some additional digging will hopefully find out what is causing the delay and how to improve it.
Tags: Android, authentication, defaulthttpclient, google servicelogin, httppost, namevaluepair
Posted in Android, Android programming, Applications | No Comments »
December 15th, 2008
The AgileBloodGas application was developed as an acid/base status calculator. The most time consuming part of developing this application was some of the error checking and equation entry. The paper used as a basis for the equations was Morganroth, M. 1990. Six steps to acid-base analysis: Clinical applications. The Journal of Critical Illness 5:460-469.
. This is an excellent paper to read for anyone who deals with arterial blood gases on a regular basis.
One major improvement that can be made to this application yet is an on-screen method of data entry, rather than needing to flip out the keyboard. This will hopefully be solved either with a future application update from us or a soft keyboard in a future Android release.
In addition, we hope to incorporate this into a larger medical calculator at some point in the future to make it more applicable to a wider range of audiences, rather than having a specific application for each individual equation.
Tags: Android, blood gas
Posted in Android, Applications | No Comments »
December 13th, 2008
Our first application for the Android platform is AgileMedSearch, an app that allows for searching of the NCBI PubMed database. Developing the basics of this application was quite easy compared to what we were expecting. Being able to easily bind data to a scrollable listview object made creating the abstract list a very simple matter.

Determining how much information to collect from the user in a mobile application such as this is probably the most difficult part of creating the product. Since searching such a large database can include many parameters, deciding whether to include input for fields such as author, year of publication, and journal was difficult to make. Currently, we have placed a single text field for the user to enter whichever data they wish. Advanced users can add in some field details by using the generic markup, such as:
authorlast+init[auth]
While this can make very specific searching more difficult, our current assumption is that most users that are doing queries on a mobile platform would appreciate the ease of use of a single field. However, based on feedback, this may change in the future.
The main improvements we currently hope to make are some UI adjustments to make it appear a little cleaner and more elegant. We will also watch the comments here, so if you have any suggestions please feel free to post them!
Tags: Android, listview, pubmed
Posted in Android, Applications | 2 Comments »
December 12th, 2008
With the release of the Google Android platform on the T-Mobile G1, we have begun development on several applications including a PubMed search utility and a blood gas calculator. The Android platform makes rapid development very easy and will definitely be a strength of the platform. In addition, the potential to easily integrate with Google Health will make it an attractive platform for both patient and provider oriented applications.
Posted in Android | No Comments »