June 2011 - Posts

Published My First Android Application!

While I’ve been playing around with Android development for a few months and I’ve started half-a-dozen various apps, I finally completed one and submitted it to the Android Market.  It’s a simple SQLite database app that contains the 2011 ferry schedule for the Star Line Mackinac Island Ferry.

Starline publishes a PDF with their complete schedule and it’s sitting in one of my Dropbox folders.  But viewing the schedule meant I had to open Dropbox, navigate to the folder then click on the PDF to download it. Then wait for the PDF to appear and navigate to the schedule and pinch/zoom to find the date range I’m looking for.

With my application, you simply pick your dock and then click on handy “Today” or “Tomorrow” buttons which will automatically calculate which date range you fall in.  Then you’ll get a listing of departure times both from the mainland and from the island.  You’re also free to pick any of the published date ranges to see times for the entire regular season.

If you’re planning a trip to Mackinac Island and plan to take the Star Line ferry, it’s a nice way to keep the schedule with you at all times.

Posted by PSteele | 2 comment(s)
Filed under:

Taking Android Emulator Screenshots WITHOUT Eclipse.

I’m working on an Android app and before publishing it to the Android Market, I needed some screenshots.  I assumed the emulator supported screenshots, but when I did a search for “android emulator screenshot”, most of the hits talked about how to do it from Eclipse.  I’m using IntelliJ IDEA Community Edition.  However, based on the descriptions, I understood what was going on.

The Eclipse plugin is talking to the emulator directly.  If you want to do that outside of Eclipse, you can do it using ddms – the Dalvik Debug Monitor.  Go to your Android SDK directory and look in the “tools” directory.  Run the “ddms.bat” file.  This will launch the Dalvik Debug Monitor.

image

From here, getting screenshots is easy.  Select the emulator that is currently running (in my case, “emulator-5556”).  Now start the screenshot application by either going to the “Device” menu and selecting “Screen capture…” or simply pressing CTRL+S.

image

Go back to the emulator, do whatever it is you need to do and when you’re ready for a screenshot, go back to the Device Screen Capture window and click “Copy” to save the screenshot to the clipboard or “Save” to open up a file browser where you can pick the location to save your image.  If you need more images, go back to the emulator, go to your next view/screen/whatever and then return to the Device Screen Capture window and click “Refresh” to update the image.

Posted by PSteele | with no comments
Filed under:

HOWTO: Change which “.testsettings” file Visual Stuido 2010 uses

I’m blogging this mainly for historical reasons.  I just spent over 30 minutes trying to figure this out.  Well, the first 10 or 15 minutes was getting code coverage enabled in Visual Studio 2010.  There’s plenty of coverage on that topic since it’s not as intuitive as it could be.  I’ll let Google handle that one.

Visual Studio 2010 allows you to create multiple “testsettings” files in your solution.  This allows you to set up customized configurations to control deployment, code coverage and a ton of other settings.  My solution has two settings (I think these are the defaults): “Local.testsettings” and “TraceAndTestImpact.testsettings”.  I configured Code Coverage in my “local” test settings.  I then ran my unit tests and went to check out the code coverage.

Visual Studio told me there was no code coverage data available – and prodded me to check the test results for errors.  I looked at the test results and didn’t see any errors but I did notice one thing.  The “Results Summary” for my test run displayed:

Test settings: TraceAndTestImpact

Ah ha!  So it’s not using my Local settings.  All I need to do is tell the unit tests to run with the “local”  testsettings file and I’ll be all set.  But how do I do that?  A few Google searches didn’t reveal much.  I finally (out of desperation), checked the ol’ drop down menus.  Under “Test” there is an option called “Select Active Test Settings”.  Under there, you can pick which settings file to use.

 

image

Posted by PSteele | 1 comment(s)
More Posts