Answering an Often Asked Question

RA New Year 2013First, Happy New Year! I hope that 2013 proves to be a year of great growth and accomplishment for you and your company. Though I’ve been here for a short time, that’s what I’m looking forward to at Recursive Awesome.

As we continue to grow…that’s right…continue, I want to answer the question I’m most asked about Recursive Awesome: “Weren’t you guys bought by Code 42?” If it’s not those words exactly, it’s something close. And it’s a fair question. Especially based on coverage of the agreement with our friends at Code 42.

So let me answer it….

In short, during 2011, Recursive Awesome merged our engineering team with Code 42 Software to focus on building products based on Code 42′s cloud infrastructure. The professional services team continues to operate separately under the Recursive Awesome brand. It’s that simple.
We haven’t gone anywhere, we continue to work with great companies and brands on great mobile and web products…especially mobile. The people who founded Recursive Awesome still see to it that the dedication to innovation, quality, and customer service on which they founded the company continues to be its backbone. In short, we continue to strive for ‘awesome’.

In fact, that dedication to awesome has allowed us to grow our portfolio.* In 2013, we look forward to continue that growth, keeping in mind that we are not looking to be the biggest, just the best.

So if we can help make your 2013 ‘awesome’, we’re here, as we have been since 2009.

*We are looking for developer and software architects to join us. Please be sure to check our Careers page for opportunities.

 

Objective-C simple type comparison chart

I’ve always been a fan of PHP’s type comparison tables, and today Aaron and I started talking about how you can write the following in objective-c, but not in java:

if ( myObject )

I started wonderring how this works. Is [myObject description] getting called behind the scenes here? (Spoiler: The answer is no.)

I built a quick project to figure out why this happens, and some of my results were surprising. Essentially, you should never write if ( myObject ), because it is probably not what you want. It’s basically always true unless you initialize your objects to nil. (I actually recall that auto-initialization of objects to nil was one of the new language features announced last week at WWDC.)

Here are my findings for the statement: if ( X )

nil false — Interestingly, this is defined like this:
#define nil NULL
NULL false — Defined as follows:
#define NULL ((void*)0)
MyObj *myObj; true — (In some brief googling, I couldn’t figure out whether this was random memory access, or just looking at the pointer itself.)
MyObj *myObj = nil; false
MyObj *myObj = [[[MyClass alloc] init] autorelease]; true
@"" true — This is just creating a new NSString
0 false
1 true
YES true — Definition: #define YES (BOOL)1
true true — Definition: #define true 1
TRUE true — Definition: #define TRUE 1

I learned something. I hope Aaron did too.

Code 42 Software Just Got a Lot More Awesome

This week two Minneapolis-based technology powerhouses, Recursive Awesome and Code 42 Software, joined forces to announce a strategic merger.

Recursive Awesome, a mobile, tablet and web development firm, have spent the last two years hiring the Twin Cities’ best Android, iPhone and Ruby on Rails developers.  While Code 42 was looking to add more talent to their product-based development team.  The union was a perfect match.

The transition will happen in the coming months.  Several developers have already moved over to the Code 42 office, while others will continue to work with Recursive Awesome clients, until current contracts are complete.

Full Press Release:

June 01, 2011 09:50 AM Eastern Daylight Time

Code 42 Software Acquires Mobile Developer Recursive Awesome

Deal enhances Code 42’s mobile and post-PC backup solutions development team

MINNEAPOLIS–(BUSINESS WIRE)–Code 42 Software Inc., developers of CrashPlan and CrashPlan PRO, award-winning backup software for home and business, today announced the acquisition of Minneapolis-based mobile development company, Recursive Awesome. The merger of the two teams will enable Code 42 to extend its cross-platform backup solutions (already the most widely-compatible in the industry) beyond desktop operating systems to embrace the needs of mobile device users as well.

“You can spend years working to get your own products off of the ground, or you can partner with a successful product company”

“We are thrilled to begin working with the Recursive Awesome team as we see it as a match made in heaven,” said Matthew Dornquast, co-founder and CEO, Code 42. “It became obvious we had familial business DNA – products, customers, values – all nearly identical. The addition of some of the best mobile talent in the country, combined with our base of some of the most influential businesses and users in the world, position Code 42 to continue to innovate, especially in the mobile environment.”

Founded in 2009 by Justin Grammens and Sam Schroeder, Recursive Awesome specializes in creating tablet, mobile and web applications for a host of high-profile clients, including Best Buy, Ecolab, McDonald’s, Geek Squad and Boston Scientific. Focused on developing applications for the Android, Blackberry, iOS, and WP7 platforms, and having developed its own video streaming service for iPhone and Android, Recursive Awesome has the proven experience to bring mobile products to market.

“You can spend years working to get your own products off of the ground, or you can partner with a successful product company,” said Schroeder. Grammens continued, “This isn’t about one company acquiring the assets and client list of another company. It’s about two very talented teams, coming together to build awesome products.”

The entire Recursive Awesome team will join Code 42 Software in their newly expanded headquarters at 1 Main St in Northeast Minneapolis. To learn more about Code 42 Software, please visit www.code42.com.

About Code 42 Software, Inc.

