'Can I access any records in SQLite database without using the cursor?

I've tried by searching for lots of examples in order to understand how SQLite database in Android Studio. I recently started by reading the basic manuals since no simple usable examples can be found using the latest AS. My question is as what the title says : Is there any possibility of accessing any records in SQLite database without using the cursor? Would an ignorant person be able to accomplish this? If yes, can you show an actual usable example?



Solution 1:[1]

Is there any possibility of accessing any records in SQLite database without using the cursor?

Yes

  1. You can use Room and for even relatively complex access Room will get the records (it transparently undertakes all the Cursor processing but still uses Cursors)

  2. You could, for example, use C++/NDK and use the SQLite C/C++ interface https://sqlite.org/capi3ref.html

  • BUT if a person is having issues with Cursors, then I would suggest that it would be more beneficial to understand what those issues are rather than to try to circumvent the issues by trying to not use them.

Would an ignorant person be able to accomplish this?

That is not really answerable as it depends upon the context, especially the level of ignorance.

  • However, considering the context of the question, i.e. Cursor issues, then I would suggest that the prudent question would be in regard to understanding the issue with using Cursors.

If yes, can you show an actual usable example?

Assuming that Yes to the first question then:-

There are plenty of examples e.g. a search on C++ sqlite on android would show examples as would a search on android NDK sqlite

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MikeT