The Logan and Andy Morning Show

Month

July 2010

20 posts

still integrating the stats widget

I think the bulk of the integration work is done now. The stats are coming from the existing API client code in the Foursquared app; leaderboard ranking still comes from Nick’s HTML scraper.

No screenshots yet or a build yet, because the error handling and lifecycle management need some improvement. Foursquare is down at the moment, and as a result the widget is exploding.

Still, it’s about ready for first push on a branch; I’ll try to do that today or over the weekend.

Jul 30, 2010
widgets are cool

Spent this morning idly poking around the code for this very cool Foursquare widget whose author posted to the Foursquared-dev group yesterday. Tomorrow morning I’ll set about integrating it as a branch off of hg/master. Hopefully that will smooth the way for upstream inclusion.

Jul 28, 2010
nearby venues sorted by distance

I ran across issue 203 in the tracker this morning, and was reminded of how annoying it really is when you’re trying to check in and you end up searching just because otherwise you have to hunt through the list. So now the Nearby Venues tab sorts by distance.

I don’t really feel like getting into anything deep this morning, so I’m cashing in yesterday’s work and spending the rest of today’s time catching up on some reading.

Jul 26, 2010
bonus Sunday build: blinky light and a bug fix

This build pretty much finalizes the notification LED. The color and pulse rate have been tweaked and there’s a new checkbox in the pings preferences to turn it on or off.

There’s also a fix for a very annoying bug that was introduced in Friday’s build (but only on the integration branch; nothing sent upstream has it).

Jul 25, 2010
branches and merges

I’ve merged in the most recent changes from the central Hg repo. I’ve also pushed branches issue205, purple_led, and integration. From now on, the integration branch is what I’ll build packages from.

The sync adapter really is looking pretty good now, so I’ve reached out to foursquared-dev to see what they like in a patch contribution. In the meantime, obviously, I’m branching out to other features and bugs.

Jul 23, 2010
geo fix activate

I spent this morning testing my little patch for issue 205 and then getting it into Hg and pushed into my clone at Google Code. I know I haven’t taken the time to configure Hg the way I have git, so this is maybe not a fair assessment, but Hg feels very stripped down and somewhat awkward by comparison.

It is fair to say that GitHub wipes the floor with Google Code. I couldn’t even find my own clone easily (had to directly go to my own profile URL, because I couldn’t find a link or a list of my clones). I still don’t know how to issue a pull request to another user, or even whether you can.

I did run across another potential bug, or maybe just a gap in my understanding of the Android location service. After I issued a geo fix command to the emulator (to set a location), Foursquared’s PingService was still not able to get a last-known location. As soon as I opened Maps and it hit the location service, PingService got what it was after. I’ll be looking into that as soon as I’ve gotten the purple blinky light just so.

Jul 22, 2010
dull tools

Lost a lot of time this morning to the following:

  • the emulator taking forever to start/boot
  • IntelliJ starting the emulator but not connecting to it, necessitating a restart
  • the emulator starting up with no network, necessitating a restart
  • inability to export a signed package with IntelliJ, necessitating running Eclipse
  • Eclipse startup taking forever

As a result, I have a patch for issue 205 which I haven’t been able to verify, and I only got one shot in at purple LED notifications (it’s flashing white).

I’m gonna need a bigger boat.

update: I was wrong, that trackball is definitely flashing purple for Foursquare checkins!

Jul 21, 2010
just another bug hunt

Yesterday evening I fired up Foursquared and saw some checkins for which I’d not received pings. This is clearly not ok, and there seemed a decent chance my sync code (which runs on pings as well) was the culprit. So this morning I got my plasma rifle and my sharp stick and went hunting.

There’s no evidence so far that my sync caused the pings to fail, but I did find this other bug.

Jul 20, 2010
fixed a Contacts editor crash

First thing this morning I plugged in my phone, turned on USB debugging, and tried to edit my new Foursquare friend’s entry in Contacts. This stack trace showed up in LogCat:

I’d been inserting nulls into various columns when adding new Contacts, and it seems I’d finally run across one who didn’t list her phone number. When the Contacts view tried to parse the null, it asplode.

To be safe, I’m no longer inserting nulls anywhere, but this raises the question of what to do when I need to remove the value from a given column. Hopefully it’s in the docs, but I’m out of time for today so it’ll have to wait.

7 files changed, 65 insertions(+), 90 deletions(-)

Jul 19, 2010
1 bug fixed, 1 still a mystery

Last night I accepted a friend request on my phone, running yesterday’s build. Two bad things happened.

  1. My new friend appeared in my Friends list, but her picture never changed from photo frame to QuickContactBadge.
  2. When I attempted to edit the new entry in Contacts, acore bombed and I had to force close it. I joined the new Contact into an existing entry I had for her, but attempting to edit that entry crashes Contacts as well. I can edit other contacts who have Foursquare profiles.

The former is now fixed. I was still only syncing new checkins when the friends list updated, rather than adding new friends as well.

I have no idea what’s causing the Contacts/edit crash yet.

5 files changed, 34 insertions(+), 16 deletions(-)

Jul 16, 2010
performance: much improved

