[英]What kind of data storage should i use on my android app?
I am making an android app that calculates somne routes between different places in a town and returns to the user several ways to get there (by some buses, walking etc). 我正在制作一个Android应用程序,该程序可计算城镇中不同地点之间的深层路线,并向用户返回几种到达那里的方式(通过公交,步行等方式)。 For that, i need to store some coordinates, places names, buses so that this data can be accessed and used in the program, but cannot be modify or seen by the user.
为此,我需要存储一些坐标,地名,公共汽车,以便可以在程序中访问和使用此数据,但用户无法对其进行修改或查看。 And i want somenthing that is easy to manipulate, because i'm new on this.
我想要一些易于操作的东西,因为我对此很陌生。 What kind of storage should i use?
我应该使用哪种存储方式?
There are 4 Storages options 1.SQLite 2.External Storage 3.Internal Storage 4.Shared Preferences 有4个存储选项1.SQLite 2.外部存储3.内部存储4.共享首选项
the link will show you examples and storage options supported by Android.. my Suggestion is Shared Pref its the most easy one. 该链接将向您显示Android支持的示例和存储选项。我的建议是Shared Pref,这是最简单的建议。
just remember when the user clear Cache all of the Storage Options will be deleted. 只需记住,当用户清除“缓存”时,所有“存储选项”将被删除。
You can get the route between any two places in XML or JSON format(recommended). 您可以采用XML或JSON格式(推荐)获取任意两个地方之间的路线。
From JSON Object you can get 'legs' array which containts information about waypoints between two places. 从JSON Object中,您可以获取“ legs”数组,其中包含有关两个地方之间的航路点的信息。
Details for Different traveling modes can also be fetched by specifying 'mode' attribute. 也可以通过指定“ mode”属性来获取不同行驶模式的详细信息。
you can use sharedpreference's to save the above details and can be used later 您可以使用sharedpreference保存上面的详细信息,以后可以使用
For more details see this documentation 有关更多详细信息,请参阅此文档
Here is a good tutorial which may be useful for you 这是一个很好的教程,可能对您有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.