Android Phone and Tablet Recycler Views Tutorial

As Head of Mobile R&D in Seeking Alpha I’m being asked constantly by developers and product managers alike if we can implement a feature on both the phone and the tablet.
For example, here is the Seeking Alpha Android application showing the portfolio page on a phone and on a tablet:

Seeking Alpha's Android app - phone

Seeking Alpha’s Android app – phone

Seeking Alpha's Android app - tablet

Seeking Alpha’s Android app – tablet

Continue reading

Android Dependency Assassin – Part 1: Butter Knife

A good knife man know his tools. The dagger is sharp and fierce while the butter knife is blunt and mellow. The sword is noble and swift while the Swiss army knife is handy and quick.

This post series will focus on reducing dependencies in Android application development using dependency injections frameworks. In the first post I’ll discuss the Butter Knife framework.

How many time have you found yourself writing over and over again the same boilerplate code for handling views in your UI classes (Activity or Fragment)? Something like that:

public class MyActivity extends Activity {
    TextView mDoSomethingView;
    ListView mDoSomethingElseView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_activity);
        ...
        mDoSomethingView = (TextView) findViewById(R.id.expandable_text);
        mDoSomethingView.setOnClickListener(new DoSomethingClickListener());
        ...
        mDoSomethingElseView = (ListView) findViewById(R.id.list_item);
        mDoSomethingElseView.setOnClickListener(new DoSomethingClickListener());
        ...
    }

    ...

    public class DoSomethingClickListener implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            // Hey, we're doing something!!!
            ...
        }
    }

    public class DoSomethingElseClickListener implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            // Hey, we're doing something else!!!
            ...
        }
    }

}

butterknifeButter knife enables you to “inject” the views and event callback or listener easily, without having to repeat the boilerplate code over and over again. Strictly speaking it will not actually inject the views, but will generate the boilerplate code for you behind the scene (this why we labeled it “injection” above). With butter knife the above sample will be reduced to the following:

public class MyActivity extends Activity {
    @InjectView(R.id.do_something) TextView mDoSomethingView;
    @InjectView(R.id.do_something_else) ListView mDoSomethingElseView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_activity);
        ButterKnife.inject(this);
        ...
    }

    ...

    @OnClick(R.id.do_something)
    public void imDoingSomething(TextView doer) {
        // Hey, we're doing something!!!
        ...
    }

    @OnClick(R.id.do_something_else)
    public void imDoingAnotherThing(ListView anotherDoer) {
        // Hey, we're doing something else!!!
        ...
    }


}

Much shorter, cleaner, readable and maintainable code.
Butter knife doesn’t use reflections. Instead it generate the boilerplate code in compile time and use it in run time, so it is fully debug-able and visible for you.

There are other view injection frameworks that will do what Butter knife is doing, such as RoboGuice, Android Annotations and more. Each has its pros and cons. Search the internet for comparisons (like this one, or this) and select the one that fits you best.

It is beyond the scope of this post to explain the benefits of dependency injection in software development, such as loose coupling, inversion of control and more. I encourage you to read more on this to understand the value of dependency injection.

In the next post I will discuss Dagger. Stay tuned.

Efficient Android Code – A Case Study

Just the other day I cam across UC Android’s MSRP parser implementation. I was astonished, left speechless. Gazing paralyzed at the code I resisted the urge to run screaming to the development manager and demand that the author of this gem will be publically hanged on the next weekly happy hour. Instead, being the good soul that i am, I decided to take this code as a test case to demonstrate how can we increase Android code efficiency.

I will try to demonstrate:

  1. Can we increase this code efficiency? Maintainability? Performance?
  2. Is it worth making the effort?

Continue reading

EMOZE Sets a New Standard for Email Experience on Android

Herzeliya, Israel, 7 January 2013: EMOZE Ltd., a leading provider of transparent, synchronized mobile push messaging and push content solutions for handset manufactures, mobile operators and enterprises, today released its latest feature rich version of an advanced Secure Push Mail for Android devices. The new version includes an improved overall application performance and a smoother user-friendly interface.

