Knowledge Base & Forum/Forums/General Information

NOOK Developer Reference Guide

ghoffer
posted this on September 12, 2012, 6:01 PM

Last Update: 02 May 2013

Latest Changes:

Updated information for 2.1 SW for NOOK HD & HD+.

Updated User Agent strings for all NOOK devices.

NOOK HD & NOOK HD+ now support up to 64 GB removable SDXC cards.

Contents

1.0 Introduction

1.1 New Features
1.2 Major Changes
1.2.1 Display Density
1.2.2 System and Status Bar Sizes
1.2.3 Layout Folder
1.2.4 Storage Locations
1.2.5 Wallpaper API Has Changed 
1.3 Device Profiles
1.4 Device Specs
1.4.1 User Agent Strings
1.5 NOOK Tablet vs NOOK HD Devices
1.6 Bluetooth Use Cases with Profile Support
1.6.1 Supported Bluetooth Profiles
1.6.2 Bluetooth Code Location
1.7 Accessibility

2.0 Porting from a NOOK Tablet

2.1 Android OS Version
2.2 Bitmap Memory
2.2.1 Backing Bitmap RAM Increase
2.3 Memory Management

3.0 Multimedia Specifications

3.1 Supported Codecs
3.1.1 Video Decoders
3.1.2 Audio Decoders
3.2 Playlist Support
3.3 Multistream Playback
3.4 Recommendations for Content Creators
3.4.1 Recommended Formats
3.4.2 Recommended Minimum Bit Rates for 1080p

1.0 Introduction

This section provides development guidelines, profiles, specifications and general information.

Back to Top

1.1 New Features

  • New high definition displays
  • Bluetooth
  • App widgets

NOOK device features:

FeatureNOOK
Color
NOOK
Tablet
NOOK HD
 NOOK HD+
Android Widgets No No Yes
Accelerometer Yes Yes Yes
Bluetooth No No Yes
Camera No No No
GPS No No No
HDMI No No Yes
LocationManager - With GPS No No No
LocationManager - Without GPS (Coarse Location) No No Yes
Messaging (SMS/MMS) No No No
Microphone No Yes Yes
Text to speech (TTS) No No Yes

1.2 Major Changes

The following changes affect app development:

  • Display density
  • Layout folder
  • External storage
  • Internal storage
  • Wallpaper API has changed

1.2.1 Display Density

DeviceResolutionDensity
NOOK HD+ 1920x1280 257 dpi (hdpi)
NOOK HD 1440x900 243 dpi (hdpi)
NOOK Tablet 1024x600 169 dpi
NOOK Color 1024x600 169 dpi

Back to Top

1.2.2 System and Status Bar Sizes

This section lists the height in pixels and device-independent pixels for the status bar at the top and the system bar at the bottom of a NOOK device screen. We recommend not specifying values in terms of absolute pixels. Instead use the density-independent pixel values so that your app scales properly on different screen sizes and resolutions. Bar sizes are the same for Portrait and Landscape modes. 

The following are the current values (subject to change):

DeviceBarPixelsDPDPI
NOOK HD+ Status - Top 54 34 257
NOOK HD+ System - Bottom 84 52 257
NOOK HD Status - Top 39 26 243
NOOK HD System - Bottom 84 55 243
NOOK Tablet 
NOOK Color
System - Bottom - The Status bar combines with the System bar 42 40 169

Pixels indicates the bar height, "dp" stands for density-independent pixel, and "dpi" indicates dots per inch or density.

The formula to determine pixels is:  px = dp * (dpi / 160)

Note  NOOK HD and NOOK HD+ do not support true full screen mode. The bottom system bar always displays. Therefore, the NOOK "n" key is the home button and not the back key since the system bar contains a back key that always displays.

For more information, see Supporting Multiple Screens

Back to Top

1.2.3 Layout Folder

The following folders are where the device layouts are pulled from:

