Archive for the ‘android’ Category

Ground-Up Android, Part 5: Tweeting and Debugging

Wednesday, October 7th, 2009

This is part 5 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1.

In Part 4, we dug into accessing our Views from our Activity’s code, and registered an OnClickListener to handle the user’s interactions with our button. In the final part (a big one!) we’ll cover using J2SE libraries, debugging, and Android permissions.

So far we’ve gotten a lot done without too much “boilerplate” coding, and that’s great. But what we don’t have (yet) is an application that leaves its mark on the world. After all, what’s a Twitter application if people can’t benefit from your 140 characters of deep, meaningful insight into the state of the world (or what you ate for breakfast)?

(more…)

Ground-Up Android, Part 4: Writing the Code

Wednesday, October 7th, 2009

This is part 4 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1.

In Part 3, we defined our layout and prettied up our app’s main screen. Now let’s get to the business of real coding – the stuff that makes the app tick behind the scenes.

(more…)

Ground-Up Android, Part 2: Our First Project

Wednesday, October 7th, 2009

This is part 2 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1.

In the first part of the tutorial, we got Eclipse, the Android SDK, and the ADT set up. In this part, we’ll get into our environment, create our first project and poke around in it, and test out the Android emulator.

Fire It Up

Go ahead and fire up Eclipse, and if it asks, choose a workspace (the default’s probably fine for now). Click on the “new android project” button or go to File -> New -> Android Project.

Click the New Android Project button.

Click the New Android Project button.


(more…)

Ground-Up Android: Getting Started with App Development

Wednesday, October 7th, 2009

This is part 1 of a 5-part series on introductory Android development.

Thinking about testing the waters with Android development? Jump right in. We’ll build a neat little application that interacts with a web service.

Yup.

Yup.

Which one? Twitter, of course.

This is a web form of a talk I gave with Henry Cipolla, CTO of Localytics, at BarCamp Boston 4 and in a longer form at FITC Mobile 2009, updated to cover the 1.6 (”Donut”) release of the Android SDK. The slideshow portion of that talk covers the basic concepts of the platform and slides are available online. I recommend checking it out.

(more…)

Code and Slides from FITC Mobile 2009

Monday, September 14th, 2009

For those of you checking out our presentations at FITC Mobile, here’s the source code for the first session on introductory Android development, and the more complete source code for the second session on Android homescreen appwidgets.

The slides for our intro presentation are hosted on Prezi. Henry will be doing a narrated screencast of his part at some point in the next few weeks, and I’ll be doing a more complete writeup of the code portion with notes in a later post here on Active Frequency’s blog.

You’ll notice I linked in specific files from JTwitter rather than just including the .jar; there’s a lot of unnecessary code in the .jar and the J2SE source is a little lighter and cleaner, and hopefully makes it especially clear what the Twitter client is actually doing.

The demos use the JTwitter library (LGPL), and the icon is from a great Creative Commons set called Tweeties by Chris Wallace.

Active Frequency at FITC Mobile 2009

Saturday, September 12th, 2009

fitc-mobile-logo

FITC Mobile 2009 kicks off tomorrow morning in Toronto. I’ll be leading two developer-geared sessions: Diving Into Android Development (with Henry Cipolla of Localytics) and Android Homescreen AppWidgets.

I’ll also be posting slides, notes, and code from the sessions to this blog during the conference, and occasionally Tweeting from our new Twitter account.

Come by and say hi if you’re going to be there!

Changing Android DRM Breaks Apps

Tuesday, April 7th, 2009

**UPDATE (4/20/2009) – a Google employee has commented on the open bug report and says this will be fixed in a future software release. Whether this makes it into the impending Cupcake update is anyone’s guess, though.**

Today we released the 1.1 update to RockOut Acoustic Pro. This update adds some neat new features like “Fretting Mode,” which lets you hold the screen to “fret” chords and strum using the trackball. We thoroughly tested the application for both new installs and updates from the old version, on both the Android emulator and an actual G1. Everything looked good.

But when we actually put the update on the Market, some users complained the app was automatically force closing (read: crashing) when they installed the update.

I couldn’t reproduce it, but then a user sent me his log files (thanks to the wonderful Log Collector app). Here’s some relevant parts, and then the explanation:

E/PackageManager( 51): Package com.activefrequency.android.rockoutacousticpro has mismatched uid: 10046 on disk, 10047 in settings; read messages:
...
E/Database( 228): sqlite3_open_v2("/data/data/com.activefrequency.android.rockoutacousticpro/databases/song_list.db", &handle, 6, NULL) failed
...

Here’s why this happened: When we first released RockOut Acoustic Pro we had copy protection turned on. I turned it off a day or two later because an odd Market bug that Google won’t really acknowledge causes copy protected apps not to show at all on the market on many phones (normal G1s, not just ADPs).

This only happened, as far as I can tell, to users who previously had the copy protected version of my app installed.

The copy protection mechanism changes the uid of the application, so that non-copy-protected versions of the same app signed by the same key are no longer recognized as the same application, and are denied access to the database and other resources for the application.

This is never documented anywhere in any official Market or Android documentation, as far as I can see.

Plus, we had no way to figure this out on our own because developers can never install their own paid apps off the market, therefore can never test the copy-protected versions of their apps!

Now that I actually know the root cause of the problem, it’s easy enough to google and I can see I’m not the first dev burned by it.

There’s a ticket to fix this but no progress that I can see. This means Google is aware of the problem, yet doesn’t tell you about it when they know you’re about to break updates for your app by checking or unchecking the copy protection box. This is a 100% predictable result, and should be simple to warn developers about before they hurt their reputation or suddenly get dozens of negative reviews.

The absolute bare minimum Google can do is DOCUMENT this. I can’t see it taking more than 10 minutes to add a warning box when you add or remove copy protection from an app already live on the market, and it would have saved me a good hour of frantic hunting for a bug in my code that wasn’t there.

Is just disclosing this to developers too much to ask?

RockOut – The First Virtual Guitar for Android

Tuesday, February 24th, 2009

rockout-screen-2-phone1Active Frequency LLC is proud to announce the release of RockOut, the first virtual guitar for Google Android phones like the T-Mobile G1. Just strum the onscreen guitar to play chords sampled from real guitars.

Read more about RockOut for Android…