Code 42 Software, a privately-held company based in Minneapolis, Minnesota, has been developing software to protects the world’s data since 2001. In 2007 the award-winning consumer solution, CrashPlan (Backup for Everyone) was introduced, followed a year later by the enterprise solution, CrashPlan PRO. Both products offer multi-destination, cross-platform backup onsite, offsite and online. For more information, visit www.code42.com.

Contacts

BLASTmedia for Code 42 Software
Ryan Greives, 317-806-1900, ext. 120
ryan@blastmedia.com

 

iOS Book Reviews: Professional iPhone and iPad Database Application Programming

Disclaimer: I do not generally read programming books from start to finish! Instead, I read them much as I would read a blog that I’ve discovered for the first time, skimming the archives (table of contents), and then taking-in the first few sentences of parts that look interesting to me, and bookmarking posts that I want to read in greater depth (dog-earing pages that deserve a second glance). I almost never go back for those second glances, so basically I have a bunch of programming books laying about that look like they’ve been heavily read, when in fact they’ve hardly been cracked. My excuse is that programming books are so seldom relevant past their publish date that keeping them for reference seems silly. If I’m paging through a book’s contents in search of some solution, it usually means I just don’t know the right search terms. When I find some pages that seem relevant, I then turn to the web with my newfound knowledge, and feel vindicated when I find some piece of web-content that appears (at least at first glance) to be superior and more timely.

I do still tend to keep those books around, however, mostly so I can look through their code examples. I find books that consist of mostly code are almost always more interesting than those that try and teach you some general topic. You can usually find nice code examples on the web, of course, but they are seldom explained in as much detail as you would find in one of these “by example” books. In this case, I have in front of me two books that both attempt to teach some topic, but do so with heavy use of examples. They are hybrids, if you will, of books that teach a general topic, and books that consist of mostly code examples. Maybe all programming books exist on a spectrum with pure thought and abstract theory at one end, and pure code (and more easily out-of-date examples) on the other.

Professional iPhone and iPad Database Application ProgrammingThe first of these is Professional iPhone and iPad Database Application Programming, by Patrick Alessi, published by Wiley (Wrox) in 2011. With chapter titles like “Introducing Data-Driven Applications”, “The iPhone and iPad Database: SQLite”, “Displaying Your Data: The UITableView”, and “iPad Interface Elements”, you would definitely not know at first glance that this is an example-driven book. In fact, each of those sections (and all the other sections of the book) run you through the creation of a sample project, each building on knowledge gleaned in the previous chapters. The first chapter includes a very nice introduction to Xcode and shows you how to create a simple UITableView based application.

The following chapter, “The iPhone and iPad Database: SQLite”, goes a bit farther down the UITableView rabbit hole with its sample project, and introduces SQLite besides. This chapter definitely endeared me to the author when it said: “While Core Data is the recommended framework for creating data on the iPhone, you may want to forego Core Data and use the SQLite API directly for several reasons.” The author then lists several compelling reasons! This may be a heretical position to take, but avoiding Core Data has always been my preference, although I do occasionally wonder if there are ever good reasons to use Core Data of which I am simply ignorant.

The author does later dedicate five chapters (about a third of the book) to using Core Data, so he can’t think it’s entirely useless. He does not, IMHO, (at least in the cursory skimming I gave that portion of the book), provide any compelling reasons to use Core Data. The closest he comes is when he says (repeatedly) that using the graphical data modeling tool will dramatically speed up the development time of your data driven app. I fail to see how this is the case! If creating your db schema is taking up a lot of your development time, I think you’re probably doing something wrong, or possibly you just aren’t familiar with SQL in general.

(A decent db abstraction layer to handle your SELECT, INSERT, UPDATE etc. calls is also a must, and I am disappointed to report that Alessi’s book does not cover this topic. There is at least one decent open source wrapper available (called FMDB), although there are things I would change about it — namely the API for retrieving your result sets.)

Unfortunately, the portions of the book dedicated to the Core Data modeling tool fall into the “already obsolete” category of coding examples, because they do not appear to cover the Xcode 4 interface. I created a sample project using Core Data to look at the modeling tool, and like Interface Builder, it has been consumed by the “one window” paradigm prevalent in all things Xcode 4. Reading the first couple of chapters on Core Data will probably give you the base knowledge needed to use it anyway, but as I said earlier, google can probably do a better job.

The last third of the book consists of a couple of chapters about integration with web services. This topic makes a lot of sense to include in a book about data-driven applications, but it’s definitely given less attention than the previous two sections. I really think the book should have been expanded quite a bit, both to go into more detail about the stuff it does cover, and also to cover additional stuff that was notably absent. Off the top of my head, here are headings I would have liked to see: best practices for storing data retrieved from web services, how to deal with syncing issues, common tools for consuming web services, and at least one code example for parsing and consuming JSON. Unfortunately, JSON is given only a cursory mention, and its superiority to XML for the task at hand is not, as I feel it it should have been, firmly established.

