简体   繁体   English

我是否每次都有更改数据库编号的机会,即使我没有对要发布到Google Play商店的数据库结构进行任何更改

[英]do i have every time to change the database number even if i did not make any changes to my database structure to be published to google play store

I have published my android app in google play store it works fine and perfect(my app first will go and create a sqlite DB using SQLiteOpenHelper class then the index.html page will be displayed) then i noticed that users with android version 2.3.6 have error when they install the app i solved the problem without changing or adding to the structure of the DB then after publishing the new version of my app without changing the version of the database my app will not show the index.html and i think it will keep trying creating the database and the user will just see the loading message only. 我已经在google play商店中发布了我的android应用程序,它运行良好且完美(我的应用程序首先将使用SQLiteOpenHelper类创建一个sqlite数据库,然后将显示index.html页面),然后我注意到使用Android版本2.3.6的用户当他们安装应用程序时出现错误,我在不更改或不添加数据库结构的情况下解决了问题,然后在发布了新版本的应用程序而未更改数据库版本后,我的应用程序将不会显示index.html,我认为将继续尝试创建数据库,而用户仅会看到加载消息。 So do i have every time to change the database number even if i did not make any changes to my database structure to be published to google play store. 因此,即使我没有对要发布到Google Play商店的数据库结构进行任何更改,我也有时间更改数据库编号吗?

No, you only change the database version number to a higher version ONLY if you change the structure of the database or decide to automatically add data. 不可以,仅在更改数据库结构或决定自动添加数据时,才将数据库版本号更改为更高版本。

For example, you can start with version 1 with a database that contains only one table: let's call it User , and the table has a column called Username . 例如,您可以从版本1开始,其数据库仅包含一个表:让我们将其称为User ,并且该表有一个名为Username的列。 You run the query to create the table on your onCreate method. 您运行查询以在onCreate方法上创建表。 Then you release the app. 然后,您释放该应用程序。

Then you decide to add more features to the app, and implement a version of the app that did not require any database changes at all. 然后,您决定向该应用程序添加更多功能,并实现不需要任何数据库更改的应用程序版本。 Your db version stays 1. 您的数据库版本保持1。

Then on your next app version, you decide to add a column to the User table. 然后,在下一个应用程序版本上,您决定在“ User表中添加一列。 So what you do, is increment the db version to 2, and then run the alter table statement on your onUpgrade method. 因此,您要做的是将数据库版本增加到2,然后在onUpgrade方法上运行alter table语句。 Then you release the app. 然后,您释放该应用程序。

I believe your issue lies somewhere else. 我相信您的问题出在其他地方。 Check your database data integrity and that it fits your app's model. 检查数据库数据的完整性以及是否适合您的应用程序模型。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改已发布到Google Play商店的Android应用的ApplicationId,我该怎么办? - What do I have to do to change the ApplicationId of an Android App that's already published to the Google Play Store 如果我更新我的 Play 商店发布的 Android 应用程序进行*剧烈* 更改,Google 会取消它吗? - If I update my Play Store-published Android App with *drastic* changes, will Google take it down? 我在谷歌游戏商店发布了我的应用程序,但对于三星galaxy note5和nexus 6不可见 - I have published my app in google play store but is not visible for samsung galaxy note5 and nexus 6 如果我尚未在Google Play商店中发布任何应用程序,该如何在apps.admob.com中选择要获利的应用程序? - How can I select app for monetize in apps.admob.com if I dont have published any app on Google play store? Google Play 商店没有要求我创建上传密钥库.....我还需要创建一个吗? - Google Play Store did not ask me to create an upload keystore.....do I still have to create one? 我可以在Google Play上更改已发布应用的套餐名称 - May I change the package name of my published app on Google Play 我有一个已发布的应用程序,如果 APK 是通过 xender 或任何其他资源发送/安装的,是否在 google play 商店中计算在内? - I have one application which was published, if APK is send/installed via xender or any other resources, is it counted at google play store? 使用户在Google Play商店中看到我所有已发布的应用程序 - make user see all of my published application in google play store 每当我打开Goog​​le Play商店时,它突然开始崩溃 - Google Play Store suddently began crashing every time I open it 我在Google Play商店中发布了一个应用程序,我怎么知道上传了哪个APK? - I published an app to the google play store, How do I know which apk was uploaded?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM