Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
カーソルを使用して、結果を文字列形式で返す SQLite からデータを取得しています。カーソルを使用して JSON 形式で出力を取得する方法はありますか?
a の内容を にcursor直接変換することはできJSONObjectませんが、何らかのロジックで変換できます。
cursor
JSONObject
例: から を取得しStrings、フォーマットに従うcursorフォーム aを使用し、それを使用して json オブジェクトを作成します。StringJSON
Strings
String
JSON
JSONObject jFromCursor=new JSONObject(string_in_JSON_format);