This is my first program for the Apple MacIntosh. The purpose is to predict maintenance doses of lithium based on a test dose. The program can utilize any of three published dosing methods: the Perry single point method, the Perry two point method, or the Cooper single point method. It has built-in help file explaining the various methods. I’m looking for someone to beta test it. So, if you have an Intel Mac running OS X 10.4 or higher, I would appreciate the help:
A free apple app
July 21st, 2010Milestone reached
June 4th, 2010Antibiotic Kinetics for Android has reached the 1,000 downloads milestone on the Android marketplace. That’s actually pretty impressive considering the small target market for this type of application.
Blackberry Week 1
April 11th, 2010The iPhone has inexplicably cornered 30% of the smart phone market, quite a marketing feat for such a lousy OS. I spent a day watching some iPhone app development videos, and decided there is no way I’m getting stuck to that tar baby. The web version will just have to do for the iPhone sheeple. Blackberry is the smart phone market leader with 40%. I’ve recently had some folks tell me that the Blackberry browser does not render the web apps. So, why not, I’m a glutton for punishment. Since Blackberry is a 100% Java platform, I should be able to leverage my Android Java experience to develop a Blackberry app.
So, I download a couple of books, a video, and the Blackberry Eclipse plug in. It looks to be a pretty decent platform in the videos. Unfortunately I can’t get Eclipse to start a Blackberry project. Both the Blackberry Java plug in and the Blackberry Java SDK show up in Eclipse as being installed. However there is no Blackberry project option on the menu or in the New project options. I started a ticket on the Blackberry support forum. Another developer chimed in to say he is having the same problem. But the Blackberry people haven’t come up with a fix yet.
So much for Blackberry week one.
Android followup
About to break 300 on the download counter (299). Only 2 paid users though, lol.
I was able to track down a “force close on start” issue reported by a Canadian user. First I asked him to install aLogCat, a free Android application which reads the device log files. aLogCat also has filtering and email functionality. I asked him to filter for abpk and email me the results. Turns out he had an international phone number which started with a “+”. I had not anticipated that during my testing. So, Android crashed my app when it tried to convert the “+” into a digit. An easy fix, once I got the log files.
Web App issue
Had a user report the site crashing this week when he tried to reset his password. I was able to duplicate the error and tracked it down to a SMTP error. I haven’t looked at that code for months, having been deeply immersed in the Android project. I drew a complete blank trying to remember how SMTP worked on the web site. It felt like an Alzheimer’s moment, very frustrating, and a little scary. I started a ticket on Lunar pages, and slept on it. Lunar support was very helpful, and everything is working as it should once again. A relief, but I’m still worried about my aging brain.
Android enigma
April 4th, 2010Well, my app has been up for 6 days and it has been downloaded 117 times, with 82 active installs, a 70% retention rate. I think that’s pretty good. But so far there has been only one paying customer. Of the $25 I charge, google keeps $7.50, a 30% cut right off the top. No wonder those googledicks are bazillionaires. So, 6 months of work for $17.50, hmmm, not such a great return on investment. Obviously the app is useful if 70% keep it after downloading. I always thought Bayesian was the lure that brought in the paying customers, but apparently many people think they can live without it. My guess is the majority of the downloads are from pharmacy and medical students. I don’t want to charge for every download, I wouldn’t feel right charging a student. Maybe I’ll add a “please pay” nag screen with every screen change? It would be helpful if google would give you an idea of exactly who is downloading the software, where they are from, etc. But, they didn’t even give me the email address of the one person who paid for the app. So, I have no way of soliciting any user feedback.
Android marketplace, a gathering of trolls
March 30th, 2010I uploaded my little app to the android marketplace because it was the only way I could figure out how to install it on my phone for further testing. None of the methods suggested in the Android docs worked for transferring apps from Windows XP to my TMobile myTouch 3g.
My app was up for a grand total of 5 minutes when I discovered a fatal flaw, and I immediately took it down. The one thing I had not been able to test was screen rotation. I did not know how to rotate the screen on the android simulator, and it never occurred to me that it would even cause a problem. Anyway, in those 5 minutes it was on the marketplace, 3 people did download it. And, one of those who did was an android troll who gave it a one star rating. I doubt it was a pharmacist, or physician, or anyone who had the slightest notion about what the application is used for. More likely it was just some asshole troll, waiting to trounce a new app in the marketplace. I couldn’t believe it, the only reason I had uploaded it to the android marketplace was so that I could test it on my phone. I had no intention of releasing this beta software to the public. Yet some troll downloaded it, and smeared his feces on 6 months of my work. Some people exist solely to piss on others parades.
I did some research on the marketplace ratings, and all the developers hate it. There are no restrictions on who may comment on your app. They can give your app a poor rating without giving a reason why. Your app rating doesn’t reset when you upload a new version. All ratings and comments are anonymous, there is no way to reply to poor ratings. It’s a broken system, and google is doing nothing about it, just letting the trolls gather for the feast, and then watching them shit where they eat.
I spent most of the day tracing the source of the error. I had no idea that when you change the orientation of your phone, android completely closes your application, then restarts it, simply to redraw the screen. Even after locking the main screen to portrait orientation, android still insists on closing and restarting my app whenever the phone is rotated. And it was during this screen redraw that it was crashing.
Eventually I discovered that, during a restart, the preferences do not load until *after* the screen is drawn. One of my app’s preferences is the default creatinine clearance method, which was being passed as a blank value to the crcl calc routine, and hence crashing the app. The fix was to changed the declare from “private String CrClMethod = “”;” to “private String CrClMethod = “0″;”. It took me “only” 4 hours to track that one down.
The app looks gorgeous on my phone, it works like a dream, exactly as I had hoped. So, to the android troll who trashed my app: go straight to hell, do not pass go, and do not collect $200.
Android project completed
March 27th, 2010Time to celebrate. Six months, almost to the day. I started this on 9/22/2009, not knowing one damn thing about Android, Eclipse, or Java at the time. Now I’m ready to teach a class, anybody want to learn how to write programs for Android? I think I have a pretty good grasp on how to do just about everything Android. Not bad for a half-dead, broken down old geezer.
Last code hurdle was showing and getting the result from a simple yes/no dialog:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(“Are you sure you wish to delete this record?”)
.setPositiveButton(“Yes”, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Delete the current row using current_id
dbModel.delete(“pkmodels”, “_id=” + current_id, null );
// requery database
modelCursor.requery();
modelCursor.moveToFirst();
// Toast info
Context context = getApplicationContext();
Toast.makeText(context, “Current model deleted”,
Toast.LENGTH_SHORT).show();
}
})
.setNegativeButton(“No”, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Do nothing
}
})
.create().show();
Android week 10 finale
March 26th, 2010I tried several different ways to get the model database to load into the editor screen, nothing was working, it crashed with a big thud. The debug log just said ‘null pointer’ each time, no matter what method I used. I took a fresh look at it this morning and found the problem. I had declared one of the 14 text views as a label view, Eclipse didn’t flag it as an error, so it didn’t show up until run time. With that fixed, I can now browse through the models and display the parameters on the editor screen. I need to code the delete, save and add routines, then add some error checking code. But I’m taking the rest of the day off, it’s too nice of a day to be holed up inside coding.
Android week 10.5
March 25th, 2010Drew up the model editor screen today, couldn’t find any decent looking icons for the db browser, so made my own. They don’t look too bad. Not enough room for everything, so put the lesser used delete and copy functions in the menu. Started coding, but am currently stuck at how to manipulate the db cursor for record browsing, nothing is easy in android.

