Errata

Building Hybrid Android Apps with Java and JavaScript

Errata for Building Hybrid Android Apps with Java and JavaScript

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Chap 2, section: What Is ADB
Connecting to an Android Device Over WiFi

Get "Unable to connect to 192.168.1.11:5555:5555" error message after I followed instructions to use "adb shell setprop service.adb.tcp.port 5555" to set port (to 5555 in my case) for my device (at IP address 192.168.1.11).

When I do: "adb shell getprop | grep adb", I do see [service.adb.tcp.port]: [5555], so the port seems to be set ok. I believe the problem is that adb is still in USB mode.

What does seem to work are the following steps, following
http://stackoverflow.com/questions/14357705/adb-over-wireless
adb tcpip 5555 (5555 is the default if no port number is specified in the 'connect' command used next)
adb connect 192.168.1.11 (for my device)

Now do: "adb devices", and see two devices listed.
If the usb cable is disconnected, "adb devices" show one device.

Extra credit: if the usb cable is not disconnected but only one real device is connected via usb and tcp, trying to switch back to USB mode must be done with something like:
adb -d usb
The -d flag is needed to direct the command to the only connected USB device, otherwise see "error: more than one device and emulator"

Cheers,
ieeeCLK

Anonymous  Jan 12, 2014 
Chap 2, section: "Installing SASS"
End of 1st paragraph

To install SASS from the command line, use the following command:

$ gem install sass

Above fails with "You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.". Instead, use sudo in the Mac command below, then enter the Admin user password when prompted for it:

$ sudo gem install sass


Cheers,
ieeeCLK

Anonymous  Jan 12, 2014 
PDF Page 67
1st code example

// Load an html file
String html = loadFileFromSDCard("file:///sdcard/oreilly/book/logo.png"); WebView.loadDataWithBaseURL("", html, "text/html", "UTF-8", null);

Loading an image file instead of html file

Dhruv Baldawa  Aug 13, 2013 
PDF Page 69
Java code example

WindowManager.LayoutParams.FLAG_FULLSCREEN is typed twice in setFlags()

@Override
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
... }

Note from the Author or Editor:
Dear Reader,

This is not a mistake. According to Android API documentation, setFlags(int flags, int mask) takes two parameters.

http://developer.android.com/reference/android/view/Window.html#setFlags%28int,%20int%29

Dhruv Baldawa  Aug 13, 2013