The highlight a throw-away character and hit enter trick, as well as the type everything into a text editor, then copy/paste it into the Google Sheets cell, both only work on Android devices. I have a Google Spreadsheet that I'm sharing with a client who has an iPhone, and she needs to be able to enter multiple lines within a cell. So I came up with just a little Google Apps Script code to do it on her iPhone (can be entered into the drop-down menu of the Google Spreadsheet, Tools >> Script editor):
function onEdit(e) {
e.range.setValue(e.value.replace(/\\\\/g, '\\').replace(/ *\\n */g, '\n').replace(/\/g, '\\'));
}
Basically, that creates a function (that is automatically linked to a Google Sheets trigger), and will run every time a cell is edited. It simply replaces all of the "\n" characters in your text with a line-break. Make sure that's a backslash, and not a normal slash. For programmers, the "\n" is a special character that represents a carriage return within a string. The only possible exception where an accidental line-break might happen would be when trying to input a Windows path into a cell such as "C:\Users\John\Documents\news". So double-backslashes is the common workaround for Windows paths among programmers. So one could enter "C:\Users\John\Documents\news" or even just simply "C:\Users\John\Documents\news" (since \n is really the only string we're replacing at this point).
It's also possible to change the replacement characters, in case anyone is more familiar with HTML:
function onEdit(e) {
e.range.setValue(e.value.replace(/ *<br *\/*> */ig, '\n'));
}
Since "<br>
" is much more deliberate (people don't accidentally type that in unless they want a line-break), it makes for a simpler replace function, since we don't have to do an escape for double-backslashes. But personally, typing in the angled brackets from an Android touchscreen keyboard are a bit inconvenient to do so twice for every line-break...
-Ted