【发布时间】:2016-09-07 10:46:19
【问题描述】:
我有一个问题,因为我不知道该怎么做。我的项目展示了篮球技巧。它有这样的层次组合:主要类别,练习ListView,下一个是细节。
现在我需要为这个 Json 创建一个 sqlite 数据库。我需要为下面的 Json 创建 2 个表还是只使用一个就足够了?另外,有谁知道在哪里可以找到我的问题的类似示例?
{
"Basketball":[
{
"ids":1,
"category":"Shooting",
"catThumb":"http://cbssports.com/images/visual/whatshot/USATSI_8176966.jpg",
"exercises":[
{
"id":1,
"name":"Shooting drills",
"thumb":
"http://app.akharinkhabar.ir/AndroidOnlineNewsImage.aspx?id=7531955",
"description":"good clips of Steph Curry's real summer workout..",
"video":"GkcHK11xpLs",
"body":"good clips of Steph Curry's real summer workout.."
},
{
"id":2,
"name":"Shooting drills 2",
"thumb":
"https://kycapitalliving.files.wordpress.com/2014/02/basketball-thumbnail.jpg",
"description":
"Today I wanted to go over my favorite three point basketball shooting drills.",
"video":"iPNHkpO-vkw",
"body":
"Today I wanted to go over my favorite three point basketball shooting drills."
},
{
"id":3,
"name":"Shooting drills 3",
"thumb":
"http://newsletter.newington.nsw.edu.au/wyvern/files/2013/09/basketball-thumbnail.jpg",
"description":
"If every basketball player worked as hard as me. I would get out of my job.",
"video":"UyYzhpgi2TA",
"body":
"If every basketball player worked as hard as me. I would get out of my job."
}
]
},
{
"ids":2,
"category":"Ball Handling",
"catThumb":
"https://s-media-cache-ak0.pinimg.com/736x/dd/56/43/dd56432838af2a583a6c22525bf5a18e.jpg",
"exercises":[
{
"id":1,
"name":"Shooting drills",
"thumb":
"http://app.akharinkhabar.ir/AndroidOnlineNewsImage.aspx?id=7531955",
"description":
"good clips of Steph Curry's real summer workout.. ball handling using ropes, floaters,resistance bands, 2 balls drills, vertimax",
"video":"MPIuB0rRgsM",
"body":
"good clips of Steph Curry's real summer workout.. ball handling using ropes, floaters,resistance bands, 2 balls drills, vertimax"
}
]
}
]
}
【问题讨论】:
-
最好的方法是将其作为字符串存储在表中,获取并使用 GSon 库将其转换为 json,以便在需要时使用。
-
@Sanoop 不要使用
inline code来突出显示随机术语。