Querying and working with Cursors in SQLite on Android

前端 未结 2 935
甜味超标
甜味超标 2020-12-12 16:02

Not sure if I\'m the only one who feels this...

I find working with the sqlite api in android a complete pain in the butt and pretty soul destroying. Has anyone got

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 16:26

    I tested a lot of my SQL in SQLite before copying them over to Android as strings. It's easier for me to debug when I can directly interact with the command line.

    Another technique I use is saving as much of my queries as possible as string constants or string resources.

    You also don't need SQL such as INTEGER NOT NULL since SQLite uses duck typing/manifest typing. It does help for type affinity though..

提交回复
热议问题