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
Trusted Contributor
Posts: 144
Registered: ‎05-04-2011
My Device: blackberry mobiles
My Carrier: app development

Single build for 6.0 and 7.0 OS versions(both touch and non touch)

Hello Friends,

 

       We developed a big application for bold and torch..Both are 6 OS and seperate builds(Because of one is touch and another one is non touch),,

 

       Now the client asked us a single build for OS 6.0 and OS 7.0(touch and nontouch included)..

 

       Our application mainly coded by using lot of images and web services..

 

       Can anyone provide me the easiest way to create a single build by using the existing build..

 

Regards,

Lakshmanan

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Single build for 6.0 and 7.0 OS versions(both touch and non touch)

Hi Lakshman,

 

Its a wrong design of your application if you have developed 2 separate applications just because of Touch and Non-Touch. 

 

We have lots of applications in Market, running on 5.0 to 7.0 with same build (5.0), which runs on Touch and Non-Touch both type of Devices. 

 

If you have used different sets of images for both, you can have separate folders in same build like 

  1. img320x240
  2. img320X480
  3. img480 x 360

Now, main part is to select image at runtime. We have 1 common static Util method to pick image like.. Util.getImage(String imageName)

 

 

public class Util {
        private static String myFolderName = resFolderSelector(); 

	public static Bitmap getBitmapImage(String name) {
		return Bitmap.getBitmapResource(myFolderName + "/" + name);
	}
	
	public static String resFolderSelector(){
		//TO-DO : logic to find right resolutions, using Display.getWidth() and height
		//and return folder String accordingly 
		//e.g. return 480x360
	}
}

 Hope it helps..!!

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Trusted Contributor
Posts: 144
Registered: ‎05-04-2011
My Device: blackberry mobiles
My Carrier: app development

Re: Single build for 6.0 and 7.0 OS versions(both touch and non touch)

Hi kanaksony,

 

     Thanks for your reply.. But i already mentioned lot of images are used in our application(nearly 100 images)..

    

     So keep the seperate images folder for each resolution increase the application weightage..

 

     So it is not possible to use this method.. Anyother suggestions?

 

Regards,

Lakshmanan

Developer
Posts: 130
Registered: ‎10-26-2010
My Device: Blackberry Bold 9700

Re: Single build for 6.0 and 7.0 OS versions(both touch and non touch)

hi ,

 

Try using larger images and resize them on runntime according to the target handset resolution.This way you will have just one images set

 

Regards

 

Developer
Posts: 16,987
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Single build for 6.0 and 7.0 OS versions(both touch and non touch)

resizing can look ugly, depending on the source and target size, so you have to experiment there.

another option would be to put all resources into an external package and download it.

personally i have 3 different image sizes in one of my applications, but those are not that big (48*48 to 80*80).
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Single build for 6.0 and 7.0 OS versions(both touch and non touch)

I do agree with Simon.

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Single build for 6.0 and 7.0 OS versions(both touch and non touch)

And I disagree, just showing there are different opinions! 

 

I suggest that you try to use the image for the largest size and scale these at start up to match the resolution and attributes of the device.  So size it for a 9860, and scale it down if it going to be displayed on a 9320.  

 

You can do this lazily, or do this while displaying a splash screen.  But remember to keep your scaled images in something like static store so you only do it once. 

 

This method has served me well, when RIM brings out a new device I don't go into a panic worrying about whether my application will look OK, I know it will scale.

 

And I helped develop one application where the number of image meant that if all resolutions were catered for, the images size would blow the 8 MB limit. 

 

That said, I guess there are some things do not scale well, and some you want to be picture perfect, then you will need to have an image per resolution.   But I would avoid that.

 

My general approach is explained in the 10th tutorial you will find here:

http://supportforums.blackberry.com/t5/Java-Development/Tutorials-for-new-developers-Part-1/m-p/1621...

This also discusses how to cope with touch screen and non touch screen in the same build.