In the beginning of chapter 10, “Working with XML on the iPhone”, there is a section called Synchronous Data Retrieval, in which some lip service is given to NSString‘s stringWithContentsOfURL: selector blocking your UI, but then it is not made clear that the subsequent code examples (using NSURL and NSURLRequest) are asynchronous in nature! Also, on the topic of “common tools”, the book pretty much writes everything from scratch in this section. I can understand the impulse that the author may have had to explain all the gory details of xml parsing and NSURLRequests without complicating matters by introducing open source libraries that simplify these processes, but they save far more time than I’m liable to believe you can save by using Core Data. If you are consuming web services from your app, you would be stupid not to use (or at least look at) ASIHTTPRequest. That little project has probably saved me dozens of hours in the last three months. On the subject of XML parsing, the question is not whether you should use an external parser, but rather which XML parser is right for your needs!

Overall, I didn’t expect to read as much of Professional iPhone and iPad Database Application Programming in detail as I ended up reading for this review. I don’t know how much of that was due to wanting to give it a fair read in spite of my bias against using Core Data, and how much was due to the author’s really well written prose. Database applications is about as dry a subject as they come, and yet I never felt lulled to sleep in the way that many programming books have a tendency to do to me. If you are not familiar with SQLite, or programming for UITableView, I would definitely highly recommend the first four chapters of the book. As for whether they are worth the asking price, (currently $30 on amazon), I’ll leave that up to you.

Unfortunately, I think I’m going to have to leave any in-depth review of my second learn-by-example iOS book for another day: Learning iOS Game Programming: A Hands-On Guide to Building your First iPhone Game, by Michael Daley, published by Addison Wesley in 2011. This book takes you through the author’s process of building an iOS game from start to finish. The game you build, Sir Lamorak’s Quest, is available as a free download from the app store, so you could potentially download it and see if it’s got stuff in it you’d like to know about. I haven’t actually looked at the game for more than a minute or two, but I know from personal experience that parsing through the source code of a game, even one I have no interest in ever making, is always fascinating to me, so I’m quite excited to dig into this book.

Cross-posted on Martin’s dev blog, Chesstris.

DROID Charge by Samsung [Verizon]; The Good, The Bad and The Ugly

Last week, I dished out a few of my thoughts on the DROID Charge by Samsung, for Verizon Wireless.  I’ve had some more personal time with the device, so now can give you a more in-depth review.

In general, I like the phone.  While this isn’t technically a Galaxy S phone, it takes a lot of cues from the S line.   Samsung also piled some upgraded features on top.  On the flip side, it’s also not a Galaxy S II, or a ‘next gen’ device.  It doesn’t have a dual-core processor, a super-mega-high-resolution screen, and it doesn’t run Android 2.3 (Gingerbread).  Since Samsung likes to use prefixes and suffixes (see: Super AMOLED Plus), I’m going to call this a Galaxy S Plus phone.

The Good

The Screen

Awesome screens are pretty standard issue on most of the current Samsung phones.  The Super AMOLED Plus screen on the DROID Charge is no different.  The “Plus” nets you 50% more sub pixels, which is supposed to make the display more clear, thinner, brighter and more energy efficient.  I compared it to a Samsung Vibrant that one of our developers has.  Just arbitrarily looking at it, we didn’t notice much of a difference.  Maybe that’s the point.  The Vibrant has a 4″ screen, whereas the DROID Charge has a 4.3″ screen.  Super AMOLED Plus is supposed to give the illusion that both phones have the same PPI, even though they don’t.  In any case, the screen is big and beautiful.

Verizon 4G LTE

This isn’t the first 4G phone on the market; It’s not even the first 4G phone for Verizon or Samsung.  All that aside, the DROID Charge is still a contender in the 4G race.  Apps install in seconds.  Streaming music buffers quickly.  Queueing up YouTube videos is almost instantaneous.  I’ve had solid 4G coverage everywhere I’ve been in the Twin Cities — except at my house, which is affectionally known as the “Verizon Black Hole”.  I’ve used the mobile hotspot feature with my Macbook, and it works just as well as a purpose-built MiFi or other 4G hotspot.  There’s even a setting, deep in the menus — but not as deep as the ThunderBolt — that allows you to turn 4G off (Settings>Wireless & networks>System selection> LTE Automatic or CDMA mode).  This could help out the folks that want to conserve battery life.  Speaking of 4G, Verizon is now offering unlimited 4G for $30 per month.  That’s a pretty good deal.

Physical Buttons

In a world where more and more manufacturers are switching to capacitive touch buttons, the DROID Charge says “PSH! You and your touchy-feely buttons”.  The Charge rocks four physical buttons, that are tactile and easy to find.  Personally, I would have reordered them so that the menu button wasn’t the furthest away (for a right handed chap).  The only drawback is that the backlighting is a little dim on the buttons.  I also miss physical camera buttons.  Why don’t more manufacturers include them?  If these phones are intended to replace my point-and-shoot camera, they have to have a two-stage camera button. </rant>

The Bad

TouchWiz = TouchWhat?

