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
Developer
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810
My Carrier: WiFi
Accepted Solution

BBM SDK app - phone support?

I'm a little bit confused about the new BBM SDK support. Bold 9900 with OS 7.0 will support such apps for sure, since BBM 6.0 will be preloaded.

 

But what about phones with OS6.0 and OS5.0? As per my understanding BBM 6.0 could run on both OS5.0 and OS6.0.

How could I detect from my app that BBM 6.0 is installed on device?

 

I have tried to run BBM SDK app on Torch with BBM 5.0 but got an exception "module net_rim_bb_qm_platform not found", I've built my app with JDE 6.0. Do I have to upload that module with my app?

 

Any thoughts or ideas will be much appreciated



"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry
Developer
Posts: 246
Registered: ‎09-30-2010
My Device: Z10, Onyx2
My Carrier: IND XL

Re: BBM SDK app - phone support?

i think u need bbm6 to make it work. the api was for os5 and os6 but still needed for bbm6 to run the app

 

Developer
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810
My Carrier: WiFi

Re: BBM SDK app - phone support?

Yes, I'm aware that BBM SDK app will run only on phone with BBM 6.0

 

The question is - how can I detect if BBM 6.0 is installed on a phone? I can check BBM module version of course, but is there any other way to do this?

 

I'll explain my issue in details. I have an app that runs for OS5.0 and above. And I want to integrate the BBM SDK into that app, to make it more social Smiley Happy So BBM integrated app will run just fine on phones with OS7.0 (BBM 6.0 is preloaded), but will fail on OS6.0 phone (Torch for example) if BBM 6.0 is not installed.

 

With all this said it seems that I have only one option - to release the new version only for OS7.0.



"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry
Developer
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810
My Carrier: WiFi

Re: BBM SDK app - phone support?

So after some brainstorming and beerdrinking I came to conclusion to do this:

- I will release a version for OS7 only

- Versions for OS5.0 and OS6.0 will remain the same except one check - if the phone has BBM6.0 installed, the user will receive a message that upgraded version is avaliable and a link for download (from my own server).

    public boolean hasBBM6()
    {
        int moduleHandle = CodeModuleManager.getModuleHandle("net_rim_bb_qm_platform");        
        return (moduleHandle != 0);
    }

 

It sounds a bit complicated but I think it will work



"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry
Highlighted
Developer
Posts: 141
Registered: ‎02-10-2010
My Device: 9500
My Carrier: Airtel

Re: BBM SDK app - phone support?

You may consider to programmatically download and install the BBM6.0 module using the

http://supportforums.blackberry.com/t5/Java-Development/Programmatically-install-and-upgrade-applica...

 

Sample code:

 

//Installs the cod files
private boolean doInstall(ApplicationInformation appInfo)
{
                int numOfCods = 0;
		int moduleHandles[] = null;
			
		try
		{
			//Download the application descriptor that lists the cod files to install.
			String codList = new String(downloadFile(appInfo.getDescriptorURL()));
				
			if (codList != null)
			{
					
				//Obtain a list of cod files.
				String[] codNames = split(codList, "\r\n");
					
				numOfCods = codNames.length;
				moduleHandles = new int[numOfCods];
					
				//Create a CodeModuleGroup for this application.
				CodeModuleGroup cmGroup = new CodeModuleGroup(appInfo.getModuleGroupName());
					cmGroup.setFriendlyName(appInfo.getModuleGroupFriendlyName());
					cmGroup.setVersion(appInfo.getVersion());	
					cmGroup.setVendor(appInfo.getVendor());
					
				//Download and save all of the cod files.
				for(int count = 0; count < numOfCods; ++count)
				{
					byte[] codData = downloadFile(codNames[count]);
						
					if (codData != null)
					{
						//Create the new cod file.
							moduleHandles[count] = CodeModuleManager.createNewModule(codData.length, codData, codData.length);
					
						//Save the module
						int result = CodeModuleManager.saveNewModule(moduleHandles[count], true);
							
						//Ensure that the cod file was saved.
						if (result != CodeModuleManager.CMM_OK && result != CodeModuleManager.CMM_OK_MODULE_OVERWRITTEN)
						{
							//The cod file was not saved.
							throw new Exception("Failed to save cod.");
						}
							
						//Add the CodeModule to the CodeModuleGroup.
							cmGroup.addModule(CodeModuleManager.getModuleName(moduleHandles[count]));						
					}
					else
					{
						throw new Exception("Failed to download cod " + count);
						}						
							
				}
					
				//Save the CodeModuleGroup.
				if(!cmGroup.store())
				{
					throw new Exception("Failed to save CodeModuleGroup.");
				}
	
				//The application was installed.
					return true;
			}
			else
			{
				log("Failed to download application descriptor: " + appInfo.getDescriptorURL());
					
				return false;
			}
		}
		catch (Exception ex)
		{
			log("Exception during install of " + appInfo.getModuleGroupFriendlyName() + " " + ex.toString());
				
			//Delete order is not important so loop in reverse order, which is more efficient.
			for(int count = numOfCods - 1; count >= 0; --count)
			{
				//A non 0 value indicates the module was created.
			        if (moduleHandles[count] != 0)
				{
					CodeModuleManager.deleteModuleEx(moduleHandles[count], true);
				}
			}
			//The application failed to install.
			return false;
		}
}
		

 

Developer
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810
My Carrier: WiFi

Re: BBM SDK app - phone support?

Thanks for suggestion, but I don't want to mess with installation of RIM apps, especially BBM Smiley Happy

However I can redirect the users to BBM download page in BB App World, it is an easier approach


"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry