我搜索了很多链接,但无法清楚地了解如何将 MySQL DB 导入或导出到 SQLite 数据库。
我需要从网络获取数据并将其显示到我的 Android 应用程序中。在此之前,我使用 Web 服务并以 JSON 格式获取数据并对其进行处理。
List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("xxxx", Menu_id)); params.add(new BasicNameValuePair("yyyy", Food_id)); JSONParser jParser = new JSONParser(); JSONObject jobject = jParser.makeHttpRequest(URL, "POST", params); success = jobject.getInt(TAG_SUCCESS); if (success == 1) { JSONArray jarray = new JSONArray(); jarray = jobject.getJSONArray("Dinner_Foods"); for (int i = 0; i < jarray.length(); i++) { final JSONObject jobj = jarray.getJSONObject(i); FoodItems item = new FoodItems(); item.setFoodIdentifier(jobj.getInt("id")); item.setFoodName(jobj.getString("title")); mFoodItems.add(item); } }
但是现在我将尝试将Mysql数据库文件导入到Sqlite数据库中,并对其进行处理。
对于该任务,我有 .sql,其表名称为“questions”,我需要将该表转换为 SQlite DB 并处理它。请帮我找到解决方案...
最佳答案
您可以使用此工具:http://sqlite2009pro.azurewebsites.net/
通过这个你可以将mysql数据导入到sqlite中。 欲了解更多信息:这里是相同的主题
关于mysql - 如何在android中将Mysql DB导入到SQlite中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33645867/