我正在做一個應用程序,將要求用戶的教師,部門和成績,然後顯示主題列表。什麼是最合適的方式來保存在android的數據
問題是保存主題的最佳方式是什麼,它可以很容易地檢索並顯示給用戶。
我試過XML,但它不起作用,現在我試過JSON,但不知道它是否是存儲這種數據的最佳方式?
答:
,因爲所有的人說,最好的辦法就是保存SQLite數據庫中的數據。
這裏是我的JSON的卡扣
{
"faculty_engineering": {
"name": "Engineering",
"department_prep": {
"name": "prep",
"grade_1": {
"term_1": {
"subjects": [
"Math",
"physics",
"English",
"Realisation",
"subject"
]
},
"term_2": {
"subjects": [
"chemistry",
"Math",
"fekh",
"Geometry",
"Entag",
"Mechanics"
]
}
}
},
"department_systems_and_computer_engineering": {
"name": "Systems and computer engineering",
"grade_1": {
"term_1": {
"subjects": [
"Programming",
"Electronics",
"Math",
"Circuits",
"Measure",
"English"
]
},
"term_2": {
"subjects": [
"Algorithms",
"Electronics",
"Math",
"Fields",
"Religious subject"
]
}
},
"grade_2": {
"term_1": {
"subjects": [
"Math",
"Integrated circuits",
"Systems and signals",
"machines VHDL",
"Numerical Analysis",
"Object-oriented programming",
"Tests",
"Realisation subject"
]
},
"term_2": {
"subjects": [
"Math",
"Logical circuits",
"Automatic Control",
"Electric machines",
"Religious subjects",
"Realisation subject"
]
}
},
"grade_3": {
"term_1": {
"subjects": [
"Math",
"Communications systems",
"Electronics",
"Religious subjects",
"Operating system",
"Digital Control",
"Tests ",
"Transition systems and mechanisms ",
"Power electric systems ",
"Realisation subject"
]
},
"term_2": {
"subjects": [
"Databases",
"Microprocessors",
"Administration and engineering projects",
"Sensors of adapters",
"Religious subjects",
"Realisation subject"
]
}
},
"grade_4": {
"term_1": {
"subjects": [
"Special computer subject",
"Tests",
"Engineering programming",
"Intelligent Systems",
"Computer architecture",
"Interpreters",
"Advanced software",
"Realisation subject"
]
},
"term_2": {
"subjects": [
"Algorithms",
"Advanced software",
"Computer architecture",
"Interpreters",
"Realisation subject"
]
}
}
},
"department_": {
"name": "",
"grade_1": {
"term_1": {
"subjects": [
]
},
"term_2": {
"subjects": [
]
}
},
"grade_2": {
"term_1": {
"subjects": [
]
},
"term_2": {
"subjects": [
]
}
},
"grade_3": {
"term_1": {
"subjects": [
]
},
"term_2": {
"subjects": [
]
}
},
"grade_4": {
"term_1": {
"subjects": [
]
},
"term_2": {
"subjects": [
]
}
}
}
}
}
我會將它們保存在數據庫中。 – BackSlash
只是使用SQLite – CantThinkOfAnything
如果你需要一個教程:http://www.vogella.com/tutorials/AndroidSQLite/article.html – CantThinkOfAnything