I’m going to go on record by saying that I have no problem with manufacturers adding their own layer for the user interface.  I’ve been a proponent for HTC’s Sense UI since day one.  For me, it’s just another deciding factor when I’m making a new phone purchase.  Plus, there are plenty of apps, tricks, hacks and mods that can pretty much erase — and in some cases, improve upon — this extra layer.  The original TouchWiz UI layer, on the Galaxy S models, was pretty toned down, with the exception of the blue highlights everywhere.  The color palette for the DROID Charge is a bit different; It’s brown and orange.  It literally reminds me of the Cleveland Browns or Autumn.  So it’s just limited to the TouchWiz UI right?  Wrong.  It’s deeply rooted.  Every pop up dialog box is orange.  Every toast notification is brown.  If an app developer (i.e. Google) doesn’t override all of the stock UI assets during development of an app (i.e. Gmail) you end up with a brown header bar in an app that’s not really brown.

Plastics

If you’ve ever held an HTC phone, like the EVO or the ThunderBolt, you’ve probably thought “Hmm. Hefty. Durable”.  If you were to hold a Samsung phone, you may thing “Meh. Flimsy. Cheap”.  Don’t get me wrong, the DROID Charge is a durable phone.  It’s well put together.  The seams are tight.  There are really no flaws.  However, the back cover is very ‘plasticy’, if you know what I mean.  It’s glossy, and doesn’t have a texture; Soft-touch or otherwise.  This makes the phone slippery, and it doesn’t hide blemishes very well.  I’ve only had the phone a couple of days, and there are already some minor surface scratches on the back.  I’m VERY careful with my phones…especially phones that are loaned to me.  Also, with the phone being so slippery, it slides around in your pocket a lot.  Usually it falls over on its side, which gives me a wicked case of ‘phone bulge’.

Bloatware

I’m not going to talk about this too much, because it’s pretty common.  However, many of the bloat apps aren’t even apps on the phone.  They’re shortcuts to install an app.  To top it off, you can’t even delete these shortcuts.  NO MORE BLOATWARE!

The Ugly

Three Hundo

There is only one ‘ugly’ aspect of this phone;  The price.  Verizon Wireless has priced the DROID Charge at $299.99 (new contract and such).  That is $100 more than any other phone, on the other carriers.  The DROID Charge is an awesome middle-to-higher end phone.  It’s on par with the EVO 4G or the Inspire 4G or the myTouch 4G.  It’s is not worth the extra $100-$150.  The Charge is almost, if not, identical to the Samsung Infuse 4G (not yet available), which has been rumored to be priced at $178.88 at WalMart.  Amazon Wireless briefly had the Charge listed at $249.99 (contracts, yadda, yadda), but has since taken it down.  If a ‘gen 2′ Android phone is priced at $300, I’ll be interested in seeing how Verizon prices the next generation of phones; I.e. the dual-core DROID Bionic.

At the end of the DROID Charge by Samsung is a great phone.  There are no major flaws or annoyances that would keep me away from the phone.  However, I wouldn’t be able to justify the price.

Implementing “Pull To Refresh” in your Android App

From the android-pulltorefresh repo, https://github.com/johannilsson/android-pulltorefresh

“Pull To Refresh” is a UI gesture made popular by the Twitter for Iphone app. It allows a user to refresh a list by pulling down and releasing from the top of the list. IOS developers have had library support for this feature for some time now. Over in Android-land, only the official Twitter app has managed to implement this gesture. Long-promised to be open-sourced, Twitter’s solution is still secret and Android developers have no official means to implement this increasingly demanded feature.

But thanks to Android’s open eco-system, we can build this into our Android app’s using the open-source android-pulltorefresh library developed by Johan Nilson. With thanks to the projects other contributors, his library is capable of producing a UI experience similar to the Twitter app, with support all the way back to 1.5.

The project provides a simple and sufficient example app to demonstrate the library use, but I needed something a bit more robust when I was implementing this in my application. So I thought I’d share my changes here, applying it to example application provided in the project.

Let’s start with a brief explanation of how this works. The android-pulltorefresh library provides a custom ListView that includes a special header. The list is initially displayed with the first item selected. This hides the header from view. The custom ListView responds to touch events so that when you pull down on the list, the header is displayed and handles displaying “pull” and “release” text and animation based on how far you are pulling down. Once its released, the header remains visible with the “loading” message until the view is told the refresh is complete, then it resets the header so its hidden once again.

Getting the basic functionality implemented is straight-forward. First, setup your layout and reference the custom ListView.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <!--
    The PullToRefreshListView replaces a standard ListView widget.
    -->
    <com.markupartist.android.widget.PullToRefreshListView
        android:id="@+id/android:list"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        />
</LinearLayout>

Now in your ListActivity you need to do 2 things, respond to the refresh request and let the view know when you’re done.
To handle the refresh action the custom view notifies an OnRefreshListener that you can implement to handle your refresh operation.
In the code below you’ll see that it implements the onRefresh method of the listener and wisely executes the refresh on a background thread using an AsyncTask.

 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pull_to_refresh);
 
        // Set a listener to be invoked when the list should be refreshed.
        ((PullToRefreshListView) getListView()).setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh() {
                // Do work to refresh the list here.
                new GetDataTask().execute();
            }
        });
        ....

Once your refresh is complete, notify the view by calling its onRefreshComplete() method. In this example, we call this method on the UI thread once the task is completed.