DeviceFolder
NOOK HD res/layout-sw600dp
NOOK HD+ res/layout-sw800dp
NOOK Color res/layout-large
NOOK Tablet res/layout-xlarge

Back to Top

1.2.4 Storage Locations

The NOOK Color and NOOK Tablet used /mnt/media as their storage location. The NOOK HD devices now follow Android's recommended implementation, which makes it easier for NOOK App Developers to follow the Android Developer Guidelines without significant changes to resource layouts. In Android Ice Cream Sandwich, SD card storage now has an internal and external component. Internal SD card storage is equal to the storage on a NOOK device minus the Android SDK and NOOK custom code. The external SD card is the card that users can add to their NOOK device. NOOK devices cannot install an app from the external SD card, but apps can determine if the external card exists and write to it if necessary.

Important    Because of these changes, apps need to verify the device before storing or retrieving files:

  • Choose the correct device - When coding for all NOOK devices, /mnt/media points to the internal storage for older devices, which causes newer NOOK devices to error out. Conversely, using /mnt/sdcard for the older devices means accessing external storage on the NOOK Tablet or NOOK Color and also the newer devices' internal location.
    DeviceInternal StorageExternal Storage
    NOOK HD /mnt/sdcard /mnt/ext_sdcard
    NOOK HD+ /mnt/sdcard /mnt/ext_sdcard
    NOOK Color /mnt/media /mnt/sdcard
    NOOK Tablet /mnt/media /mnt/sdcard
  • Check to see if the SD card exists - See the external Pavel Sigidin page, Check external SD card on Android device.
  • Get the path to the storage location - See Storage directory paths.
  • View card storage size - On the NOOK HD and NOOK HD+, the internal SD card storage is as large as the NOOK device's storage size minus the size of the Android OS plus the NOOK custom code. You can use adb shell df to determine available internal SD card storage for a NOOK device. 
  • Internal storage - The internal card storage encompasses all the folders that are visible when you view the device including My Files, apps you install using the adb install command, screenshots, and so on.

Back to Top

1.2.5 Wallpaper API Has Changed

NOOK HD & NOOK HD+ apps now use the Intent.ACTION_SET_WALLPAPER API, for example:

import android.content.Intent;
Intent i = new Intent();
i.setAction( Intent.ACTION_SET_WALLPAPER );
startActivity( i );

Note You can also use the WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER API; however, the recommended ACTION_SET_WALLPAPER API works with both regular and live wallpapers and lets users choose a wallpaper from the gallery. Whereas ACTION_LIVE_WALLPAPER_CHOOSER only works with live wallpaper. 

When ACTION_SET_WALLPAPER runs on a NOOK device, users see this view:

wallpaperview.png 

Important The NOOK Emulator does not support the Wallpaper API, SHOP Details API, or DRM API. Only test NOOK APIs on a NOOK device.

NOOK Tablet & NOOK Color apps can continue to use the NOOK Wallpaper API. For more information, see Wallpaper API.

AIR apps can use the AIR ANE Extension -- See the AIR Quick Start Guide for more information.

See Also: Wallpaper API

Back to Top

1.3 Device Profiles

Features found on most Android devices are not present on these devices; for example GPS, compass, vibrator, camera, etc. The devices in all respects conform to the Android Compatibility Definition Document (CDD) in terms of how the APIs for these non-included features are handled (see CDD section 7). Developers should be careful to check for null returns from APIs for unsupported features.

Back to Top

1.4 Device Specs

Note The NOOK HD+ specs are the same as the NOOK HD except as noted.

Note For information regarding differentiating NOOK devices by model see NOOK android.os.Build information.