The EMOZE Secure Push Mail is designed to turn real-time messaging into a simple, intuitive and productive function. Improved application performance now includes the ability to select multiple folders to be pushed to the mobile device as well as the ability to archive and restore emails locally. The new version features “Out of Office” Automatic Reply as well as Meeting Response support for MS-Exchange and Google accounts. It also helps reduce the cost of data while roaming by controlling the synchronization options.

Managing several email accounts has never been easier with EMOZE Secure Push Mail. Emails can be synchronized seamlessly with the EMOZE application, including integration with contacts, calendars and even folder structures. With EMOZE’s Secure Push Mail, users may now enjoy the ability to manage emails, folders and much more “on-the-go” without depending on their computer.
EMOZE offers a variety of advanced security options to protect user’s information, privacy and identity, especially in cases where one of the popular cloud-based office services – such as Office365, Outlook.com or Google Apps – is in use. In fact, the EMOZE solution allows users to remotely locate, lock, or even erase ?the data of a lost or stolen device. It is as simple as sending a text or email message.

Main Application Features:

• ?Push Mail: Real-time email notification, including POP3 accounts;?
• ?Supports contact and calendar (PIM) synchronization;
• ?Multiple Email accounts: Easy configuration of several email accounts;
• ?Robust compression for both text and file attachments;
• ?Preview Attachment Function: saving time, data and battery consumption;
• ?Forward attachments without having to first download or open the files;
• ?Global Address List (GAL) access;
• ?Out Of Office assistant support (for MS-Exchange 2007 and higher);
• Accept, Decline, and Tentative response to Meeting Requests (MS-Exchange and Google ?accounts;
• ?Ability to select multiple Folders to Push: enables selection of one or more folders ?that will ?automatically be pushed to the mobile device whenever a new mail is sent to that ?folder;?
• ?Archive and restore email right on the mobile device with the new Archive folder;
• ?New Traffic Saving Counter: measures the mobile data used by ?EMOZE in order to help better control data consumption;?
• ?Remote Wipe by email or SMS: ability to erase all private information on a lost or stolen device, returning the device to its ?factory settings;
• ?Storage card encryption: encrypts the attachments downloaded to the SD card ?or mobile phone;
• SIM card replacement alert?;
• ?Remote Phone lock: ability to remotely lock/wipe the mobile phone; ?
• ?Find Device Location: allows receipt of an email or SMS with a Google maps link to the device ?location.
• ?Device Alarm triggers high volume beeping alarm on the device;

The EMOZE Secure Push Mail application is currently available for download on Google Play in the Communication category.
http://www.emoze.com/download/android

WorldMate on Android with New Hotel Booking and Facebook Integration

Traveling keeps getting better and easier

WorldMate has done it again, making traveling better and easier. With new and improved travel services making travel easier and more enjoyable, we not only have the Android Market’s “Editors Choice” award, but we’re also an Android Market “Staff Picks”.

So, what’s new in 5.0?

Price Alerts: Did you get the best hotel deal? WorldMate now automatically helps you save with our Price Alerts service. No matter where you book from, we’ll let you know if you can get more for less. Save money on the same hotel, find a similar but cheaper, or upgrade to bigger and better for next to nothing!

Hotel Booking Revamped: We’ve upgraded our hotel booking service giving our users an incredible booking experience. You’ll enjoy our new user interface, which makes finding the perfect hotel a cinch. And for those of you bargain hunters, you can now get straight to the chase with our Deals button.

Express Booking: Do you hate the tedious process of entering your credit card details each time you book? Well, we now give you the option of storing those details with us, so that it’s a snap the next time you book on WorldMate.

Log in with Facebook: Loosing track of your Web or App accounts and passwords? Well you now have one less password to remember; just Log in with your Facebook credentials.

Facebook Status Updates: If you’re planning a trip or on route and running up those miles, update your Facebook friends directly from WorldMate. Keep your friends updated on your travel adventures by posting new travel status messages directly from your Trip’s screen.

Download in the Android Market

WorldMate Upgrades Android Users With New Car Services

Calling All Android Users: You’ve Been Upgraded

Back in July, we launched the WorldMate for Android “Gold” premium services , and it has become one of the handful of apps to win the coveted “Editors Choice” designation from Android Market! Still, our team has been working overtime on major enhancements to the next iteration of WorldMate for Android—Version 4.0. We’re thrilled to announce its availability as of today! So, what’s new in 4.0?

Calendar Synchronization for Outlook, and Google/Android Calendar: Demand for this has been overwhelming—so here it is! Setup takes a minute or two and then all your flights/hotel/car rental reservations in WorldMate will automatically sync to your calendar.

Car Rentals: Renting a car by walking up to the rental counter at the airport is so 2010! With 4.0, you can reserve a car at hundreds of airports around the globe. Select from multiple car rental agencies including, Avis, Budget, Dollar, Thrifty, and many more.

Limousine Reservations: Guess what? Limos aren’t just for celebrities or going to the Prom. The next time you’re thinking about that $85 taxi from the airport into New York City, check WorldMate for a much more comfortable town car at comparable prices. With our partner, GroundLink, we’re providing limo reservations to/from airports all over the world. Reservations are made with a simple click to call or, if you just don’t like talking to people much, you can reserve directly within the app. Try it on your next trip and be one of “those people” who have a driver waiting for them at baggage claim.

Improved Graphics: We’ve redesigned the main screen to accommodate the ever-growing number of services with in the app. You will also notice the enhanced mapping functionality- WorldMate now displays a uniquely labeled pinpoint for the airport, hotel, and meetings in your itinerary.

Advertisements: My father always told me, “There’s no such thing as a free lunch.” WorldMate is closing in on 9 million registered users, many of whom are free users. Until now, we’ve been ad-free, only serving promotions for our hotel booking service or to our travel insurance/limousine booking partners, etc. With 4.0, we’re introducing 3rd party banner advertising to generate a little cash to pay for everything the millions of free users enjoy today (and to keep our investors and accountants happy!). We hope that its not too intrusive and that maybe you’ll even click one or two of them. Of course, if you upgrade to the Gold version, those ads will magically disappear.

Download in the Android Market

WorldMate Gold Has Come To Android

WorldMate for Android

WorldMate for Android

Real-time flight alerts
Get instantly updated on flight delays, cancellations or gate changes with pushed alerts directly to your Android.
Flight status updates in your itinerary
Never miss an update your itinerary will be  auto updated with the real-time status of your flights or gate changes.
Flight status look-up
Check real-time flight status for over 350 airlines and instantly lookup information about flight delays, cancellations and gate changes.
Peace of mind for your next trip
Get all the convenience of flight alerts, status and lookup. Going Gold means you’ll always be one step ahead of everyone else when something goes wrong.

WorldMate Gold is available via in-app upgrade with Google checkout for just $9.90.

Get WorldMate 3.0 at the Android Market.

We have also included in this release pushed notifications for all itinerary updates, so any time you send us a travel confirmation email or edits your itinerary at worldmate.com you will get a pushed Android notification confirming that yourtravel items (flight, car, hotel, etc.) were successfully imported. This service is free for all users.

What Will Be The Mobile OS Of The Future?

This is indeed an interesting question. The article Ultimate Mobile OS Showdown: iPhone vs Android vs webOs vs Blackberry vs Windows Mobile vs Symbian tries to compare the good and bad of each of the common mobile OS at hand today.

WorldMate for Blackberry

WorldMate for Blackberry

WorldMate is mentioned in this article as one of the better BlackBerry OS third-part apps for tracking travel plans.

Personally, I like the Windows Mobile OS, but I have to agree this is probably a dying mobile OS.

iPhone is very chick but if I have to gamble on a winner it will be the Android. Its openness and support from a plethora of vendors will make it the winner, eventually.

What do you think?

What Will Be The Mobile OS Of The Future?

View Results

Loading ... Loading ...