Friday, October 25, 2013

Android 4.4 KitKat more for TVs than phones, report says


Google could be turning on your goggle box with KitKat. The Android 4.4 update could do more for your television than it does for your phone, if new reports are to be believed.
Korea's ETNews reports that KitKat will feature an interface that's designed to scale up to a connected smart TV's larger screen, as well as improved interaction between a telly and an Android phone or tablet.
Google is increasingly casting its eye at the telly in your living room, reportedly ditching the name of its as-yet not that popular Google TV smart TV system to Android TV, perhaps motivated by the success of the Chromecast telly dongle.
The last time Google aimed an Android update at a specific type of device was Honeycomb, which pumped up the software from smart phones from tablets when the first Android began to appear. Honeycomb was by definition a bit of a cul-de-sac, and the next update, Ice Cream Sandwich, quickly standardised things across both phones and tablets.
We've been waiting longer than usual for KitKat -- we were expecting it to be unveiled under the name Key Lime Pie earlier this summer just gone -- so if it does turn out to be designed mostly for a thing that most of us don't use I'm sure I won't be the only one disappointed.
Still, I'm sure Google will treat us to some cool new Android goodness when the Nexus 5 and Nexus 10 come along.
KitKat is so close we can almost taste its four-fingered milk chocolate goodness, with the Nexus 5 even briefly showing up on Google Play.
Are you excited about KitKat and the Nexus 5? Should Google make a play for your TV? What do you want to see in the new software? Tell me your thoughts in the comments or join the dance party on our Facebook page.



Will Android Be the One Operating System to Rule Them All?



Android, the mobile-phone operating system that powers most of the world’s smartphones, was never intended just to be used on phones, even though that is where it has had the greatest success. London’s Droidcon conference, which closes Friday, is full of developers trying to integrate it into every device they can think of.

What about a smart washbasin and mirror? Tokyo-based Seraku Co. has embedded it into a bathroom mirror. Want to watch the news, or check traffic, while brushing your teeth, or keep a detailed log of your weight? The mirror will do it for you.

There are watches, cars, augmented-reality goggles, even a device for growing food hydroponically, all of which use the operating system.

Kevin McDonagh, CEO of Novoda Ltd., a London-based Android development agency, and organizer of Droidcon, is as passionate an evangelist as you are going to find. He sees a future where it will be in everything—”the one operating system to bind them all.”

“Android was envisaged as an operating system of interconnected devices,” he said. “It is in washing machines, it is microwaves. It is even in a rice cooker.”

Why would you want such a thing? Well, putting smarts in dumb machines makes a lot of sense. Domestic machines have for a very long time had microprocessors in them to optimize processes, but the problem for many is that they exist in their own silos. Can a washing machine talk to a dryer?

Adding a common platform like Android makes it easier to integrate devices, easier for developers to build on them, easier for consumers to interact with them (controlling them over the Internet or via a mobile phone, for example), easier for them to interact with consumers. If your washing machine could talk to your TV, it could tell you when the wash was done.

There is some confusion between what is Android and what is GoogleGOOG -0.13%. Typically when people talk about Android they mean Google, but, said Mr. McDonagh, they are not synonymous. There is an open-source (meaning it is free for anyone to download and do as they like with it) project called AOSP (Android Open Source Project), and there is Google’s version of Android, augmented by its own proprietary services (maps, Gmail, etc.).

In the hotly contested area of smartphones, the distinction between the two can be significant. In the world of embedded devices, it is unlikely that your washing machine is going to have a Gmail account, so the distinction between the two becomes less important.

But if every device from your phone to your rice maker is running the same operating system, isn’t this a huge vulnerability? “Yes,” Mr. McDonagh said bluntly. “But having it open to a global pool of experts to tackle the problems is much more reassuring than the secular scrutiny of Microsoft or Apple. I am sure they have incredible experts, but they don’t have a world of experts.”

Paradoxically, the future for Android (outside the smartphone), said Mr. McDonagh, is for it to disappear—it will become almost invisible, the thing that makes everything tick. “If Android is successful, it will vanish into every area of our daily lives.”

How to make smooth scrolling ListViews in Android

High performance listviews can improve the user experience

In mobile development today, the user interface and user experience (UI/UX) are king. It’s important to optimize the performance of your application to provide the best experience. Here’s how to optimize the ListView in Android for smooth scrolling.


Android has lagged behind iOS on the UI/UX front due to the increased flexibility provided by the Android platform. While iOS is more limiting on what’s available to the developer, these limitations force key components to be optimized for the best user experience. It’s up to you as a developer to properly code your application for performance in many more cases under Android.
One of the most utilized views in mobile applications is the List View, a vertical scrolling set of elements. It’s important that you construct the list view and it’s layout elements in the proper way in order to achieve efficient performance and smooth scrolling.

ListView creation

