Quantcast

Tutorial: (v0.1) Developing GoogleTV applications using the Logitech Revue

Discussion in 'Google TV Development Discussion' started by mobimation, Feb 21, 2012.

  1. mobimation

    mobimation New Member

    Joined:
    Dec 12, 2011
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    Solna, Sweden
    Introduction
    This tutorial is intended to describe how you as an Android application developer can get up and running with the Logitech Revue Google TV companion box for efficient testing and debugging of Google TV compliant Android applications. As prerequisite you will benefit from have some experience from developing for other Android device categories. This tutorial will expand over time to cover the topic in more detail.

    With the Android 3.1 upgrade for the Logitech Revue Google TV companion box, the Revue has become a very useful development tool for the Android application developer.
    Predominantly on Ebay these boxes are still priced to sell in face of earlier commercial failure which means you get boxes at bargain prices compared to the original offering over a year ago and now with the 3.1 upgrade their value greatly surpasses the original configuration. Most every box you find will be running Android 2.2 which will auto-upgrade to 3.1 when connected to the Internet. You may find them as new, used or refurbished at various prices and levels of cosmetic perfection.

    Disclaimers

    All conceivable disclaimers apply to this tutorial. This text is provided solely to aid fellow Android developers to get going in an app development scenario where the Logitech Revue is used as a testing/debugging tool, and where the developer assume all responsibility for any purchase decisions and problems that could arise from the purchase and usage of a Logitech Revue box. Any settings shown reflect my own particular settings. This is not official Google material but a developer contribution.

    The Logitech Revue as Google TV application developer tool
    After a 3.1 upgrade that arrived late 2011 the Revue now supports access to download and installation of the Android Market Google TV specific category class of apps. This means that published apps that are sensed as Google TV compatible will be listed when a Google TV compliant device browse the Market. The Android 3.1 release for the Revue also supports Android Debug Bridge (adb), the same mechanism as used on Android enabled phones and tablets for local application install and source level debugging. Until this happened GoogleTV was not so easy to develop for in terms of testing applications before publishing. A 3.2 release is upcoming for the Revue. This tutorial will be updated with any details needed for that version once it arrives. See: Development | GTVHub.com This tutorial will ultimately cover what you need to know in order to get up to speed with developing apps that will be accepted as Google TV compliant apps by the Android Market and consumer Google TV products.

    The potential of developing for Google TV
    Once you design, configure and publish apps that meets Google TV requirements they can show up on Android Market when viewed on a Google TV device. Using the Revue as testing tool you as a developer will be able to more confidently publish apps that reach consumers who use a Google TV compliant product. Such users are then able to more reliably find, optionally purchase and install apps on their Google TV device that you have published on Android Market. This will be a huge commercial opportunity for developers provided that big TV vendors come out with Google TV enabled products that ends up in living rooms of many consumers. The Google TV specification is well defined so an app you develop is likely to work across a wide range of Google TV enabled products. The unfolding of Google TV commercial success is still in the making and you can actually play a part in this by publishing apps that consumers find irresistible in the Google TV context.

    Introduction of Revue hardware
    We take a quick look at the hardware. The actual properties of the Revue does not require your app to be adapted in any way to work on the Revue specifically. The Revue hooked up to a TV set and Set Top Box becomes the equivalent of a Google TV enabled TV set. In essence the intended role of the Logitech Revue product for consumers has been to add Google TV and Internet access capability to an existing combination of HDMI equipped TV set and TV tuner Set Top Box that originally lacked this feature. It has been a belief that this combination of TV equipment is very common out there and thus the Revue would be a natural companion in such a configuration for adding Internet access and Android applications to the TV experience.

    Testing for Android application compatibility
    You can configure you Android application so that is is compatible across all sizes of Android enabled devices and displays if so desired. The Android SDK framework offers mechanisms for configuring the app so that it can work across device categories. Attributes of the application will be sensed by Android Market when you publish the application. Your application will be visible to select users of various device types depending on if your application is claiming compatibility with a device category and API revision level that is matched by the device of a particular consumer. The Revue will be very useful as test tool to assure that your developed app will show up as available for installation on a Google TV enabled system when the consumer browse the Android Market from such a device. You can use your Revue to browse the Android Market to verify that your published app is indeed being listed in the Google TV category and that you can download and install the published app on your Revue. A success means an increased likelihood that your app will work to install also on other Google TV enabled products. That is one compelling reason to make sure you have a Google TV compatible device such as the Revue in your arsenal of development tools.

    The box
    The Revue contains an Atom based hardware processor board that runs Android 3.1 and is equipped with graphic processor hardware that for example makes possible very smooth streamed Flash video playback. The Revue in particular excels in streamed video playback performance due to its hardware acceleration support. There is a cooling fan in the box that can be heard faintly when the unit operates.

    [​IMG]
    Typical Revue connections for a developer


    Summary of signals/jacks:

    • HDMI IN - Input from a Set Top Box TV receiver or other HDMI video source.
    • HDMI OUT - Output to a TV set of computer terminal with up to 1080p (1920x1080 pixels) resolution.
    • USB1 USB2 - USB jacks where you can connect memory cards or USB disk drives that becomes mounted by the Revue and is available for file access from the installed Android apps. Actual file system mount assignments are Revue specific.
    • SPDIF - Optical audio out (toslink)
    • IR Blaster - two outputs for attaching IR transmitters for better signal strength when controlling a Set Top Box and TV set from the Revue keyboard.
    • Power supply jack (12V DC)
    • ETHERNET - Network jack for cable Internet access. The Revue will get an IP address by DHCP or be configured with a fixed IP address depending on how you configure the settings. The Revue also supports Wifi so an alternative is to have the Revue connect to a Wifi router wireless instead of using an Ethernet cable. Ethernet will allow higher bandwidth for critical operations such as streamed video or large file transfers. For a developer this is an important area to configure, because the Android Debug Bridge (adb) support for debugging/app installation works over networking. You can set up adb to work over Ethernet or Wifi (more on this further down this tutorial).
    The keyboard
    The Logitech Revue keyboard is faithful to the Google TV spec for a keyboard and implements an excellent D-Pad as well as a mouse area in addition to a full Qwerty keyboard. The size is rather compact and well suited for the sofa. For a developer especially the D-Pad is of great interest for being able to accomplish a good D-pad support in the app per Google TV requirements. There is a set of well crafted media transport keys. The keyboard offers some Google TV specific function keys for turning on/off an Audio receiver (AVR),Set Top Box(STB) and TV set (TV) and a few other keys. The keyboard is battery powered and wireless.

    Display/TV set
    The optimal display is to connect the Revue HDMI OUT jack using a HDMI cable to the HDMI input of a TV set, preferably with a 1920x1080 resolution. You may alternatively connect it to an ordinary computer terminal with HDMI input or via an HDMI/DVI adapter. For my own development I most often have the Revue hooked up to a 1920x1200 pixel computer terminal over a HDMI to DVI cable but a TV set is optimal for the faithful consumer experience.

    Audio out from Revue

    The Revue features an optical digital audio output so you can connect an optical cable to your favorite audio receiver for very high quality audio reproduction of whatever your Android app will be playing. In my development I have the Revue connected to a Logitech Z906 5-channel speaker set, a great companion for app audio monitoring. If you have the Revue hooked up to a TV set using HDMI then that cable transports audio to the TV and any further equipment you may have connected to the TV set for audio. So, the optical output is one alternative way to output audio.

    Set Top Box (TV tuner)

    For the app developer the TV tuner is optional and not really related to Android apps. The Revue is designed as a Companion Box to sit between a HDMI equipped TV tuner Set Top Box (STB) (cable, satellite or IP) and a TV set with HDMI input. By pressing the TV button on the Logitech keyboard the Revue will bypass itself allowing the HDMI IN signal to be directly passed to HDMI OUT. The Revue has mechanisms to allow its video to be superimposed (alpha blended) on top of the HDMI IN video when needed, thus accomplishing a smooth user experience when watching TV and simultaneously making use of Android apps and Google search/Web access via user keyboard navigation. A developer who is mostly interested in seeing the developed app on screen and navigate the Android market can do with just connecting a HDMI cable between HDMI OUT and the TV set (or a HDMI/DVI equipped computer terminal).

    Network installation/configuration for developer use

    As mentioned Android Debug Bridge (adb) is supported in the Android 3.1 upgrade that arrived late 2011 for the Revue. adb is the mechanism for interaction between your development computer Android SDK and the Revue for install and debugging of the apps you develop.
    If you purchase a Revue unit chances are it is still at Android 2.2 and needs to be upgraded. Once you hook the box up to the Internet this upgrading will occur automatically and you will be prompted to proceed through the install procedure.

    Fixed IP address
    For developer usage you will find it is very convenient to make sure the Revue gets the same IP address every time it is connected. This can be convenient for addressing other hooked up devices as well during development. I recommend you use a Wifi Router to connect all your gadgets to and let this router act as your gateway to the Internet. I have my Revue connected to the router over Ethernet cable but you could use Wifi as well. The router typically supports reserving of an IP address for a unit by binding to the MAC address of the device. Router setup software makes this simple by offering easy click interfaces to set up such reservations.

    [​IMG]
    Labeling the Revue can be a good thing to remember what IP you assign to it.

    Enabling adb in the Revue
    The essential detail is getting the settings right in the Revue for adb access to work. Pressing the Home icon button (right hand upper key of D-Pad) will take you to the main Revue menu. Press "All Apps" Navigate to "Settings", select it.

    • Press "Applications" and then "Development".
    [​IMG]

    You arrive at this panel:

    [​IMG]

    • Enable "Remote debugging" (tick box).
    • Set the "Debugger IP address".
    This must be the IP address of your app development computer where you run Eclipse. When you connect to the Revue from that computer using the Android SDK "adb connect " command then the Revue will check if the IP address of the device that is trying to connect to it on adb is indeed the device with the specified IP address, and will only accept a connection if that address matches.
    So it is convenient to make sure both your computer and Revue are assigned fixed IP addresses so that the settings can remain unchanged over time. Most home routers supports an easy way to reserve the currently assigned IP address for a device so that the same IP address will be assigned to it every time the device connects to the router. Consult the manual for your router if needed.

    [​IMG]
    Typical Reservation UI example in router (D-Link DIR-855)


    So there are two IP addresses of interest:
    (1) the IP address of the computer that will connect over adb to the Revue.
    (2) the IP address of the Revue so that the development computer for your convenience can connect to the Revue using the same IP address every time.

    The default port of adb is 5555 so an example connect command could be: adb connect 192.168.0.193:5555 while would have the same effect as adb connect 192.168.0.193 Then by launching DDMS in Eclipse you can find the Revue listed in the Devices list. And so on same as for any Android device.

    Application development

    This section contains references to Google documentation and video tutorials that are fundamental for a developer to understand the development requirements.

    Mandatory studying for the Google TV app developer


    - A main Google entrypoint:
    https://developers.google.com/tv

    - To get going with GoogleTV specific info:
    https://developers.google.com/tv/android/docs/gtv_android

    - Excellent video from Google IO 2011:

    Google I/O 2011: Building Android Apps for Google TV
    with Christian Kurzke and Jason Bayer, 5/11/2011



    Those into HTML5 and CSS3 will benefit from:

    Optimizing websites for Google TV

    https://developers.google.com/tv/web/docs/optimization_guide


    JQuery for D-Pad support in web page navigation https://developers.google.com/tv/web/lib/jquery/controls-tutorial

    Code examples page
    https://developers.google.com/tv/android/docs/gtv_demo_samples


    Revue specific aspects - SD Cards and USB drives


    The Revue is a bit odd in that the drive labeled as "/sdcard" resides internal to the case and is not a replaceable piece of storage. On many android devices this represents removable storage. So the Revue supports "internal" app-private storage, /sdcard, as well as extra drives that you mount on USB.
    You can attach a SD card by inserting it in a SD card-to-USB adapter and plugging this into one of the two USB slots at the back of the Revue.
    That card will then be detected as an USB drive and becomes mounted under "/mnt/media" as a folder that begin with "usb." followed by some random string. An example of the path for such a mounted drive is "/mnt/media/usb.FC30-3DA9".
    So, your app should look for folders that begin with "usb." and those are your USB mounted drives.
    Again that mounting convention is specific to the Revue so you cannot expect that to be the same on other devices with a /mnt folder. This can however be a convenient connectivity for accessing various file resources from the Revue.


    I will add more detail in a future tutorial version. This is a first writeup.
    I'm also producing a video tutorial to demo a "develop/debug/test/publish download/install" flow using the Revue as development test tool.
    Out some time March.


    Enjoy,

    Gunnar Forsgren, Mobimation AB, Sweden
    http://mobimation.com gunnar.forsgren@mobimation.com
     
    Last edited by a moderator: Jul 30, 2014
    • Like Like x 6
  2. CatfishRivers

    CatfishRivers Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    14,605
    Likes Received:
    877
    Trophy Points:
    113
    Thanks for all the effort that you put into your post. I'm not a developer - and as such I do have a question for you.

    Seeing as how the Logitech Revue is a discontinued product that runs the Intel chip - and the next generation of GTV devices (due out later this year) will run ARM chips - I was wondering how this will effect you as a developer? How will this effect GTV users in terms of the number of apps available for their specific device?
     
    Last edited: Feb 21, 2012
  3. mobimation

    mobimation New Member

    Joined:
    Dec 12, 2011
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    Solna, Sweden
    What processor is used could be noticeable mostly in performance. Same as how a PC from the 90s will not run many apps of today, when new features come available developers will begin using them and require new API levels in their apps unless they have a compelling reason to be compatible with older products. One day the old hardware is so helplessly outdated that people recycle them. Strictly the Revue today will be usable to verify apps that require no higher than API level 12 (Android 3.1) to run. This Revue model will likely receive a few further upgrades until it will no longer be fit to support further ones. And at that point that API level is the maximum this Revue model can support. You can continue to use it for testing on apps that do not require API's beyond that level. The most interesting products to test apps on is most often the most popular ones, to assure that the majority of customers will have a good experience. Today the Revue is cost effective as app testing tool for those who like to have their app show up on Market as Google TV compatible. If Google TV takes on in a big way in coming years the Revue of today will at that point be recognized mostly as early pioneer product with a quite small user base.
     
    • Like Like x 4
  4. berrymartin

    berrymartin New Member

    Joined:
    Dec 20, 2012
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for taking time for sharing this article, it was excellent and very informative.
     
  5. guest

    guest Active Member

    Joined:
    Aug 9, 2012
    Messages:
    756
    Likes Received:
    42
    Trophy Points:
    28
    Mobimation wrote:

    "Revue specific aspects - SD Cards and USB drives


    The Revue is a bit odd in that the drive labeled as "/sdcard" resides internal to the case and is not a replaceable piece of storage. On many android devices this represents removable storage. So the Revue supports "internal" app-private storage, /sdcard, as well as extra drives that you mount on USB.
    You can attach a SD card by inserting it in a SD card-to-USB adapter and plugging this into one of the two USB slots at the back of the Revue.
    That card will then be detected as an USB drive and becomes mounted under "/mnt/media" as a folder that begin with "usb." followed by some random string. An example of the path for such a mounted drive is "/mnt/media/usb.FC30-3DA9".
    So, your app should look for folders that begin with "usb." and those are your USB mounted drives.
    Again that mounting convention is specific to the Revue so you cannot expect that to be the same on other devices with a /mnt folder. This can however be a convenient connectivity for accessing various file resources from the Revue."

    Gunnar,
    How does one transfer the contents of the Revue's internal SD card to a connected USB device???
     
  6. mobimation

    mobimation New Member

    Joined:
    Dec 12, 2011
    Messages:
    21
    Likes Received:
    5
    Trophy Points:
    3
    Location:
    Solna, Sweden
    Hi excuse for late answer :eek: I was away for many months earning a living..
    You can use one of the popular Android file manager apps. They can list both the content of the internal drive and the one you plug in so you could copy stuff across.
    Or if so inclined you could of course do this in an app you develop. Ordinary File based operations.
     
    Last edited: Apr 17, 2013
  7. mrspock

    mrspock Active Member

    Joined:
    May 14, 2012
    Messages:
    454
    Likes Received:
    64
    Trophy Points:
    28

    Welcome back !

    I really want to develop an Android app but just haven't been able to get around to it.
     
  8. Henry07

    Henry07 New Member

    Joined:
    May 9, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi mobimation!
    I read your post is informative, your post is very nice, thanks for sharing.
     

Share This Page

Search tags for this page
debug google tv app
,
develop apps for google tv logitech revue
,
google tv revue allow debugger for ip address
,
logitech revue adb
,

logitech revue install apps through adb

,
logitech revue install from internal terminal
,
system tool logitech revue app
,

tutorial how to setup a google tv box