FeatureNOOK HDNOOK HD+
Operating System Android Ice Cream Sandwich 4.0.4  
Model Number BNTV400 BNTV600
API Level 15  
Adobe AIR 3.3  
Dimensions 194.4 mm long x
127.1mm wide x
11.0 mm deep
240.3 mm long x
162.8 mm wide x
11.4 mm deep
Weight 300 grams 500 grams
CPU Processor TI OMAP4470 1.3 GHz TI OMAP4470 1.5 GHz
GPU Processor POWERVR SGX544  
Open GL Version OpenGL® ES v2.0, OpenGL ES v1.1, OpenVG v1.1, and EGL v1.3  
Display Resolution 1440x900 1920x1280
Aspect Ratio 1.6 (16:10) 1.5 (3:2)
RAM 1 GB  
Storage 8 or 16 GB 16 or 32 GB
Removable Memory MicroSD expandable to 64 GB - See the Removable Memory note  
APK Install Location Must install to internal memory  
User Agent String See User Agent strings. See User Agent strings.
Microphone Audio Formats AAC, AMR Narrow Band, AMR Wide Band for audio encoding. We recommend AAC for Audio Recording.  
Microphone Sampling Rates 8Khz to 44.1Khz for input. We recommend 44.1Khz for better quality.  
Content Audio Formats MP4, M4A, 3GP, AMR, MP3,
OGG, AAC, WAV
 
Content Audio Codecs MPEG4, 3GGP, AMR, MP3,
OGG, AAC (ADTS), WAV
 
Image Formats JPEG, GIF, PNG, BMP  
Video Hardware Scaling 1080p, 720p  
Video Formats MP4, 3GP, WebM, MKV, MPEG-TS  
Video Codecs MPEG4, 3GPP, WebM, MKV,
MPEG-2 TS
 
Content File Formats EPUB, PDF, DOC, DOCX, DOCM, XLS, XLSM, PPT, PPTX, PPTM, PPS, PPSX, PPSM, TXT, HTM, HTML  
Keyboard Virtual QWERTY  
Softkeys Back and Home  
Power Hardware Power Key  
Volume Key Hardware Volume Up/Down  
Home Key NOOK key on front  
Accelerometer Yes  
USB Proprietary connection  
Wi-Fi Connectivity B/G/N, 2.4 GHz only  
Wi-Fi Security WEP, WPA, WPA2, EAP  
HDMI Out Yes  
Speakers Stereo  
Headphone Jack 3.5mm  
Microphone Full duplex  
Bluetooth Profiles See Bluetooth Profiles  
Google Cloud Messaging (Push Notifications) No  

Removable Memory: The NOOK HD and NOOK HD+ permit removable SDXC cards of up to 64 GB. The cards can be formatted for exFAT or FAT32. For FAT32 cards, if you format the SD card outside the NOOK device, the maximum file size that you can store on the card is less than 4 GB. If you format the SD card using the NOOK device, you can store files on the card greater than 4 GB. You can format an SD card in the NOOK device by clicking Settings > Storage Management > SD Card > Erase SD Card. Formatting an SD card in the NOOK HD or NOOK HD+ sets the formatting to exFAT. 

Note exFAT formatted cards cannot be used in the NOOK Tablet and NOOK Color.

1.4.1 User Agent Strings

The user agent strings for NOOK devices are:

  • NOOK HD - Mozilla/5.0 (Linux; Android 4.0.4; BNTV400 Build/IMM76L) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.58 Safari/537.31
  • NOOK HD+ - Mozilla/5.0 (Linux; Android 4.0.4; BNTV600 Build/IMM76L) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.58 Safari/537.31
  • NOOK Tablet 16GB - Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; NOOK BNTV250 Build/GINGERBREAD 1.4.3) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1
  • NOOK Tablet 8GB - Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; NOOK BNTV250A Build/GINGERBREAD 1.4.3) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1
  • NOOK Color - Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; NOOK BNRV200 Build/ERD79 1.4.3) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1

Back to Top

1.5 NOOK Tablet Versus NOOK HD Devices