When you build a layout in Android, you construct your view in XML, inflate that layout into a View object, then perform an ID lookup on the view for each element - casting it to the proper widget type and binding it onto a variable.
@Override
 public View getView(int i, View view, ViewGroup viewGroup) {
     view = mInflater.inflate(R.layout.twitter_item,viewGroup,false);
     TextView name = (TextView)view.findViewById(R.id.name);
     TextView screen_name = (TextView)view.findViewById(R.id.screen_name);
     TextView tweet =     (TextView)view.findViewById(R.id.tweet);
     TextView created_at = (TextView)view.findViewById(R.id.created_at);
      TwitterItem item = (TwitterItem)getItem(i);
     name.setText(item.getUser().getName());
     screen_name.setText(item.getUser().getScreen_name());
     tweet.setText(item.getTweet());      created_at.setText(TwitterHelper.toFriendlyTwitterDate(item.getCreated_at()));
    return view;
 }

This function will get executed for every cell in a listview to draw the layout. Android employs a recycling technique to avoid inflating the same layout over and over again (since it’s always the same in this case), however the ID look-ups for each specific element are still called every time.
That means for every cell in your list view, CPU cycles are used to look up these same 4 twitter elements every single time. More complicated views can have dozens of elements. The cost of this look up is the number of cells * the number of elements which can grow quickly.

The View Holder Pattern

With the View Holder pattern, a static reference to each element is created and held onto while the ListView is being drawn. This reduces the cost of the element look-ups to 1 * the number of elements, a massive savings in CPU cycles.
Note: Ok, Ok, it’s not quite 1x since the view isn’t always recycled but you get the picture.
Implementing this pattern is pretty simple. To start, make a static class inside your Adapter class to hold your widget elements:
public class TwitterAdapter extends BaseAdapter {
   static class TwitterViewHolder{
       TextView name;
       TextView screen_name;
       TextView twitter;
       TextView created_at; } ... }

Then, modify your getView function.
First, check and see if the view has been initialized yet. If it hasn’t, initialize both the view and the ViewHolder, perform the element look-ups, and set the Tag on the view to hold your ViewHolder object. If it has, get the existing ViewHolder object from the view Tag (saving the ID look-ups).
Next, use the ViewHolder element references to build out your view.

@Override
 public View getView(int i, View view, ViewGroup viewGroup) {
        TwitterViewHolder viewHolder;
       if(view == null){
          view = mInflater.inflate(R.layout.twitter_item,viewGroup,false);
          viewHolder = new TwitterViewHolder();
        viewHolder.name = (TextView)view.findViewById(R.id.name);
        viewHolder.screen_name = (TextView)view.findViewById(R.id.screen_name);       viewHolder.twitter = (TextView)view.findViewById(R.id.twitter);
    viewHolder.created_at = (TextView)view.findViewById(R.id.created_at);    view.setTag(viewHolder);
  }else{
      viewHolder = (TwitterViewHolder)view.getTag();
 }
     TwitterItem item = (TwitterItem)getItem(i);
  viewHolder.name.setText(item.getUser().getName());    viewHolder.screen_name.setText(item.getUser().getScreen_name()); viewHolder.twitter.setText(item.getTwitter()); viewHolder.created_at.setText(TwitterHelper.toFriendlyTwitterDate(item.getCreated_at()));
  return view;
}

A better experience

This can be considered a best practice for ListView coding. Android apps have a terrible reputation for design because optimizations like this are skipped. The beauty of Android is its openness and flexibility, you can do near anything, but with that power comes a responsibility to take the necessary measures to make your creation efficient. Since the ListView control is so common, this tip can go a long way to help Android UI/UX.

BBM downloads touch 10 million mark on Android, iOS in first 24 hours

Canadian handset maker BlackBerry said its popular chat application BBM for rival Android-based handsets and iPhones has witnessed over 10 million downloads in the first 24 hours of its re-launch.
The struggling smartphone maker had yesterday resumed the rollout of BlackBerry Messenger (BBM).
"It's been 24 hours since we resumed the launch of BBM for Android and iPhone. And what a day it's been! We've already had more than 10 million downloads of BBM," BlackBerry EVP (BBM) Andrew Bocking said in a post on the company's official blog.

In September, BlackBerry had paused the global rollout of its instant messaging service BBM on rival phones, blaming the delay on issues caused by an unreleased old version of BBM (BlackBerry Messenger).
"When we saw almost one million people install an unreleased version of the Android version, another million use workarounds to download BBM onto their iPhones and another six million people pre-register to know when BBM became available for iPhone and Android, we knew we were on to something huge," he noted.
The application has also seen 'overwhelmingly positive reviews' on Google Play and the App Store. BBM has earned 60,000 five-star reviews on Google Play from about 87,000 reviews, he added.
On Apple's App Store, BBM rose quickly in the free app rankings in the first 24 hours, taking the number one slot in more than 75 countries, including the US, Canada, the UK, Indonesia and most of the Middle East, Bocking said.
BlackBerry said it will add more new features to BBM to promote it as the private social network.
"While we're excited to bring BBM to iPhone and Android - we aren't stopping there. Work isn't slowing down at all. We committed to delivering a BBM experience on iPhone and Android that was equal to that on BlackBerry 10. That means bringing BBM Video, BBM Voice and BBM Channels...
"My team is still committed to bringing those features to BBM on Android and iPhone in the near future. And we are not stopping there - we have some great new features planned that will build on BBM as the private social network you count on for immediate conversations you can control and trust," Bocking said.
Download BBM for Android here and iPhone here