I want to convert this array of youtube URLs to a JSON Array to be saved in an android SQL database.
[https://www.youtube.com/watch?v=FnCdOQsX5kc, https://www.youtube.com/watch?v=xKJmEC5ieOk]
It might be extended with other attributes at a later point so I encode with this:
JSONObject mJsonObject = new JSONObject();
mJsonObject.put(MoviesDBJsonUtils.MDB_JSON_OBJ_KEY, new JSONArray(detailsCellEntry));
String urlArrayList = mJsonObject.toString();
It should now all be ready for saving into a SQL text field. But it gives me:
{"DB_JSON_OBJ_KEY":["https:\/\/www.youtube.com\/watch?v=FnCdOQsX5kc","https:\/\/www.youtube.com\/watch?v=xKJmEC5ieOk"]}
It's backslashing all the forward slashes. This is a pain in the butt. What's the best way of preventing this or remedying this?
I'm tempted to just scrap it and import another external library Gson, but bloating it up with libraries feels lazy.