private class GetDataTask extends AsyncTask {
 
        @Override
        protected Void doInBackground(Void... params) {
            // Simulates a background job.
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                ;
            }
            return null;
        }
 
        @Override
        protected void onPostExecute() {
            mListItems.addFirst("Added after refresh...");
 
            // Call onRefreshComplete when the list has been refreshed.
            ((PullToRefreshListView) getListView()).onRefreshComplete();
 
            super.onPostExecute();
        }
    }

So that’s basically how the example app from the project is setup. It just initializes a list of Strings and then on every refresh adds a String to the beginning of the list. In a real application we’ll probably need to beef this up a bit.

First let’s take that Task to task and do some real work. In my situation I need to refresh the list by calling an external api and retrieving all the data to be displayed. In this case its actually more efficient just to rebuild the whole list rather than calculating deltas and prepending to the existing list. For this example, assume we have a List as a class-level field managed by a custom ArrayAdapter.
Here’s the first iteration, the list is re-initialized in the task’s onPreExecute() phase, and the work is moved into the doInBackground() method.

private class GetDataTask extends AsyncTask {
 
        @Override
        protected void onPreExecute() {
		mList = new ArrayList();
	}    
 
        @Override
        protected Void doInBackground(Void... params) {
            JSONArray results = api.getData();
            for (int i=0; i &lt; results.length(); i++) {
                ListData data = parseResult(results[i]);
                mList.add(data);
            }
            return null;
        }
 
        @Override
        protected void onPostExecute() {
            // Call onRefreshComplete when the list has been refreshed.
            ((PullToRefreshListView) getListView()).onRefreshComplete();
 
            super.onPostExecute();
        }
    }

Seems like that should work ok, but I ran into a problem with this approach. As the user pulls down on the list, the onRefresh() method is called triggering the task, which starts by clearing out the mList array. At the same time, it seems that because of the UI changes, the system appears to be taking some measurements which is causing the getView() method to be called on the adapter that is managing the list. Now because we’ve emptied out the list, the application can exhibit some unpredictable behavior.
Let’s solve this in the next iteration by loading a temporary list in the background, and switching the list once we’re done. We should also consider that its possible we have some error while retrieving the new data, so in that case let’s not refresh the existing list. At least the user will still see their existing data.
Ok, now the GetDataTask looks like this:

private class GetDataTask extends AsyncTask {
 
        private List localList;
 
        @Override
        protected void onPreExecute() {
	    localList = new ArrayList();
        }    
 
        @Override
        protected Void doInBackground(Void... params) {
 
            try{
                JSONArray results = api.getData();
                for (int i=0; i &lt; results.length(); i++) {
                    ListData data = parseResult(results[i]);
                    localList.add(data);
                }
            } catch (Exception ex){
                localList=null;
                Log.e(TAG,&quot;Exception during refresh:&quot;,ex);
            }
            return null;
        }
 
        @Override
        protected void onPostExecute() {
 
             if(localList != null &amp;&amp; !localList.empty()){
                 mList = localList;
                 mListAdapter.notifyDataSetChanged();
             }
            // Call onRefreshComplete when the list has been refreshed.
            ((PullToRefreshListView) getListView()).onRefreshComplete();
 
            super.onPostExecute();
        }
    }

Alright, that’s looking pretty good now. For completeness we really should handle the possibility of the task getting cancelled. This can happen when the user navigates away from the app and the task is killed before its completed. This will cause the onPostExecute() method to not be called and so the onRefreshComplete() method won’t be called. Depending on how the user navigates through the app, they could return to this activity without going through the complete onCreate() lifecycle, and you’ll end up with the screen still showing the “loading” progress message in the header. This is common when using tabs between multiple ListViews.
Also, the documented best practices for implementing an AsyncTask says that in long running background work you should periodically check if the task has been cancelled and try to gracefully quit your work and exit. So let’s get all of that in there.

private class GetDataTask extends AsyncTask {
 
        private List localList;
 
        @Override
        protected void onPreExecute() {
	    localList = new ArrayList();
        }    
 
        @Override
        protected Void doInBackground(Void... params) {
 
            try{
                JSONArray results = api.getData();
 
                // check if task was cancelled during long api call
                if(isCancelled(){
                  return null;
               }
                for (int i=0; i &lt; results.length(); i++) {
                    ListData data = parseResult(results[i]);
                    localList.add(data);
                }
            } catch (Exception ex){
                localList=null;
                Log.e(TAG,&quot;Exception during refresh:&quot;,ex);
            }
            return null;
        }
 
        @Override
        protected void onPostExecute() {
 
             if(localList != null &amp;&amp; !localList.empty()){
                 mList = localList;
                 mListAdapter.notifyDataSetChanged();
             }
            // Call onRefreshComplete when the list has been refreshed.
            ((PullToRefreshListView) getListView()).onRefreshComplete();
 
            super.onPostExecute();
        }
 
        @Override
        protected void onCancelled() {
             // reset the UI
             ((PullToRefreshListView) getListView()).onRefreshComplete();
        }
    }

Now that you have a solid refresh implementation you may want to tweak the design of the refresh header. In the sample application they are using the Android “Light” theme. This makes the text black and easy to read. But if you’re using the default “Dark” theme you’ll find the text very hard to see. Here’s a look at the text portion of the refresh header layout, you can see that it references an attribute for the textAppearance style.

