Jumat, 11 Februari 2011

Contacts Contract: Intro and Getting Started

If you've been using Android awhile, and have used the Contacts feature at all, you may have noticed that when you push your SDK forward a few versions, many of the calls are now listed as deprecated.

This is because the Android project revamped how the contacts system works in Android 2.0 (API Level 5). The updated system is much more flexible, while also taking a bit more code to use properly. Over at Mobiletuts+, we wrote an article quite a while back that has a quick overview of using the new APIs in context of using the contact picker. Android Essentials: Using the Contact Picker demonstrates how the queries are now often broken up due to increase in the number of internal tables used (or, that's mostly likely the cause).

You can also directly view the open source code for this tutorial.

Kamis, 03 Februari 2011

Tip: New Layout Editor Exceptions

Does your Android Eclipse layout editor look like Figure 1? Does it show "Missing theme." or perhaps an error in the logs (perhaps something to do with "com.android.ide.eclipse.editors.layout.LayoutEditor")? These are frequent occurrences on the very latest Android SDK Tools.
Figure 1
Layout Editor errors
 (Click for large view)
If you're having these types of issues, the solution may be simple. See that empty dropdown on the far right? Perhaps it's not empty, but shows the Android version? Yeah, the one highlighted in Figure 2 shown below... Click on this dropdown and pick one of the options.
Figure 2
Layout Editor Drop Down
(Click for large view)
Does your layout editor now look like Figure 3? If so, you're all set. If not, you'll need more than just this tip.
Figure 3
Layout Editor, no errors
(Click for large view)
Why the new dropdown? We believe that it will show what a layout should look like on various versions of Android platform. So, presumably, you'll want to pick your Target SDK most of the time and if, during testing, you find a problem outside the target SDK, this drop down may help speed up layout debugging.

Happy Android Coding!

Selasa, 01 Februari 2011

New Feature: Book Code Downloads

Many readers have found it difficult to access the book code downloads from the official publisher site. After some discussion with our editor, we are pleased to inform you that we now have them hosted separately and available for easy, direct download. (No login should be needed and certainly no verification that you own the book. But you already bought it, right? :) )

In addition to providing a new source for downloading the files, we have also provided a single download for all of the code for each book.

The download link is convenient found right next to the Home link above, under "Book Code Downloads."

Happy Android Coding!

Jumat, 28 Januari 2011

Discounted Android Books for Purchase

Android Wireless Application Development (2nd Edition) (Developer's Library)Don't think you'll win a free (signed) copy of Sam's Teach Yourself Android Application Development in 24 Hours from Mobiletuts+? Already have the Sam's book or the first edition of Android Wireless Application Development, but haven't gotten around to buying the second edition?

Well, InformIT is offering up a discount for the second edition of Android Wireless Application Development -- 40% off with the coupon code ANDROID until March 15, 2011. That's a little better than the regular Amazon price. :)

Rabu, 26 Januari 2011

Honeycomb Preview Now Available

Earlier today, I was just telling someone how we lesser mortals almost never get SDKs much in advance of hardware anymore. Well, we just got one: the Honeycomb SDK preview.

And, besides the preview, the SDK tools and plugins have been updated. Sounds like good stuff. Now to go digest it all for an afternoon snack.

Even if you can't use the new SDK, don't forget to update your tools.

After you've digested it, let us know your favorite new features!

Free Android Development Books!

Sams Teach Yourself Android Application Development in 24 Hours (Sams Teach Yourself -- Hours)Mobiletuts+ is offering up several signed copies of Sam's Teach Yourself Android Wireless Application Development in 24 Hours. For Free! You could be a winner!

So head on over there and give it a shot if you haven't taken the dive yourself already. Check out Mobiletuts+ for great Android tutorials, many written by yours truly.

Selasa, 18 Januari 2011

Phrasebook Map Intents: Redux

Maps 5.0 at 1024x600 (click)
Zoomed all the way out at z=2
As part of a review of some of our applications we've created as part of articles, we revisited the Phrasebook app found on Google Code. Written with Android 2.2 in mind, the application still runs fine on both Android 2.3 and with Tablet displays (e.g. 1024x600).

However, one strange issue did come up: the geo URLs for the addition of launching maps from Android SDK Quick Tip: Launching Maps In-App don't all work as expected with Maps 5.0. The default one, the world link, used:

geo:0,180?z=1

Sending this actually causes Maps 5.0 to crash. It works fine in Maps 4.2 and 4.7 (available in Emulator 2.2 and 2.3, respectively). The fix? Change z to 2. This is odd, because 1 is documented by Google to show the whole world. (Though, there is a note that the geo URI is still under development. The linked-to document is from 2007, though.) We clearly see in the above screenshot that there are no levels of zoom farther out now.

Next, we wanted to test the rest of the queries to see if any others were affected. Here they are, and the results:

"geo:0,0?q=Belgium": Success
"google.streetview:cbll=46.813812,-71.207378&cbp=1,99.56,,1,-5.27&mz=21": Success
"geo:0,0?q=Matterhorn&z=8": Success
"geo:0,0?q=Coffee Shops near Paris, France":Success

So, it's reasonable to expect the only thing to now avoid are zoom levels of 1. The fix has been pushed up to the repository.

This experience is a great example of the sort of maintenance applications can take. Not only should they be tested on devices with new firmware and SDK versions, but any other applications that they rely on also need to be updated and tested against. Maps 5.0 is not yet found within an emulator, so this testing requires a handset with Maps 5.0 on it.
ANDROID BOOK © 2008 Template by:
SkinCorner