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

Event Inheritance in EventBus

If you are not using pub/sub framework for your Android client, this post is not for you. But then again, if you are a mobile developer you should ask yourself why your mobile clients applications aren’t using pub/sub framework? This deserve a separate post that will explain the benefits of such architecture. If you are into pub/sub for Android clients you are probably using Otto or EventBus.
EventBusSome of my team were using EventBus and encountered a weird event dispatch situation: some subscribers would get multiple invocations for a single event post.
The code could be simplified to the following sample:

public class MyActivity extends Activity {
   ...
   public class BaseEvent {}
   public class DerivedEvent extends BaseEvent {}
   ...
   @Override
   public void onStart() {
      super.onStart();
      EventBus.getDefault().register(this);
   }

   @Override
   public void onStop() {
      EventBus.getDefault().unregister(this);
      super.onStop();
   }

   public void onEvent(BaseEvent event) {
      // Handle base event
   }

   public void onEvent(DerivedEvent event) {
      // Handle derived event
   }
   ...
}

One could argue the need for inheritance in the events object. If you use EventBus extensively, you will learn that you need a lot of event objects to replace all those listeners that infested your code before you used EventBus. Usually, you will have a lot of events but some of them need to pass the same information to the subscriber (say a String or a List). Writing the boilerplate code for instantiation and getters/setters for each separate event class could be time consuming, and error prone:

public class Evnet1 {
   private final String foo;
   public Event1(String bar) {
      this.foo = bar;
   }
   public String getFoo() {
      return foo;
   }
}

Now imagine repeating this for Event2 to Event100. Not a lovely though, isn’t it?
We would rather have Event2 to Event100 extend Event1 and that’s all. This was the base idea of the code sample presented above for MyActivity.
Now somewhere else in your code there will be a publisher that will do this:

...
EventBus.getDefault().post(new DerivedEvent());
...

And for some reason both onEvent methods in MyActivity will be called! WTF? If you dig into EventBus internals, you will understand why this happens (If you don’t understand this drop me a line). So does it mean we can’t use event inheritance with EventBus? Absolutely not!! The solution is simple: don’t ever subscribe to base event object. This will solve all your problems. i.e.:

...
public abstract class BaseEvent() {}
public final class DerivedEvent1() {}
public final class DerivedEvent2() {}
@Override
public void onEvent(DerivedEvent1 event) {
   // Do something with the event, what you normally intended for the base
   // event in the previous sample
}
@Override
public void onEvent(DerivedEvent2 event) {
   // Do something with the event, as it was the DerivedEvent from the
   // previous sample
}
...

Now if you fire the DerivedEvent2:

EventBus.getDefault().post(new DerivedEvent2());

Only the event handle for this event (line 11) will be called.

To prevent inheriting the derived events, label the classes final, and to prevent instantiating the base event classes label them abstract.

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

Mi-Fone Launches Smart Feature Phones Embedded With EMOZE Push Mail and Messaging Technology

CAPE TOWN, South Africa, PORT LOUIS, Mauritius and LONDON, November 12, 2012

AFRICACOM 2012 – Mi-Fone and EMOZE Ltd. today announce the launch of a new range of smart feature phone devices embedded with EMOZE’s push mail and messaging technology. These next generation phones provide a more user-friendly email and instant messaging experience.

With EMOZE pre-embedded in the devices, users will be able to easily and securely access both enterprise and personal email accounts, synchronise their email contacts and calendar, view office attachments, send voice messages via email, and even real-time chat via pin messaging with their friends.

EMOZE is fixed in the operating system of the device and does not require any middleware or runtime environment to load, but rather it starts when the phone is powered on. In addition, EMOZE is suitable on any IP-based network, and does not require any SMS integration.

Mi-Fone is committed to enhancing its mobile phones to ensure its customers receive value for money. “Through our partnership with EMOZE, we can now add the important elements of Instant Messaging and Push Mail in order to give our consumers the ultimate mass market consumer user experience. With these features our target sector become more productive and in turn become better citizens. We call it, Aspiration Within Reach.” says Alpesh Patel, Founder and CEO of Mi-Fone.

