New Line character (enter) inside of SQLite DB displays on Simulator not on Android device

I have about 25 - 35 records compiled into single records in a sqlite database with each separated by 2 new line characters (enter key).  The simulator on my Mac shows the data correctly spaced, however on my pc and on the device, it’s like the new line characters are not recognized.  I am using the 2 new line characters to keep the text from overlapping the lines below it when the text wraps.

Does anyone know how to keep the spacing consistent between records?

Newline characters may be different on different platforms console/terminal. I noticed this when using print statements, as well.

I would question why you are aggregating SQL table rows into single rows. The very nature of relational databases allows you to completely avoid this. Simply doing that will cause your data to be harder to work with.

The way we had it to begin with did not work the way we wanted.  We wanted to show a number and a comment for each record.  The comment would often wrap to the next line, sometimes as much as 4 lines.  This depends on the size of the text and the device.  The text from 1st line would overlap the text the from the 2nd and so on…  I have not found a way to insert the the Y coordinate of each line based on the end of the previous record.

I think there is quite a lot about your application which is missing from your description.

There should be no problem at all in storing lines of text in a SQLite DB in Corona and showing each one separately. If you were to retrieve each row of text in order, create a newText object with width but not height values, you could then display each text object below the previous one by calculating it’s .y position using it’s .height value.

Let me know if you’d like some sample code and I’ll try to write some.

Yes, please.  The help would greatly appreciated.

This same does not use SQLite, but it does operate on a table of strings. So, load your strings from the DB into a table and loop over them to display them as necessary:

https://dl.dropboxusercontent.com/u/10254959/Help/TextDisplayDemo/main.lua

Thanks!  I’m looking at it right now.

Newline characters may be different on different platforms console/terminal. I noticed this when using print statements, as well.

I would question why you are aggregating SQL table rows into single rows. The very nature of relational databases allows you to completely avoid this. Simply doing that will cause your data to be harder to work with.

The way we had it to begin with did not work the way we wanted.  We wanted to show a number and a comment for each record.  The comment would often wrap to the next line, sometimes as much as 4 lines.  This depends on the size of the text and the device.  The text from 1st line would overlap the text the from the 2nd and so on…  I have not found a way to insert the the Y coordinate of each line based on the end of the previous record.

I think there is quite a lot about your application which is missing from your description.

There should be no problem at all in storing lines of text in a SQLite DB in Corona and showing each one separately. If you were to retrieve each row of text in order, create a newText object with width but not height values, you could then display each text object below the previous one by calculating it’s .y position using it’s .height value.

Let me know if you’d like some sample code and I’ll try to write some.

Yes, please.  The help would greatly appreciated.

This same does not use SQLite, but it does operate on a table of strings. So, load your strings from the DB into a table and loop over them to display them as necessary:

https://dl.dropboxusercontent.com/u/10254959/Help/TextDisplayDemo/main.lua

Thanks!  I’m looking at it right now.