Christopher Souvey’s Blog

My technology, my musings, my life…

Archive for March, 2009

Musical Pro 1.2 Released

I just published Musical Pro 1.2 with piano scroll locking, computer MIDI input over WIFI, and the ability to switch the upper and lower octaves on the keyboard (as requested this morning by a user).  More details about the scroll-locking and the MIDI support are explained in my post Musical Pro Update Preview (MIDI Support) from last week.  For now, the Desktop Client (required for MIDI input over WIFI) is in beta, mainly due to the lack of documentation.  If you would like a copy of the application, please email me (souvey+androidmusicalpro [at] gmail [dot] com — this address also appears on the Market page for the application) and I will assist you in setting it up.  Once a couple people have tested it out, I’ll post a public release to download here on my blog.

  • 0 Comments
  • Filed under: Musical
  • Android Advice: Shared Home Phone Numbers

    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
  • 0 Comments
  • Filed under: Android
  • Musical Pro Update Preview (MIDI Support)

    I just finished up the latest update to Musical Pro, which I will hopefully be publishing tomorrow.  I just have to finalize the Desktop Client (more on that in a bit).  I’ll post a more comprehensive explanation tomorrow, but there are two new features (one minor feature that everyone asked for, and one major feature that almost nobody asked for).

    On the minor front, the scrollable piano can now be locked so it doesn’t scroll by accident.

    The major feature is that the Piano and Keyboard can now act as MIDI controllers for your computer over WIFI.  This means, for example, that you can use the touchscreen to record or input notes into Finale/Sibelius/GarageBand/etc.  This will be made possible by a Desktop application that will run in the background and communicate with the G1 over WIFI (although, it is technically possible to use USB as well, but it will require some setup).  It will initially (hopefully tomorrow) be released for Windows only, because I don’t have a Mac, but the application is written in Java, so it should (in theory) also work on a Mac.  If anyone wants to test it for me, shoot me an email and if it works, I’ll release official Mac support.

    The idea for the MIDI support came from a user, so remember, don’t hesitate to email me if there is anything you would like that Musical doesn’t currently have.

    UPDATE: The desktop client is available for download here http://www.souvey.com/musical.  You must have the latest version of Musical (released on June 18th)

    http://www.midiox.com/
  • 23 Comments
  • Filed under: Musical
  • Android Development Details I

    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!

  • 3 Comments
  • Filed under: Uncategorized
  • Musical Bug Fixes

    I just pushed out a minor update to both Musical and Musical Pro with 2 small changes.

    Firstly, the Piano and Keyboard components now remove all of the temporary files they used to leave behind on the SD card. I don’t use Android’s “Music” application, so i didn’t realize that, much to the annoyance of those who do use it, all media files on the SD card are automatically added to your Media Library. Every note on the piano was being added to this collection and cluttering up the application. The next time you use the Piano or Keyboard, these should all be cleaned up.

    Secondly, all future updates will now display a brief list of changes the first time the application is loaded so the people who don’t stay up to date with my blog (aka nearly everyone) will know what I’m up to and what to look for in the new version.

  • 6 Comments
  • Filed under: Musical