sqlite

how do you deal with timezone issues? [duplicate]

限于喜欢 提交于 2020-01-12 15:16:28
问题 This question already has an answer here : How to store repeating dates keeping in mind Daylight Savings Time (1 answer) Closed 2 years ago . For a scheduling system, what's the best way to save the timezone of client/event in a central server database coming from multiple sources mobile,web,client app. How do you store the dates? Alarms, reminders etc... How do you handle the DST setting? How do you handle the events if client has traveled to a different location? I need the solution to work

SQLite and inserting the current date in UTC format

青春壹個敷衍的年華 提交于 2020-01-12 14:58:33
问题 How do I use an SQL statement on an sqllite database to insert the current date in UTC. I found the NOW function but what format is that in? This will be on mobile devices so everyone will have a different locale, however, I need a standard time format because the device will compare the dates with my server. Also, is there a way to automatically update a 'modified' field when the data in the row is changed like you can in MySQL? 回答1: SELECT DATETIME('now') returns the current UTC datetime.

SQLite and inserting the current date in UTC format

 ̄綄美尐妖づ 提交于 2020-01-12 14:58:27
问题 How do I use an SQL statement on an sqllite database to insert the current date in UTC. I found the NOW function but what format is that in? This will be on mobile devices so everyone will have a different locale, however, I need a standard time format because the device will compare the dates with my server. Also, is there a way to automatically update a 'modified' field when the data in the row is changed like you can in MySQL? 回答1: SELECT DATETIME('now') returns the current UTC datetime.

how to download the sqlite database of an android app?

倾然丶 夕夏残阳落幕 提交于 2020-01-12 10:23:39
问题 I am using a sqlite database in my android app. I want to download the database to pc. Can anyone kindly tell me what to do ? 回答1: if your app is in emulator you can just use the DDMS and open /data/data/your.package.name/databases . if you have your app in mobile. here is what i do to copy the db to the sdcard root folder. /** The name of the database file */ static final String DATABASE_NAME = "mydatabase.db"; static final String DATABASE_NAME_FULL = "/data/data/com.my.application/databases

how to download the sqlite database of an android app?

ⅰ亾dé卋堺 提交于 2020-01-12 10:22:23
问题 I am using a sqlite database in my android app. I want to download the database to pc. Can anyone kindly tell me what to do ? 回答1: if your app is in emulator you can just use the DDMS and open /data/data/your.package.name/databases . if you have your app in mobile. here is what i do to copy the db to the sdcard root folder. /** The name of the database file */ static final String DATABASE_NAME = "mydatabase.db"; static final String DATABASE_NAME_FULL = "/data/data/com.my.application/databases

Ignore accents SQLite3

泪湿孤枕 提交于 2020-01-12 10:17:31
问题 How do I make a SELECT with a LIKE clause ignoring accents on SQLite3? PS: It's for Android build-in SQLite support. 回答1: There has been a similar question here. They said it is not really possible on Android, but there is a workaround with an additional normalized column. 回答2: There is a solution, it is not elegant, but it works on Android. The function REPLACE can replace the accented character by the normal character. Example: SELECT YOUR_COLUMN FROM YOUR_TABLE WHERE replace(replace

What's the correct way to ship static (read-only) data in Core Data persistent store?

大憨熊 提交于 2020-01-12 10:10:08
问题 I want to ship static read-only data for use in my Core Data model. The problem is that there are obviously different persistent store types and I don't know if the format of those types is supposed to be opaque or if I'm supposed to be able to construct them by hand. Right now I just have a plist and it's very small (maybe 30 entries total). Should I just write code to import the plist into my data store when the app is first installed, or is there some way I can ship a hand-constructed

Sending Sqlite database as email attachment in Android

房东的猫 提交于 2020-01-12 09:56:34
问题 I have a simple app which I am using to spike sending attachments. I have managed to send a text file from the SD card (although I couldn't get this to work with a file created in the apps private area using openFileOutput(fileName, 0) ) but I now want to send a database. By debugging I can verify the database exists and has an entry in its only table. My code to send looks like this: gmailButton = (Button) findViewById(R.id.button); gmailButton.setOnClickListener(new OnClickListener() {

Sending Sqlite database as email attachment in Android

a 夏天 提交于 2020-01-12 09:55:56
问题 I have a simple app which I am using to spike sending attachments. I have managed to send a text file from the SD card (although I couldn't get this to work with a file created in the apps private area using openFileOutput(fileName, 0) ) but I now want to send a database. By debugging I can verify the database exists and has an entry in its only table. My code to send looks like this: gmailButton = (Button) findViewById(R.id.button); gmailButton.setOnClickListener(new OnClickListener() {

Sending Sqlite database as email attachment in Android

走远了吗. 提交于 2020-01-12 09:55:54
问题 I have a simple app which I am using to spike sending attachments. I have managed to send a text file from the SD card (although I couldn't get this to work with a file created in the apps private area using openFileOutput(fileName, 0) ) but I now want to send a database. By debugging I can verify the database exists and has an entry in its only table. My code to send looks like this: gmailButton = (Button) findViewById(R.id.button); gmailButton.setOnClickListener(new OnClickListener() {