Posts

Showing posts from May, 2012

Sending date and time information from Android to MySQL

Dates always seem to trip me up. The app that I am currently working on needs to send records from Android to a MySQL back end. The records contain date and time information. The records initially go into a SQLite db on the phone. From there they are read and sent to the back end one at a time and cancelled off the list when sending has been successful. So the problem comes down to putting a date and time into sqlite. Taking that date and time out and sending it across the network to be inserted into MySQL. Here is a synopsis of what I did to get this to work: Create a table on sqlite (column types are largely irrelevant here, so just leave them out). Create a table on mysql (the target) and specify a column type of timestamp for the date and time info. Create a java.util.Date object to get the current time. Using a SimpleDateFormatter format this for insertion into the sqlite db. Next read this row back. Send this value across the network. At the Mysql end use a prepared stateme

CTRL-C does not work on updated Cygwin

I updated my cygwin (specifically my bash shell) to a 4.something version. CTRL-C did not work anymore. This was a pain as I kept having to kill the cygwin window with the close window x. Was not able to effectively use history and stuff. I 'updated' by cygwin by installing setup.exe again. I filtered the install down to bash so I could find the shell and then clicked on it a few times until is showed version 3.something. This now supports ctrl-c and has retained all my nice history stuff from before. The font is a bit small, but I am sure I can remedy that. Less important than ctrl-c to me.