Android

Android Advice: Shared Home Phone Numbers

Posted in Android on March 21st, 2009 by Christopher Souvey – Be the first to comment

One of the things that has always annoyed me with cell phones is that there is no good way to handle multiple people having the same home phone number.  Android’s contact manager allows multiple contacts to share the same number (because the database is not indexed by phone number, like on many older phones).  This still wasn’t perfect for me, however.  When a phone number shared by multiple contacts calls, the first match (sorted alphabetically A-Z) is displayed on the caller ID screen and in the call log.  Fortunately, this consistency means we can manipulate the system to display a custom name.  The following steps illustrate the technique:

  • 1. Lets say we have a theoretical family: John and Jane Smith.  They each have a cell phone, but live together and therefore share a home phone number.  They each are added in Android with their mobile number as their primary number, and their home number as their secondary number.  Both can be called at either their home or mobile number from the contact list.  When a phone call is recieved from their home number, Jane Smith is displayed in the caller id and call logs because she is first alphabetically.
  • 2. For this technique to work cleanly (without any additional clutter), you must have your Android contact manager set only to display “My Contacts” (this settings is under Contacts > Menu > Display Group > My Contacts)
  • 3. Log into Gmail and switch the contacts view
  • 4. Create a new group to put these combined “metacontacts” (I called the group “Metacontacts”)
  • 5. Force your G1 to synchronize contacts (Home Screen > Menu > Settings > Data synchronization > Uncheck and then recheck “Contacts”)
  • 6. Tell your G1 to synchronize this new “Metacontact” group (Contacts > Menu > Edit sync groups > Check “Metacontacts”)
  • 7. On your Gmail Contact Manager, in the “Metacontact” group, press the new contact button (person with a +)
  • 8. Enter the name you want to display when the number calls (ex: “The Smith Family” or “John and Jane Smith”)
  • 9. Add some form of symbol in front of the contact’s name to cause it to be first alphabetically.  I used a period because it takes up the least space, and then put a period at the end as well for symmetry ( .The Smith Family. )
  • 10. Add the shared home phone number to this new contact
  • 11. Press the save button
  • 12. Press the “Groups” button and then click “Remove from… My Contacts”.  This will prevent the contact from showing up in Android’s contact list, but because we chose to synchronize the “Metacontacts” group, it will still be in Android’s database when it does a caller ID lookup.
  • 13. Repeat steps 7-12 for each custom home phone number contact
  • 14. Force your G1 to synchronize contacts again (Home Screen > Menu > Settings > Data synchronization > Uncheck and then recheck “Contacts”)
  • 15. The new custom contact name will now show up in the call logs and when the number calls, but each individual contact (ex: John and Jane) will still have the number stored, so you can call their home number by clicking their name in contacts.

It works almost perfectly for me, but there are few caveats to this method that you should be aware of:

  • Every time you change the combined contact (“metacontact”), it automatically readded to the “My Contacts” group and you will have to remove it
  • The combined contact (“metacontact”) will have the symbol you chose (in my case, a period) in front of their name, so if this bothers you, this isn’t the technique for you

Android Development Details I

Posted in Android on March 17th, 2009 by Christopher Souvey – 3 Comments

I’ve decided that from now on, along with all my Musical updates, I’m going to post some useful advice/tips/code/etc  to help others solve any problems I might have encountered during the development of the update.  So, here is the first of hopefully many “Android Development Details”

Today’s One Liner:
Get the current “android:versionCode” from AndroidManifest.xml:
getPackageManager().getPackageInfo(getPackageName(), 0).versionCode

Problem/Solution:
Once a media file has been detected on the SD card by Android’s MediaScanner, it is automatically to the MediaStore.  The MediaStore is a SQL database used by all media-based applications instead of directly accessing the file system.  Unfortunately, once an item has been added to the MediaStore, it is not immediately automatically removed when you delete the original file off the file system.  This has to manually be done in the database.  The easiest way I could find to do this is to get access to the Content Provider with getContentResolver() and call the delete() method with the arguments MediaStore.Audio.Media.EXTERNAL_CONTENT_URI (external because it is on the SD card) and a SQL WHERE clause indicating which file to remove. In my case, I needed the WHERE clause to find a specific file based on its path on the file system (since I had just deleted the original based on its path). The unix absolute path is stored in the MediaStore.Audio.Media.DATA (Note: this is a constant not a String–it must be concatenated into the SQL WHERE clause) column in the MediaStore database.

Hopefully these tips are helpful to some other Android developers, and as always, feel free to email me with any questions!

Severe Android Market Bug!!!

Posted in Android, Musical on March 2nd, 2009 by Christopher Souvey – 2 Comments

As you all know, I uploaded a new version of Musical to the Market tonight.  I just checked my comments, and apparently my application Force Quits now when you open the Keyboard and Piano!  I tried for about 30 minutes to replicate the problem myself, but could not get it to happen (and since the Market doesn’t let you buy your own application, I couldn’t see if it had to do with the Market).

