Code typo in Book listing 34.1 p 542


#1

In RunDataBaseHelper.java the book has:

public void onCreate(SQLLiteDatabase db)
//Create the run table
[color=#408040]db.execSQL(“create table run (” +
"_id integer primary key autoincrement, start_date integer)");[/color]

The code you provide online, which works great, has:

[color=#008000]db.execSQL(“create table run (_id integer primary key autoincrement, start_date integer)”);[/color]

I am a pretty good typer but inexperienced with SQL statements in code, so I was not seeing the polyline. I swapped my typed-in RunDataBaseHelper with yours and it worked, and I think the above is the only difference.


#2

Unfortunately, the length of the lines we can use in the book is limited, so we have to split the lines like that.

They should be identical at runtime, though - there is no semantic difference between the code in the book and the code in the solution.