更新Play商店中的应用 [英] Updating an application in Playstore

查看:227
本文介绍了更新Play商店中的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的android开发,我开发了具有存储在SQLite数据库的表单(姓名,地址)的应用程序,这是第一个版本。在第二个版本我添加电子邮件域。我想问一下我是如何使更新的时候我做了一个upgrad到第二个版本存储在第一个版本中的数据不被破坏。

I'm new to android development, I developed an application that has a form (name, address) stored in a SQLite database, that's for the first version. In the second version I add an email field. I would like to ask how I did to make the update for the data stored on the first version are not destroyed when I made an upgrad to the second version.

感谢您!

推荐答案

如果您使用的是提供SQLHelper类,更新版本,在功能的onUpdate执行ALTER TABLE SQL命令来添加电子邮件域。你必须使它成为一个可空场,因为现有的行不会拥有它。然后,如果你拥有了它,发送更新命令将电子邮件添加到行。

If you're using the SQLHelper class, update the version, and in the onUpdate function perform an ALTER TABLE sql command to add the email field. You'll have to make it a nullable field, as the existing rows won't have it. Then, if you have it, send UPDATE commands to add the emails to the rows.

这篇关于更新Play商店中的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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