I did a bit of Googling, and apparently the issue occurs when you change the Copy Protection status on the application.  After reading how useless Android’s DRM was, I had decided to just disable with this update (particularily since it halves the size of the app too).  From what I can tell in the Google Developer Group, when you update to an application with a different DRM status, all WebViews cause Force Quit errors!  I can’t find any workaround and Google doesn’t appear to have even acknowledged the bug.

So, I have re-enabled DRM again on the application until I can find evidence that this issue is fixed, which will hopefully fix this problem.

All users who have updated OR bought the application between around 5pm and 11pm PST Sunday should uninstall and redownload Musical.  I am told that this will fix the problem (I would do this even if you aren’t having the problem, becasue if you just bought it, you will have this problem the next time I update).

And that my friends, is how I learned my lesson about DRM.  It’s a disaster.

Android RC33

Posted in Android on February 7th, 2009 by Christopher Souvey – Be the first to comment

I finally got sick of waiting for RC33. I looked up online how to download and install it manually. I downloaded the file off Google’s servers, renamed it, and plugged in my phone. Before I could copy the file to my phone, T-Mobile pushed the update to me :P . Amazing coincidental timing? Or perhaps Google tracking my search for RC33, testing my internet speed, predicting when I would finish downloading it, and having T-Mobile’s servers push the update to my phone (that would be really cool :P ).

There have already been a ton of reviews published online, so I’m not going to go into a ton of detail. Latitude is cool, but not useful yet since none of my friends use it. Voice Search is cool and works well, but I don’t know if I’ll ever actually use it. Nearly every app I had installed had updates available in the Market (since the Market now informs you), so I spent 15 minutes or so updating them all (I wish it had autoupdate).

However, there was one thing that wasn’t in any of the change logs and that I haven’t seen in any of the major reviews: the camera. The camera application seems to have improved tremendously. In the past, for me (perhaps this was an isolated issue, since I’ve never met anyone else with a G1), the camera had an absolutely awful refresh rate and updated very slowly (lagged, blurred, etc). Now, it looks beautifully smooth. It also seems to take less blurry and better pictures, but that could be a placebo after noticing the other change. Perhaps this is as a result of some changes being made to allow for Cupcake’s video recording (which I had wondered about due the remarkably bad frame-rate of previous versions).

The update process was easy and painless. The only hiccup I experienced was that the update froze on the Android boot screen (with the small logo and text) for about 5 minutes. I’m not sure if this was a glitch or part of the update procedure, but it seems to be running great now!

Lessons From a Month in the Android Market

Posted in Android, Musical on December 16th, 2008 by Christopher Souvey – 7 Comments

It’s just just over a month since I first uploaded Musical to the Android Market. Since then I’ve gotten 17,500 downloads (over 8000 active installs), 318 reviews (for an average of 4/5 stars), and emails from over 40 users.

In the process I’ve learned quite a bit about how the Market operates and more importantly, about dealing with its users. The following is a collection of notes, helpful tips, and my thoughts on the Android Market…

read more »

OtherInbox for Android

Posted in Android on November 22nd, 2008 by Christopher Souvey – 3 Comments

Been working on Android App #2 – an OtherInbox client.  For those of you who don’t know, OtherInbox is “the cure for email overload” (designed to separate out and organize mass-mailing-style emails from your regular inbox, leaving only personal emails).  If you want an invite, just leave a comment on this post (I have more invites than readers of this blog).  I finally got some time to get started on the app and have thrown together just over half of the interface.  At the moment, the app isn’t actually usable, as it does not connect to the network, but the interface itself is working.  Once I’ve finished up the UI (hopefully fairly soon), I’m going to write up a background service to make it all work (with support from the very helpful OtherInbox team – Thanks!).

Here are some screenshots of what I’ve got so far:

Android Metronome

Posted in Android, Life, Musical, Technology on November 15th, 2008 by Christopher Souvey – 12 Comments

Android Metronome AppAbout 3 weeks ago, I bought a T-Mobile G1 (the Android-based “GooglePhone”).  I’ve been working in my free time for the last 2 weeks on learning the Android SDK so I could write some programs for it.  The first program decided to write was a program for musicians.  Yesterday (November 15), I finally got the first feature–the metronome–in a working state.  I uploaded by application to the Android Market (same idea as the iPhone’s App Store, but until Q1, everything has to be free).  Now nearly 24 hours and 3 updates (suggested feature additions and bug fixes), my app has 2175 downloads (1638 active installs) and 110 reviews (with an average of 4/5 — there is not a single app with a 5/5, the highest so far is 4.5/5).  I’ve already received 9 emails about the application.

Not bad for the first 24 hours of my first Android app (and first Java app in a very long time) :P

In fact, in one day, this app has gotten more users than all my previous programming projects combined!  And its not even close to done yet!

I’ll continue to post updates on this and my (hopefully many) future apps.