Android Feature/SpecNOOK TabletNOOK HD Devices 
Android Version Gingerbread (2.3) Ice Cream Sandwich (4.0)
Android Widgets No Yes
Android Live Wallpaper Yes Yes
Multi-touch Screen Yes Yes
Multi-touch Hardware 2 fingers 10 fingers
Multi-touch Jazz hands No Yes
Android Faketouch No Yes
Android Microphone Yes (Half Duplex) Yes (Full Duplex)
Android SQL Native Layer Java Layer
Matroska Video (*.MKV) No Yes
FLAC Audio No Yes
Android Bluetooth No Yes
Bluetooth Profiles N/A See Bluetooth Profiles
Storage 8/16 GB 8/16/32 GB
Resources pulled from res/layout-xlarge res/layout-sw800dp (NOOK HD+) 
res/layout-sw600dp (NOOK HD)

Back to Top

1.6 Bluetooth Use Cases with Profile Support

  • Stereo music playback
  • Control music playback from Bluetooth headset for pause, resume, previous, and next
  • Keyboard input - Also provides Braille support.
  • Device discovery

1.6.1 Supported Bluetooth Profiles

  1. Advanced Audio Distribution Profile (A2DP) (Version: 1.2)
  2. Audio/Video Remote Control Profile (AVRCP) (Version: 1.0, but can be upgraded to 1.3, which has not been tested yet).
  3. Human Interface Device Profile (HID) (Version: 1.0)
  4. Serial Port Profile (SPP) - Supported as a service and not as a separate profile. chip vendor certifies and enables SPP.

1.6.2 Bluetooth Code Location

Back to Top

1.7 Accessibility

These devices are intended to be accessible - See the Android article, Developing Accessible Applications.

2.0 Porting from a NOOK Tablet

When porting to the new devices, issues occur even though the new devices are fully compatible Android devices.

2.1 Android OS Version

The new devices are based on Android 4.0, Ice Cream Sandwich. There are significant differences between this and Android 2.3, Gingerbread, as used on NOOK Tablet. Developers are encouraged to read the platform notes for each intervening release:

Back to Top

2.2 Bitmap Memory

Due to the high screen resolutions of the NOOK HD devices, an app requires bitmaps that display well at high resolutions. See the Android article, Designing for Multiple Screens. However higher resolution bitmaps may consume more memory. See the Android article, Displaying Bitmaps Efficiently.

In addition, Android changed the way bitmap memory is allocated. Prior to Android 3.0, bitmaps were allocated in native memory, with only a small descriptor kept on the Java heap; now the entire bitmap is allocated from the Java heap. This can lead to the Java heap being used up very quickly if multiple bitmaps are kept in memory.

Important:

  • Be sure to call recycle() and set the reference to null for any bitmap that is no longer required. Also, note that if an ImageView contains a bitmap that has been recycled, the bitmap data is still retained in memory until you call setImageBitmap(null) on the ImageView. This may even be the case if you call the setImageResource() or setImageDrawable() functions.
  • Retain a bitmap only as long as necessary.
  • If you no longer need a bitmap (as with any object), make sure that there are no lingering references to it anywhere. This can easily happen if a bitmap is assigned to a UI object.
  • Where appropriate, sub-sample an image while loading it, rather than scaling it down when displaying it.
  • Process images off the UI thread. The much larger image sizes on the large NOOK HD displays can cause serious usability issues if you process images on the UI thread. See the Android article, Displaying Bitmaps Efficiently.
  • If multiple images need to be cached, manage the cache carefully. Use the LruCache as described in the Android article, Displaying Bitmaps Efficiently.
  • Handle app configuration changes and where appropriate, pass app data (such as an image cache) through the configuration change. See the Android article, Displaying Bitmaps Efficiently.

2.2.1 Backing Bitmap RAM Increase

A backing bitmap created to cover the NOOK Tablet screen occupies about 2.3 MB of RAM. On the new devices, this increases to 9.4 MB, an increase of 4 times. Clearly this may have a very significant impact on apps that use bitmaps.

Back to Top

2.3 Memory Management

