Android :: Database Version Is Zero On Initial Install
Jun 6, 2010
I have released an app (World Time) with initial database. Now i want to update the app with a database upgrade.I have put in the upgrade code in OnUpgrade() and checking for the newVersion. But it was not being called in my local testing.So i put in the debug statement to get the database version and it is zero.Any idea why it is not being versioned ?
I am getting an error from Logcat saying that a certain column (in my SQLiteOpenHelper subclass) does not exist. I thought I could upgrade the database by changing the DATABASE_CREATE string. But apparently not, so how can I (step-by-step) upgrade my SQLite Database from version 1 to version 2? I apologize if the question seems "noobish", but I am still learning about Android. @Pentium10 This is what I do in onUpgrade:
In some books and online I see these method calls being made after a database is created:
Why is this done? As far as I can tell, after creating a new database, the system adds a table named android_metadata with one field named locale and that table has one row with the locale field set to "en_US". Now I assume the column has that value because I am using a U.S. phone, and if I were using a phone from a different region then the locale field would be set appropriately. Can anyone confirm this? I'm guessing that the setLocale method would only be useful in the case that you install a pre-built database onto a phone and then want to change the locale to match the phone's locale. Sound right?
The documentation for setLockingEnabled says it defaults to true so there's no need to make that call, right?
Lastly, what's with the call to setVersion? I can't find a table that contains this information so I've been assuming that the database file itself stores the version number somewhere. So when I create a database, which requires you to have already specified the version number in the call to the SQLiteOpenHelper constructor, there's no point in calling setVersion. Again, perhaps this method exists for the case of installing a pre-built database to a device and you then wish to change the database's version (though I can't think of when doing this would make sense).
I have an application for which I am planning to release both a free and a paid version. I found that this will require the two versions of the application to each have different package names.
When a user upgrades from the free version to the paid version, the paid version needs to be able to access the database built by the free version. I am trying to understand the best way to make sure that upgrade does not disrupt the user's data.
I have read that the AndroidManifest file setting for shared user id should allow both applications to access the same data. I don't need the applications to both be running simultaneously, as I expect the user will uninstall the free version after upgrading to the paid version. However I need to make sure that if possible the user's data is not lost and is still accessible and usable by the paid version of the application.
I have read about a problem with the shared user id where uninstalling one application will cause the other shared application to stop working because its permissions get deleted, (see details at http://code.google.com/p/android/issues/detail?id=2773 ) Apparently this issue is fixed in doughnut, but since all the currently deployed android phones do not have doughnut yet, this still seems like a significant problem.
In addition to the database information, I would also like to preserve the user's default shared preferences settings after the upgrade. However the default shared preference settings are not as critical as the data in the database.
I am storing a pre-created database file and an xml file in my dropbox ( for storage ) I would like to be able to read the xml file and if the version is different download the new database file and replace it on the sd card.
My old development process allowed me to make any change in the java code and use eclipse's Run button to install the updated package to the emulator.
Now I get [2009-12-15 11:51:55 - Scoopful]Application already deployed. No need to reinstall. even though the code has changed.
I realize the manifest version Code is used to determine if the app has changed and it works fine if I bump up that number. This did not used to be necessary and it slows down development when I have to enter AndroidManifest and make a change with every deploy to the emulator. Is there a way around this?
What implications does upgrading an app have on stored data i.e. Preferences and database? Does the system perform a clean install of the new version(i.e. remove the older version and then install the new) or something else? What if the user wants to retain the stored data- say values in the shared preference or a sqlite database? How can I emulate this app-update-install scenario? If I have a version 'x' installed on my emulator and I do a adb install of version 'x+1' I am getting INSTALL_FAILED_ALREADY_EXIST error. Should I try hosting the new apk on a Web server, will the Package Manager take this as an update and do the needful?
My boss recently gave me an HTC Wildfire phone for doing an Android version of one of our mobile apps, which is all fine and good, except that the app requires API level 8 (ie Android 2.2), and the phone itself only has Android 2.1 installed. After much googling, I discovered that this phone does support Android 2.2, and carriers will be rolling out updates over the air for this model phone "in the near future". Since I'm not entirely certain what our lazy carrier's definition of "near future" is, it would be nice if I could download images for particular releases and install them on my phone. Coming from the world of the iPhone, it seems that this should be something rather necessary in order to successfully develop an Android app. Yet, it doesn't seem that Google offers any Android OS updates themselves. Have I no choice but to wait for the carrier to release an update?
Is it possible to wipe the X10 and clean install the latest version of Android on it? Will it work properly and recognise all the X10's hardware functionality? I suppose the camera app and options will be lost... not sure if there r camera apps to cover this.
So a question for anyone using touchdown. Does it matter which version you install? I see "Exchange for Android 2.0/2.1" and "Exchange by Touchdown". I would assume I should use the former, but there seem to be more 2.1/2.2 users on the latter.
The OTA downloaded but failed to install on my X running rooted 2.1 and nextheme. No apps deleted or other mods of any kind. I removed the theme and decided to go with the leaked version rather than deal with new restrictions on the OTA. I tried installing the stock 2.2 version in rom manager and it failed. I wiped the phone and rerooted and installed bootstrap and rom manager then tried again and it failed. Can someone point me in the right direction please?
I am a PHP developer , like to wet my Feet in Android App Development. So I plan to install SDK and related stuffs(eclipse,ADT) etc in my windows 7 P.C . But I cannot find a solution to How to Install ADT in Ganymede 3.1. My Problem is I cannot find the first step i.e
Start Eclipse, then select Help > Install New Software....
there is no option Install New Software.. It will be a gr8 thing of Satisfaction to you Sure and a Gr8 Favour for me. .... So may I go to Eclipse other versions like Helios or Galielios
Okay so back when .6 hit the air, there were a few links to download the zip version.
I downloaded it, thinking I could manually install it just like I did ver .3, but no one mentioned doing that, and given HTC's tweet I am assuming I shouldn't do this.. But am I right about that? Why couldn't we manually install the correct version from the zip just like .3?
Just like the title says, I'm at the laundrymat on my phone so I didn't have the option to search the forums. I wiped the data, and did a back up. But I would like to use chevys kernel vs a p3, just my preference.
I was trying deodexing manually and ran into big problems, now in bootloop. I want to just custom recovery restore to the deodexed ROM here (Droid X 2.2 Froyo Deodexed and Ready For Themes) but cannot because I get the following error every time I try to restore a backup from custom recovery: "e:Can't mount /dev/block/mmcblk0 device or resource busy.I think I found out that it is because this Koush recovery is the original 2.1 version, so I need the 2.2 one.Two things:-Where do I get this 2.2 newer version? His site doesn't mention it but maybe he just replaced the file download without mentioning? http://www.koushikdutta. com/2010/08/droid-x-recovery.html)-How can I install this newer recovery if I am stuck in bootloop?
I searched the groups to find a topic about setting horizontal scroll view's offset, but no results. Some topics talked about ScrollView, and they are not expected. Here is my question: I have a HorizontalScrollView, with LinearLayout as its child, the LinearLayout contains a custom view, I finished the onDraw method of the custom view to draw something which is longer than the screen's horizontal size, so I think HorizontalScrollView is the right widget that I need. But I do not want to display the left-most part of my custom view, such as a calendar, I can display the last week and next week in the custom view, but what I want to put in the center of the scroll view is today. So, I wonder how I should set the initial offset of the HorizontalScrollView?
I need to set initial transparency for a TextView but I don't know how to do it. On iPhone it can be done easily with alpha property. I've tried to set alpha using AlphaAnimation but no good it doesn't work. It just returns to 100% alpha when it ends.
I use Contacts GroupU to allow me to send a group email, but I notice that changes I make on the desktop to the groups don't show up on the app. Is there a way to sync the two together after the initial setup?
I am trying to get the WebView to have similar behavior as the android browser. The browser opens all pages in a way that tries to fit their width to the screen. However, the default behavior of the WebView is to start at a 100% pixel scale so it starts zoomed in on the top left corner.
I have spent the last couple hours trying to find a way to get the WebView to scale the page to the screen like it does in the browser but I'm not having any luck. Has anyone found a way to accomplish this?
I see is a setting called setLoadWithOverviewMode, but that didn't appear to do anything at all. I also experimented with setInitialScale but on different screen sizes and web page sizes that won't be as graceful as the browsers scaling.