Android week 10
March 24th, 2010Accomplished much this week. Finalized all the Bayesian routines and tracked down the standard deviation miscalculation. Added registration to the settings dialog. Added a splash screen and an about dialog with an email link. And today, added help and nomogram graph.
Menu

Settings and registration

Splash screen

About dialog

ODA Nomogram

Help screen

One last thing to do, add the model editor, and it will be ready for beta testing.
Android week 9 finale
March 12th, 2010It only took 6 hours to translate the Bayesian routines from Pascal to Java (sarcasm). I decided to do the conversion in a text editor, the auto-complete function in Eclipse made it virtually impossible. The main changes where cosmetic, if blocks, for loops, and arrays are declared and used differently in each language. Some simple examples:
Arrays
VB-NET
Dim x(3,2) as Integer
Pascal
x : array[1..3, 1..2] of Integer;
Java
int x[3][2];
if blocks…
VB-NET
if x = y then
z = 1
end if
Pascal
if (x = y) then
begin
z := 1;
end;
Java
if (x == y) {
z = 1;
}
for loops…
VB-NET
Dim x as Integer
for x = 1 to 3
y = y + 1
next x
Pascal
int : integer;
for x := 1 to 3 do
begin
y := y + 1;
end;
Java
for (int x = 1; x <= 3; x++) {
y++;
}
Then came the dreaded click-to-run and watch-it-crash experience. The first bugs were “array out of bounds” errors. After all that work converting from Pascal, I realized Java arrays are zero-based like VB, instead of 1-based like Pascal. No prob, just add one to the array declarations. LOL, what a kludge.
The next error was string formatting, I didn’t change the Pascal “%.1n” to the Java “%.1f”.
And, amazingly, that was it. It ran through the analysis and gave the exact same pk parameters and dose recommendations as the desktop Pascal coded version. The SD displays are off, I’ll have to dig into that, otherwise, it works as it should. A nice end to the week.