        <TextView
            android:id="@+id/pull_to_refresh_text"
            android:text="@string/pull_to_refresh_tap_label"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textStyle="bold"
            android:paddingTop="5dip"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
        />

Let’s tweak the color of the text to make it readable in our application. To do that, we’ll create a theme that overrides the style used by the textAppearanceMedium attribute. We’ll override this with our own style, which will inherit from the Android TextAppearance.Medium style and override the textColor attribute. Got all that?

First, here’s what Android’s style declaration looks like:

<style name="TextAppearance.Medium">
        <item name="android:textSize">18sp</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textColor">?textColorPrimary</item>
</style>

Now here’s our theme and style declaration:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyCustomTheme" parent="android:Theme.NoTitleBar.Fullscreen">
    	<item name="android:textAppearanceMedium">@style/TextAppearance.Medium</item>
    </style>
 
    <style name="TextAppearance.Medium" parent="android:TextAppearance.Medium">
    	<item name="android:textColor">#FFCDC9C9</item>
    </style>
</resources>

And finally edit the Android Manifest in order to use the new theme:

<application android:name="MyApplication"
                     android:icon="@drawable/icon"
                     android:label="@string/app_name"
                     android:theme="@style/MyCustomTheme">
</application>

And that’s it, everything you you need to implement the pull to refresh gesture, handle the operation and customize the UI.

By the way, the android-pulltorefresh library is made available under the Apache License, V2.0. So you need to maintain any NOTICE files and copyright headers from the source. But you are free to redistribute in derivative works for commercial use.

Originally posted on Shared State

DROID Charge by Samsung [Verizon]; Breon’s Initial Thoughts

Good morning, awesome people!  Today I have brand new, shiny — and I DO mean shiny — toy from Verizon Wireless.  It’s not another hotspot.  It’s the DROID Charge by Samsung.  At first glance, you may be like “Meh. Just another Galaxy S phone“, but the DROID Charge is much more.

For starters, it has a larger, 4.3″, Super AMOLED Plus screen.  The “Plus” means that there are 50% more sub-pixels…mumbo-jumbo aside: Brighter, richer, more efficient.  The front and rear cameras have been upgraded to 1.3MP and 8.0MP respectively.  The rear camera includes a flash.  The DROID Charge also has an HDMI output.

There are some little things that set this apart from the Galaxy S line.  While it still sports Samsung’s TouchWiz UI, the color palette has gone from light blue to brown and orange.  While I don’t mind the new colors for the main interface, the color palette extends into other apps.  So if the developer doesn’t override all of the UI assets, there will be a brown header bar and tabs.  Another small change is the charger and USB cable.  A charger is a charger and a cable is a cable, but the ones that come with the DROID Charge are different than any of the other Samsung devices I’ve tested.  Is this the first in a new line of Samsung devices?

The DROID Charge is the first 4G Samsung phone on Verizon Wireless and will be available on April 28th, for $299.99 (w/ new contracts, etc).  I’ll be putting it though its paces for the next few days and we’ll see how it compares to the HTC ThunderBolt.

If you have any questions, or specific feature’s you’d like me to cover, shoot me a tweet (@breon).

Also, Verizon Wireless is holding another DROID Landing scavenger hunt!  Follow http://twitter.com/droidlanding for more details.  You could win your very own DROID Charge!

Official Press Release:

VERIZON WIRELESS UNLEASHES DROID CHARGE BY SAMSUNG
April 21, 2011

DROID CHARGE Joins Verizon Wireless’ DROID family As Samsung’s First 4G LTE Smartphone

BASKING RIDGE, N.J. – Verizon Wireless and Samsung Telecommunications America (Samsung Mobile) today announced that the Droid Charge by Samsung will be available April 28 in Verizon Wireless Communications Stores and online at www.verizonwireless.com.
The Droid Charge is designed with Samsung’s 4.3-inch Super AMOLED™ Plus display, setting a new touch screen standard for brightness, clarity and outdoor visibility. The Droid Charge is equipped with both a rear-facing 8 megapixel camera with LED flash and front-facing 1.3 megapixel camera for both stills and video chatting. The smartphone’s 1GHz application processor and HTML 5 Web browser maximizes high-speed 4G LTE connectivity for faster downloads and graphics processing.

Additional Features:
- 4G LTE– customers can expect download speeds of 5 to 12 Mbps and upload speeds of 2 to 5 Mbps in 4G Mobile Broadband coverage area
- Android 2.2 platform – With support for Google Mobile Services including Gmail, YouTube™, Google Talk, Google Search, Google Maps and access to more than 150,000 apps available to download from Android Market™
- Adobe® Flash® Player compatible
- Mobile Hotspot capability – share 4G connection with up to 10 WiFi-enabled devices or a 3G connection with up to 5 devices
- Samsung Media Hub – Samsung’s own content service, offering a vast lineup of critically acclaimed films and TV programs for rent or purchase
- Virtual QWERTY Keyboard featuring Swype Technology

Pricing and data plans:
- The Droid Charge by Samsung will be available for $299.99 with a new two-year customer agreement.
- Droid Charge customers will need to subscribe to a Verizon Wireless Nationwide Talk plan and a 4G LTE data package. Nationwide Talk plans begin at $39.99 monthly access. Unlimited 4G LTE data packages start at $29.99 monthly access. Mobile hotspot feature will be included for a limited time at no additional charge.
Find the DROID Charge
Beginning April 21, anyone over the age of 18 can participate in an exclusive Droid Charge Scavenger Hunt. Follow the online clues to find hidden locations in 16 different cities to win a Droid Charge by Samsung. For additional information about the DROID Charge scavenger hunt, visit: http://twitter.com/droidlanding.

About Verizon Wireless
Verizon Wireless operates the nation’s fastest and most advanced 4G network and largest and most reliable 3G network, and serves more than 93 million customers. Headquartered in Basking Ridge, N.J., with 80,000 employees nationwide, Verizon Wireless is a joint venture of Verizon Communications (NYSE, NASDAQ: VZ) and Vodafone (LSE, NASDAQ: VOD). For more information, visit www.verizonwireless.com. To preview and request broadcast-quality video footage and high-resolution stills of Verizon Wireless operations, log on to the Verizon Wireless Multimedia Library at www.verizonwireless.com/multimedia.
About Samsung Telecommunications America
Samsung Telecommunications America, LLC, a Dallas-based subsidiary of Samsung Electronics Co., Ltd., researches, develops and markets wireless handsets and telecommunications products throughout North America. For more information, please visit www.samsungwireless.com.

Samsung 4G LTE Hotspot [Verizon] Review

Just about a week ago I picked up a hot (no pun intended*) new device from my Verizon Wireless contact.  It’s the Samsung 4G LTE Mobile Hotspot.  Or as I like to call it: The SCH–LC11.  Not really.  We’ll stick with ’4G Hotspot’.  This is one of two 4G LTE hotspots now available on Verizon Wireless.

If you’re not familiar with what a ‘mobile hotspot’ is, allow me to give you a quick lesson.  Basically, a mobile hotspot works like the wireless internet in your house.  A data connection comes in and a WiFi connection is spit out.  However, instead of being connected to a cable modem, the data connection is a cellular connection.  The WiFi part works pretty much the same.  The big difference is that you can only connect up to 5 WiFi devices, BUT you can connect ANY WiFi device; Laptops, iPads, mobile phones, game consoles.  Also, it wouldn’t be very ‘mobile’ if it weren’t battery powered.  Sometimes these devices are called MiFi.

Mobile hotspots have been around for a couple of years now.  The latest incarnations now pack 4G technology.  This Samsung hotspot is rocking Verizon’s 4G LTE, but it’s also compatible with their 3G towers.  This gives you awesome coverage in and out of 4G service area.  The first night that I had the device, I was in St Cloud, MN.  St Cloud is not a 4G city, but I was able to connect the company iPad to Verizon’s 3G network and check email, update some apps, and test one of our client’s apps.  During my trip back to the Cities I was able to stream a comedy special on Netflix.  All 3G.  All the way. In fact, even when I reentered 4G airspace, it didn’t automatically switch over.  Once I turned it off and back on, it was on 4G just fine.

During the work week, I had a mission:  Use the 4G hotspot for an ENTIRE day of work.  Mission successful.  I did this for two days, last week.  For the purpose of testing the connection, and not the battery, I had the hotspot plugged into an outlet.  As you can see from the test results below, the 4G data connection is just as fast as our office connection.  Granted, there are 10 other people using our office connection.  There were some random service interruptions.  All I had to do was reset the modem and continue on.  I came back from lunch one day and had a mini freak out because I couldn’t connect.  What I didn’t realize was that the hotspot shut itself off to conserve power.  All I had to do is boot it up, and connect again.

Office Connection

Verizon 4G LTE Connection

This particular hotspot is very compact.  It’s about the size of a deck of cards, only thinner.  All of the surfaces are soft-touch, so it doesn’t slide around if you use it in the car.  There is a single micro USB port on the side and a single power button on the face.  Your connection status is indicated with 3 LEDs, also on the face; One for 4G, one for 3G, and one for WiFi.  I wish there was a small LCD display to give you more feedback about your connection and battery.  The LEDs only indicate that you have a 3G or 4G connection; not the signal strength.  Also, there is no way to see how much battery you have left.  Although, I have seen the LEDs turn different colors.  Maybe there’s a decoder ring that can help identify what they mean.  The power button also has an LED.  Under the battery cover there is a reset button and the 1500 mAh battery.

The Samsung 4g LTE hotspot is available now from Verizon Wireless or Best Buy for $99.99 (new contract and what-not).  If you want to spend a little less, you can pick it up from Amazon Wireless for $19.99.  There are two plans available:  5GB for $50/mo and 10GB for $80/mo.

All-in-all the Samsung 4g LTE hotspot is a great mobile hotspot.  It’s small. It packs Verizon’s 4G LTE technology.  It’s relatively inexpensive.  I would like to have some more indicators for signal strength and battery.  With many new mobile phones coming with some sort of hotspot/tethering option included, this device may not be for everyone.  But if you want to maybe save some money on your monthly internet connection, you can get a hotspot, use it at home, and then take it with you when you’re out and about.

Features

