本地或在线存储大量数据,Android应用程序? [英] Storing large data locally or online for Android app?

查看:118
本文介绍了本地或在线存储大量数据,Android应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次发帖,并第一次工作在Android,这样下去容易,如果我违反任何规则:)

First time posting and first time working on Android, so go easy if I am breaking any rules :)

不管怎么说,我刚刚进入制作一个Android应用程序,我想创建一个简单的问答游戏。我计划有许多问题(希望有关5000+的问题)进行。没有数据操作时,只要直上阅读的问题和presenting给用户。我现在面临着如何存储问题的两难困境。

Anyways, I just got into making an Android app and I'm trying to create a simple trivia game. I plan to have many questions (hopefully about 5000+ questions) made. No data manipulation made, just straight up reading the questions and presenting it to the user. I am now faced with the dilema in how to store the questions.

我有两个选择:

1)捆绑的应用程序的问题:可能存储在SQLite的信息。最初,用于演示目的,我放置在一个XML文件中的问题,但我很快就意识到多么的低效将是,一旦问题开始打桩。首先,我很担心,如果开放这样一个巨大的XML文件将吸取Android的内存。其次,我担心有多大的应用程序是,如果它包含5000多个问题。我read这里关于XML的VS SQLite的利弊。在这个例子中,用户7万名条目,这样也许我的5000的问题就足够了?

1.) Bundle the questions with the app: Possibly store the information in SQLite. Originally, for demo purposes, I placed the questions in an XML file, but I quickly realized how inefficient it will be once the questions start piling up. First, I am concerned if opening up such a huge XML file would suck up Android's memory. Secondly, I am worried how large the app would be if it contains 5000+ questions. I read here about the pros of XML vs SQLite. In that example, the user has 70,000 entries so maybe my 5,000 questions would be enough?

2)的主机服务器上的问题:我认为好处是应用程序不需要用的问题进行大量的捆绑,也不会需要担心的逻辑的打开和装配问题。这将只是打一个PHP页面,并根据发送的参数,PHP页面将返回XML格式的问题。其缺点是,用户将需要在线(检索问题),为了玩游戏,我的服务器将需要启动和运行24/7。

2.) Host the questions on a server: I believe the upside is the app wouldn't need to be bundled with a vast amount of questions and wouldn't need to worry about the logic of opening and assembling the questions. It would just hit a PHP page and depending on the parameters sent, the PHP page would return the questions in XML format. The downside is the user would need to be online (to retrieve the questions) in order to play the game and my server would need to be up and running 24/7.

有没有人遇到过的如何以及在何处存储在一个Android应用程序的数据大量这样的设计问题?

Has anyone encountered this design issue of how and where to store vast amount of data in an Android app?

谢谢,任何帮助将是非常美联社preciated!

Thanks, any help would be much appreciated!

推荐答案

从营销的角度来看,我认为正确的做法是#1。只看顶部的应用程序名单,这是充满了脱机工作的应用程序。我不知道为什么大多数人没有提到这一个重要的标准,当他们谈到营销的应用程序......尤其是在Android的,其中许多人没有一个数据计划。另外,琐事的应用程序听起来象是有人在火车上下班途中,而不是像Facebook的聊天,他们会使用时,他们可能在网上使用。

From a marketing perspective, I think the right approach is #1. Just looking at the top app list, it's filled with apps that work offline. I don't know why most people fail to mention this one important criteria when they talk about marketing apps... especially in Android, where lots of people don't have a data plan. Plus, a trivia app sounds like something someone would probably use during a commute in a train as opposed to something like Facebook Chat that they'd use when they're online.

从技术角度来看,存储5000+问题真的不会花大量的空间。有这个程序叫做MyFitnessPal。它存储可能超过30,000食物SQLite数据库,具有营养信息。所以,不要过高估计需要多少空间需要。

From a technical perspective, storing 5000+ questions really won't take a huge amount of space. There's this app called "MyFitnessPal". It stores maybe over 30,000 foods in a SQlite database, with nutritional information. So don't overestimate how much space it will take.

与#2去的好处是,如果问题或答案经常变化,你可能会想要去的方法。

The advantage of going with #2 is if the questions or answers change often, you might want to go with that approach.

这篇关于本地或在线存储大量数据,Android应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