General guidelines for memory management:

  • Never rely on finalizers to free memory. They are unpredictable, and even when they are called, require multiple garbage collection (GC) passes to activate. Use explicit dispose() or recycle() calls. Avoid using finalize() as it impacts the performance of the GC.
  • Use the Android DDMS utility to monitor memory allocations and de-allocations, and find memory leaks (caused by inadvertently keeping a reference to an object). See Tracking Memory Allocations.
  • See the Android article, Avoiding Memory Leaks.
  • Android lets an app request that it be kept in memory in preference to other apps.

System performance benchmarks for the apps are coming to determine how best to optimize system performance.

This Google I/O presentation provides valuable information on memory management, and debugging memory issues:

Weak and soft references can be useful tools, but must be used carefully. This article provides some help:

3.0 Multimedia Specifications

This section provides codecs for video and audio decoders, playlist suppor, and multistream playback, and recommended formats and minimum bit rate information.

Back to Top

3.1 Supported Codecs

This section describes codecs for video and audio decoders.

3.1.1 Video Decoders

ContainerMIME Type ExtensionVideo CodecAudio CodecProfileMax Resolution SupportedMax FPS SupportedBit Rate
MPEG4 mp4 MPEG4 SP/ASP Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2, Mp3 Up to L5 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps
MPEG4 mp4 H.264 BP/MP Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2, Mp3 Partial 4.1 support 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps
MPEG4 mp4 H.264 HP Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2, Mp3  Partial 4.1 support 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps (CABAC)
MPEG4 mp4 H.263 P3L70 Progressive only AAC LC, AAC HEv1, AAC HEv2, Mp3  Up to L5 1080p 60 40 Mbps
3GPP 3gp MPEG4 SP/ASP Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2  Up to L5 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps
3GPP 3gp H.264 BP/MP Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2  Partial 4.1 support 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps
3GPP 3gp H.264 HP Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2  Partial 4.1 support 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps (CABAC)
3GPP 3gp H.263-Progressive only AAC LC, AAC HEv1, AAC HEv2  Up to L5 1080p 60 40 Mbps
WebM webm VP8 - Progressive only Ogg Vorbis  N/A 720p 30 10 Mbps
MKV .mkv MPEG4 SP/ASP - Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2, Mp3  Up to L5 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps
MKV .mkv H.264 BP/MP - Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2  Partial 4.1 support 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps
MKV .mkv H.264 HP - Progressive / Interlaced AAC LC, AAC HEv1, AAC HEv2  Partial 4.1 support 1080p 60 fps for Progressive 
120 fps for interlaced
40 Mbps (CABAC)
MKV .mkv H.263 - Progressive only AAC LC, AAC HEv1, AAC HEv2  Up to 4.1 1080p 60 40 Mbps
MPEG-2 TS MPEG-TS MPEG-2 Progressive/ Interlaced AAC LC, AAC HEv1, AAC HEv2, MP3  N/A 1080p 60 fps for Progressive 

120 fps for Interlaced
30 Mbps for the NOOK HD 

40 Mbps for the NOOK HD+
MPEG-2 TS MPEG-TS H.264 BP/MP/HP Progressive / interlaced AAC LC, AAC HEv1, AAC HEv2, MP3  Up to 4.1 1080p 60 fps for Progressive 
120 fps for interlaced
30 Mbps for the NOOK HD 

40 Mbps for the NOOK HD+

Back to Top

3.1.2 Audio Decoders

ContainerMIME Type ExtensionAudio CodecChannelsBit Rate
MPEG4 mp4, m4a mp3, AAC LC, AAC HEv1, AAC HEv2, AMR-NB/WB 2 320 kbps
3GGP 3gp mp3, AAC LC, AAC HEv1, AAC HEv2, AMR-NB/WB 2 320 kbps
AMR amr AMR NB, AMR WB 2 12.2 kbps / 23.85 kbps
MP3 mp3 MPEG-1 Layer-III, MPEG-2 Layer-III, MPEG-2.5 Layer-III 2 320 kbps
OGG ogg Vorbis 2 500 kbps
AAC (ADTS) aac AAC-LC 2 320 kbps
WAV wav LPCM 8bit/16bit 2 N/A