  • 4G LTE Mobile Broadband and Mobile Broadband capable
  • Connects with up to Five Wi–Fi® Enabled Devices
  • Chipset: MDM9600
  • Slim, durable and compact design
  • 4G SIM Card compatible
  • Service Status Indicator (LED) –4 Color
  • VPN Compatible
  • Auto Connect

Technology Bands

  • CDMA 1xEV-DO Rev. A/Rev. 0: 800/1900 MHz
  • 4G LTE (700MHz)

System Requirements

  • WiFi802.11b/g/n connectivity
  • One Type A USB Port – FOR CHARGING PURPOSES ONLY with included Wall/USB Charger

Specifications

  • Dimensions: 2.32”(H) x 3.54”(W) x 0.45”(D)
  • Weight: 2.7 oz.
  • Battery: (1500mAh)
  • Usage: Up to 216 mins.;
  • Standby: Up to 9hrs.
  • SAR:1.13W/kg – Body

*pun totally intended

This Week in Mobile and Web – 04.19.11

Hello, Recursive Readers!  It’s been awhile since we last chatted.  We’ve been busy bustin’ out apps and websites.  If you haven’t seen, we’ve recently released an iPad app for the American Swedish Institute, in partnership with Adolfson & Peterson Construction.  It looks great and will educate ASI visitors about the new Nelson Cultural Center.

And here is your news…

