Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 30
Registered: ‎03-30-2012
My Device: BlackBerry Bold 9000
My Carrier: airtel

Query on BlackBerry App Updates Distribution

Hi,

 

I am a noob at BlackBerry and about to publish my first BlackBerry app. However, not very clear how I would distribute updates.

 

Searched the KB and forums and what I could gather is that the App can be updated by reinstalling the newer .Cod modules on top of the old ones.

 

However, this seems to conflict with our approach to clean up when App is uninstalled. We have registered a Code module listener to delete database and clear preferences when code module deletion is pending or deleted.

 

This causes an unwanted side effect that when app is reinstalled on device, the DB and preferences are cleaned up. Request the experts to let us know the best practices around publishing updates to app and clean uninstall.

 

cmListener = new CodeModuleListener() 
			{

				private void cleanup()
				{
					SQLiteDriver.instance().closeDB();
					deleteFile(SQLiteDriver.instance().dbLocationPhoneMemory);
					deleteFile(SQLiteDriver.instance().dbLocationHomeUser);
					deleteFile(SQLiteDriver.instance().dbLocationSDCard);
				}

				public void modulesDeleted(String[] moduleNames) 
				{
					for(int i=0;i<moduleNames.length;i++)
					{
						Logger.log("APP Deleted:" + moduleNames[i]);
						if (moduleNames[i].equalsIgnoreCase("XYZ"))
						{
							//Clean up all possible places where DB could exist
							cleanup();
							XYZ.getInstance().getPreferences().cleanPreferences();
						}
					}



				}

				public void modulesAdded(int[] handles) 
				{
					String s = "APP ADDED ====================>";
					Logger.log(s);

					//Clean up all possible places where DB could exist
					//cleanup();

				}

				public void moduleDeletionsPending(String[] moduleNames) 
				{

					for(int i=0;i<moduleNames.length;i++)
					{
						Logger.log("APP Deleting:" + moduleNames[i]);
						if (moduleNames[i].equalsIgnoreCase("XYZ"))
						{
							//Clean up all possible places where DB could exist
							cleanup();
							XYZ.getInstance().getPreferences().cleanPreferences();
						}
					}

				}
			};

			CodeModuleManager.addListener(UiApplication.getApplication(), cmListener);

 

 

 

 

 

 

Contributor
Posts: 30
Registered: ‎03-30-2012
My Device: BlackBerry Bold 9000
My Carrier: airtel

Re: Query on BlackBerry App Updates Distribution

Experts please help...

 

Is this the right forum to ask this question?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Query on BlackBerry App Updates Distribution

Yes it is the right forum.

 

I think the problem here is that we don't know the answer,  I certainly don't.  My apps leave behind data on the SD Card.....

Contributor
Posts: 30
Registered: ‎03-30-2012
My Device: BlackBerry Bold 9000
My Carrier: airtel

Re: Query on BlackBerry App Updates Distribution

Thanks Peter_Strange,

 

As long as that is not a case for rejection from BlackBerry App World, I guess I will accept that as a solution.