Moshe Levy, CEO of EMOZE Ltd, comments: “We look forward to our partnership with Mi-Fone, the leading local brand in the African region, as we share similar values of excellence and commitment to user satisfaction. EMOZE’s unique patented push messaging technology provides an effective solution that is both lean on data usage as well as battery consumption.”

WorldMate Introduces a Major Upgrade to its Hotel Booking Experience on iPhone

WORLDMATE INTRODUCES A MAJOR UPGRADE TO ITS HOTEL BOOKING EXPERIENCE ON IPHONE

SAN FRANCISCO, July 9, 2012 – The world’s largest mobile itinerary management and travel booking app, WorldMate, today announced its completely re-designed hotel booking service on the WorldMate for iPhone app. The enhancements are a direct result of WorldMate’s exhaustive study of the booking behavior of millions of its customers.

Continue reading

Rumors of WorldMate for Windows Phone

There is a growing wave of rumors about a version of WorldMate for Windows Phone.

It seems that popular travel organizer app/service WorldMate is about to enter the Windows Phone Marketplace. While the exact release date is not confirmed yet, some screenshots have already leaked (as you can see from the image below).

WorldMate for Windows PhoneExpect all (or at least most) of the features users on other platforms have learned to love, including itinerary viewer, ability to see full trip items’ details, and one click to call and open location maps. Moreover, there’s the social media integration with Facebook and LinkedIn accounts for sharing travel plans and seeing who’s nearby to the trip destinations.

Of course, all this is packed into a Metro-style UI to make the experience familiar to the Windows Phone community. And it will probably be free to download.

My|Phone Launches Smart Feature Phones Embedded With Emoze Push Mail And Messaging Technology

Manila and London, May 21, 2012 – My|Phone and EMOZE Ltd. today announce the launch of a new range of smart feature phone devices embedded with EMOZE’s push mail and messaging technology. These next generation phones provide a more user-friendly email and instant messaging experience.

With EMOZE pre-embedded in the devices, users will be able to easily and securely access both enterprise and personal email accounts, synchronise their email contacts and calendar, view office attachments, send voice messages via email, and chat in real-time with their friends.

EMOZE is fixed in the operating system of the device and does not require any middle ware or run time environment to load, but rather it starts when the phone is powered on. In addition, EMOZE is suitable on any IP-based network, and does not require any SMS integration.

My|Phone is committed to enhancing its mobile phones to ensure its customers receive value for money. “Through our partnership with EMOZE, our mobile phones now have applications such as My|Phone Messaging, providing users with their own interactive community, My|Phone Mail for a more convenient method of checking email, and Facebook chat to keep people connected.” says Jaime Alcantara, President of My|Phone.“EMOZE is a milestone in our phone’s technological progress, and we are pleased this is only the start of the many developments we intend to give consumers.”

Moshe Levy, CEO of EMOZE Ltd, comments: “We look forward to our partnership with My|Phone, the leading local brand in the Philippines, as we share similar values of excellence and commitment to user satisfaction. EMOZE’s unique patented push messaging technology provides an effective solution that is both lean on data usage as well as battery consumption.”

WorldMate API launches with over 50 developers onboard

WorldMate API launches with over 50 developers on board

SAN FRANCISCO, May 17, 2012  – The world’s largest mobile itinerary management and travel booking service, WorldMate, today announced the availability of the WorldMate API and the accompanying developer portal at https://developers.worldmate.com.The WorldMate API processes travelers’ confirmation emails, extracts all of the key information, adds additional content such as an airport geo-code, and then sends the data back to the developer in industry standard Extensible Markup Language (XML). Developers can use the data to create a virtually limitless array of applications. Some examples include itinerary monitoring, expense reporting, traveler profiling or selling daily deals at the destination.
Continue reading