    Development

    OS News

    The Web

    Apps, Apps, and Additional Apps

    Device Central

    Carrier News

    Friday Infographic

    (click for larger version)

    Recursive Awesome Helps Adolfson & Peterson Launch the American Swedish Institute iPad App

    On a chilly April Saturday, the American Swedish Institue broke ground for the Nelson Cultural Center, a modern addition to ASI’s existing Turnblad Mansion.  The new center is a state of the art building, with a 325 seat event space , craft workshop, conference room, retail shop and an additional gallery.  The lower level offers more space for collection storage, exhibit prep and a utility tunnel that connects the new building to the Turnblad Mansion.  The Nelson Cultural Center is tracking to be LEED Gold certified, and will achieve this by using sustainable materials, geothermal heating and cooling systems, a green roof, and water conservation strategies.  The Turnblad Mansion will also receive updates as well.  The lower level will be renovated to offer additional storage for Swan Turnblad’s archive.  There will also be new classrooms and a community hall, with kitchen facilities.

    Recursive Awesome partnered with Adolfson & Peterson Construction — the general contractors for the project — to develop an iPad app, which allows ASI members, volunteers, and visitors alike to take a virtual tour through new Nelson Cultural Center and Turnblad Mansion renovations.  Not only can you keep up to date with the latest project news, you can learn more about the American Swedish Institute in the ‘ASI Is…’ section.  You can read about the sustainable aspects of the project, and understand what it means to be LEED Gold certified.  There is a ‘Virtual Tour’ that lets you learn more about key areas of the project, just by tapping on the map.  Lastly, you can give & get involved yourself!  The app offers the opportunity to donate, join as a member, volunteer, or sign up for ASI’s Klipp! newsletter.

    Kevin Lind (Virtual Construction Manager, A&P) was present at the groundbreaking — and helped visitors use  the app — said “My biggest reflection on the day was the linking of generations. Seeing families sit down together and walk through the app, asking question of each other”.  He went on to say “We had numerous people spend 30 plus minutes sit down and thumb through the content that is good to see.  My favorite part is the virtual tour — Google style maps — but really makes a huge leep in the direction of a new way to view your project”.

    The app will be on display in the solarium of the Turnblad Mansion, during construction of the Nelson Cultural Center.  The app also includes a ‘kiosk’ mode — accessible from the iOS settings menu — which will allow every guest to have the same experience.  It will be available in the Apple App Store, for everyone to download and stay up-to-date with the project.

    About The American Swedish Institute

    The American Swedish Institute, founded in 1929, serves as a gathering place for people to share stories and experiences around universal themes of tradition, migration, craft and the arts, all informed by enduring ties to Sweden.
    http://www.americanswedishinst.org/

    About Adolfoson & Peterson Construction

    A&P is one of the top 50 construction companies in the U.S., providing construction management, design/build and general contracting services to public and private clients. A&P serves the K-12 school, energy, healthcare, higher education, municipal, multi-family, retail, and senior living market segments from its offices in Arizona, Colorado, Minnesota, North Carolina, Texas and Washington.
    http://www.a-p.com/

    About Recursive Awesome

    At Recursive Awesome we focus on the design, development, and support of tablet, mobile and web applications. We use Agile software development practices, to create RESTful API’s (Ruby on Rails), as well as mobile (iOS, Android, Blackberry and Windows Phone 7) and web products for ourselves and our clients.
    http://www.recursiveawesome.com/

    Media Inquiries:

    Breon Nagy
    Recursive Awesome
    breon@recursiveawesome.com
    612.399.6626