I made some performance improvements which had two very noticeable effects on my phone:

  1. Scrolling through the FriendsActivity list is no longer jerky.
  2. When sync occurs or is disabled, the UI no longer makes grinding noises and emits smoke; users’ pictures all just update to either photo frame or QuickContactBadge at once.

The improvements are pretty straightforward. First, instead of firing an event out of the sync Observable every time something changes in Contacts or Accounts (which happens at least once per friend when you sync, for instance), I batch all those changes up and fire one event when things calm down. Second, Sync.getContactLookupUri()— which is made every time an Adapter needs to decide whether or not to use a QuickContactBadge— is now using a cache so that most of the time you’re just doing a Map lookup instead of querying the database. These two changes together result in the UI being told to refresh itself less frequently and being able to do so more cheaply.

9 files changed, 147 insertions(+), 48 deletions(-)

Jul 15, 2010
observations and eavesdropping

Thanks to a ContentObserver and an OnAccountsUpdateListener, I now have the FriendsActivity view updating when friends are synced or removed from Contacts.

Unfortunately I’m flat out of time for the morning, so I’ll push, package, and post after I add observers to the other Activities tomorrow morning.

update: to performance-crippling effect on my phone.

Jul 14, 2010
stupid ContentObserver

Why do you not observe my content?

Jul 13, 2010
still consolidating

Pulled more functionality into SyncImpl. The adapter is now just a thin wrapper around SyncImpl.syncFriends(), which is right and proper.

I’m working on making the actual sync state observable, instead of just the preference change. That is, whenever a contact is synced or the account is deleted from Contacts, an event should fire. I’m almost there— the only thing left really is to watch for account deletion.

By the way, if your Observers aren’t receiving events you think they should be, maybe you’re calling notifyObservers() but forgot to call setChanged(). I mean, it could happen. The potential is there.

17 files changed, 495 insertions(+), 401 deletions(-)

Jul 12, 2010
Getting ready for upstream

I didn’t post yesterday, but I did do some (uncommitted) work. The current focus is getting my code into shape for submitting upstream. This includes reducing the footprint of the touchpoints in the existing code; minimizing reflection for the sake of maintenance; and generally reorganizing the code so that it’s more coherent and easier to evaluate.

Today I’ve been putting a sterile interface in place and pulling code back out of the Activities into an implementation of that interface. I call it “sterile” because the interface itself contains nothing that would cause compatibility problems; I can just switch implementations once when the app is created and be good to go. This also means that a lot of the reflection code goes away, because use of newer APIs is all encapsulated in an implementation class that is never loaded if those APIs aren’t supported.

Jul 7, 2010
fixed some UI bugs

Happy Fourth!

Tomorrow: UI performance.

5 files changed, 30 insertions(+), 22 deletions(-)

Jul 4, 20101 note
backward compatibility: check.

UPDATE 2: Fixed. Now you shouldn’t see sync or QuickContactBadges before Eclair, and should see them on Eclair or later.

10 files changed, 82 insertions(+), 57 deletions(-)

UPDATE 1: Posted too soon. This is so backward-compatible it’s disabled on phones that should support it. Fixed build will be posted shortly. In the meantime I’m removing the package.

Anybody who’s itching to install a fork that adds features you can’t use anyway: you’re good to go now!

This required a fair amount of hoop-jumping, as you can see in the commit diff. The reflection ended up not being too terrible, but it’s not exactly elegant either. The worst part is the SometimesQuickContactBadge, which is just an ImageView that exposes the AttributeSet with which it was constructed. I couldn’t find a cleaner way to conditionally convert an ImageView into a QuickContactBadge.

I did get the project pulled into IntelliJ IDEA with very little effort, so at least I didn’t have to use Eclipse to go through all of that. The only thing that didn’t work was exporting the signed APK, but I just chalked that up to using an EAP build.

16 files changed, 353 insertions(+), 243 deletions(-)

Jul 3, 20101 note
hey, Fitch: QuickContactBadges!

I’ve added QuickContactBadges everywhere I could find a user photo that didn’t already do something when clicked. This may not be the right approach; time will tell. Right now, I like it this way. Users who are not in Contacts (because they’re not your friends) should still have the original, non-badged photo view.

Learned a few things in the process; will try to post again over the weekend.

9 files changed, 213 insertions(+), 35 deletions(-)

Jul 2, 2010
Go directly to a friend's Contacts entry

also: merged in the latest changes from the mainline.

also: many bug fixes, including a crashy crasher.

6 files changed, 92 insertions(+), 57 deletions(-)

Jul 2, 20101 note
Checkins sync when app screens update

Still knocking out sources of inconsistency between the info you see in Contacts and the info you see in the Foursquared app.

Both the MainActivity and the UserFriendsActivity, upon updating with the latest checkins, will sync those checkins to Contacts in a background task. They do not yet do a full sync of all contact info, or add/delete friends from Contacts. That’s next.

The PingService also now respects the sync preference.

I have not yet merged the most recent changes from the Hg repo, because there’s a missing string for a Facebook API key. Need to sort out what to do about that first.

5 files changed, 80 insertions(+), 5 deletions(-)

Jul 1, 2010
Next page →
2010
  • January
  • February
  • March
  • April
  • May 14
  • June 22
  • July 20
  • August 14
  • September 3
  • October
  • November
  • December