Back to Top

3.2 Playlist Support

MIME Type ExtensionType
m3u Audio Playlist
m3u8 Audio/Video Playlist
pls Audio Playlist

Back to Top

3.3 Multistream Playback

Playback of at most ONE stream of H.264 video at a time is guaranteed to be supported. This is due to a limitation on the number of reference frames that the platform can store:

ResolutionMax. Reference Frames
720p 9
1080p 4

These figures are equal to the maximum number of reference frames which an H.264 stream can use at level 4.1; therefore only one stream can be guaranteed to play at once.

Note A paused stream is still essentially playing, as it is continues to hold its resources including reference frames. Therefore, this restriction applies to paused videos where users can only pause or play one video at a time.

Users can play more than one stream at a time if users use fewer than the allowed number of reference frames, which is common at 720p. The total number of reference frame limits is in the table at the start of this section.

Back to Top

3.4 Recommendations for Content Creators

3.4.1 Recommended Formats

Create all content with H.264 video and AAC audio in an MPEG4 (.mp4) container. If you need to show content full-screen, such as for demo content, the resultant frame size is different from the standard 1920x1080. Recommended video formats are:

Content TypeFormatDimensionsFrame RateBit RateAspect Ratio
General Content (shows, etc.) H.264 Up to 1920x1080 Up to 30p Up to 40 Mb/s 16:9 == 1.777...
Full Screen - NOOK HD+ H.264 1620x1080 Up to 30p Up to 40 Mb/s 3:2 == 1.5
Full Screen - NOOK HD H.264 1440x900 Up to 30p Up to 40 Mb/s 16:10 == 1.6

Note The NOOK HD+ cannot decode video that is more than 1080 pixels high and 1920 wide. Therefore, for "big" content (demo videos, etc., where you want to showcase the device's screen), you have two choices:

  • Use 1920x1080 -- The video displays pixel-for-pixel, and therefore is as sharp as possible, but has 200-pixel black bands at the top and bottom.
  • Use 1620x1080 -- The video scales up by 18.5%, resulting in some loss of quality, but fills the screen.

On the NOOK HD, like the NOOK HD+, the display is not in the standard 16:9 aspect ratio; so again there are two choices for "big" content:

  • Use 1920x1080 -- The video scales down to 75% of its original size, and looks sharp, but has 80-pixel black bands at the top and bottom.
  • Use 1440x900 -- The video displays pixel-for-pixel, and therefore is as sharp as possible, and fills the screen.

Back to Top

3.4.2 Recommended Minimum Bit Rates for 1080p

Due to the very high quality displays on these devices, ensure that your "showcase" content, such as demo videos, welcome videos, etc. are encoded at a high quality, to show off the device's capabilities. This is the size of the encoded video: 16 Mb/s is 2 MBytes/second, or 120 MBytes/minute, which of course is a lot. For "long-form" content, such as movies, this is impractical – such rates are too high to stream, and too large to store locally.

We recommend the following minimum bit rates for "showcase" content, and for "long-form" content:

Content TypeDimensionsFrame RateMinimum Bit RateBits/pixelBetter Bit RateBits/Pixel
Short “showcase” content 1920x1080 30p 16 Mb/s 0.26 20 Mb/s 0.32
NOOK HD+ fullscreen showcase 1620x1080 30p 14 Mb/s 0.26 18 Mb/s 0.34
NOOK HD fullscreen showcase 1440x900 30p 10 Mb/s 0.26 14 Mb/s 0.36
Long-form content (shows) 1920x1080 24p - 30p 4 Mb/s 0.08 5-8 Mb/s 0.10 – 0.16

Note The "Bits/pixel" column gives an absolute indication of video quality regardless of frame size. There are 24 bits per pixel in the original video; hence 0.10 bits per pixel compressed is a compression ratio of 0.42%. Blu-Ray quality is 0.64 bits per pixel.

 

Back to Top

 
Topic is closed for comments