I am a newbie in Blackberry Development and has got stuck on a very complex thing.
I have to make an application which should be support all O.S 6 and 0.S 7 based mobile phones.
Now I have different screen resolutions for different handsets in BB OS 6 and 7.
Now how can i manage my background images, and its button positions to be synced on all size of devices.
I have created an images for the screen size of 640x480 and according to it I have placed some button on x,y positions. now if i install the same app on a screen size of 480x360 how can i manage the x,y positions and manage the background size according to device width and height.
Can anybody help? I am complete newbie.
Use preprocessor, built-in to Eclipse JDE-plugin, or third-party preprocessor and BlackBerry Ant Tools
Compile separate applications for different RIM OS versions using the same source code files with preprocessor directives inside.
Technically an application compiled with RIM SDK 6.0 is compatible with device with RIM OS 7.0, but to provide the best user experience make separate applications for separate RIM OS versions.
On preprocessing include those image files which are suitable for building a particular application version. If you need to support many screen sizes, then add the biggest possible images to your project and then scale them down at the runtime. Scaling down almost does not affect image quality.
Upon ant build process employ Alx task to collect all information about separate application versions into one alx file.
As a result you will have one alx file (application descriptor file, it is an xml-file), and a set of folders with cod files inside.
When all cod files are signed, you can also do it upon ant build process distribute this alx file with all folders with cod files as one zip archive.
Customer unzips this archive, connects device via usb to the computer, launches BlackBerry Desktop Manager and selects this one alx file. Directives generated by alx task will guide BlackBerry Desktop Manager to install application suitable for the device RIM OS version.
If you want to distribute your application wirelessly, then employ jadtool task and make a php page that reads browser user agent and redirects browser to a relevant jad file.
Before using OTA (over the air) method for distributing your application, add the following MIME-type instructions to the .htaccess file of your web-server.
AddType text/vnd.sun.j2me.app-descriptor jad
AddType application/java-archive jar
AddType application/vnd.rim.cod cod
While the approach suggested does provide the best user experience, it is also the most complex to manage.
Personally I try very hard to make one executable and have it evaluate at run time what it needs to do based on the form factor of the device. This is actually easier than you might think, helped significantly by the fact that most screens about the same width. So you can do things like scale your assets to match a proportion of the screen width, based on the screen resolution, and they will look OK on most devices.
And while there are some nice things to be had by using stuff that is specific to say OS7, at this stage I think you should focus on the bread and butter stuff that you can do with OS 5. So, I would recommend you develop something for OS 5.0 - it will run on OS 6.0 and OS 7.0 devices. Create the UI generically to cope with various screen sizes. Later, if you need to get more sophisticated, you can use the tools that have been described.
You will find more on how I try to do things by looking at this.
http://supportforums.blackberry.com/t5/Java-Development/Tutorials-for-new-developers-Part-1/m-p/1621711#M194036
I would suggest you look at tutorial 10.
I also recommend a cruise around here:
http://developer.blackberry.com/java/
One final thing though, are you aware that Java phones are no longer being developed by BlackBerry? If you are just starting development, you might consider learning C++/Cascades and developing for the BB10 phones.
Related
I need to know whether we can install and share blackberry application without using .jad files and make it just one .cod files as a distribution package to install.
A clarification, we are talking about BB7 applications here, not BB10.
You ask whether it is possible to install and share a Blackberry application, without using a jad.
In addition to OTA installation (which is where a jad file comes in), you can install applications using the Desktop Manager or some low level application such a javaloader. These use the cod files, from a PC.
What I am not clear on is what you mean by share. Can you explain what you expect to be able to do?
One other comment, another answer suggests that you can use CodeModulemanager. Be aware that you can't use CodeModuleManager unless you write an application, and if you do, you sort of have a chicken and egg situation. Before you can use CodeModuleManager to install Applications, then you need to have the application that includes the CodeModuleManager code installed - in other words, an installer application.
I have an application I've been handed to test, and I'm — shall we say — less than impressed?
I believe the company that built the application for my client didn't build it as an iOS native application; my gut feel is they leveraged one of the multi-target platforms because that's what they're comfortable with. The application's usability is particularly poor, and it just doesn't behave the way an iOS application should.
How can I tell whether this application is native or built on some OS-agnostic platform? Any big give-aways that can tell me?
FWIW, the iPad is the only target platform for this device. It won't need to run anywhere else.
Are you saying that it doesn't have the look and feel of a regular iOS app? It's possible that it has been developed in AIR, HTML5, etc. I don't know if there is much way of doing this without jailbreaking the device.
You could, of course, ask around or post a screenshot and see what others think.
Get the binary out of the device, using softs like DiskAid (free for that part - no jailbreak required), and study it. You may get important infos through a disassembler, such as Hopper, which has support for ARM.
If you can't read assembly, study the application's resources. It may also give you some hints. Again, a software like DiskAid will allow that.
While "some OS-agnostic platform" is a bit broad, there is an easy way to tell if an app was made with PhoneGap, arguably one of the most popular OS-agnostic platforms.
Copy the .ipa file you've been sent (or find it on your filesystem
and copy it).
Rename the copy WhatEverTheAppNameIs.zip.
Extract the zipped folder and open it.
Open the folder named "Payload" (If it isn't already).
Right-click on BlahBlah.app and select "Show Package Contents".
Inspect the bundle.
Check for the presence of a www folder. If it's contents are sizable (compared with the packages contents in general) there's a good chance the whole app was made with PhoneGap.
It's also illuminating to click on the index.html file in the www folder just to see how much of the app runs in desktop Safari.
You may also discover other evidence of OS-agnostic platforms by examining the bundle further.
Story:
I have written a HTML Merge Compiler that can merge resource's/assets into one single HTML file (minify it to the max) and compiles Javascript with the google enclosure compiler. I have written this compiler to speed up loading and interpreting the code and to obfuscate the code to protect a little bit (script kiddie protection). Major reason was/is speed and to make it compact.
This is working OK with reliable results and i use this in PhoneGap applications/games. I have also written a javascript library that encapsulate all platforms that works with standard HTML/CSS without the need to change the code, it works also in the browser, with a touchscreen or without or on any device or operating system. Write once, publish many ;-). The idea around it is that is working always, always operate the same but can use device specific things when available but does never fail (when something is not there, for example a vibrate functionality).
Anyway, most frameworks (like PhoneGap) concentrate on Mobile Platforms but i want to port it also to desktop platforms like Windows, OSX and maybe Linux. For Windows I have wrote an Delphi Application that loads the HTML in a TEmbeddedWB object (is Internet Explorer actually) but the 'problem' is that it is only suitable to Windows and IE is not the fastest browser around, especially when it is embedded (do not why it is slower than the browser itself). For example, when i load the compiled code in Firefox and/or Google Chrome it is blazing fast (you do not notice it is javascript ;-)).
EDIT:
Pre release of IE10 for Windows 7 is just launched, installed it and lag is gone!
You can download it from here:
http://www.microsoft.com/en-us/download/details.aspx?id=35709
Introduction to my question:
I have tried XULRunner of Mozilla a long time ago but the first time was not a pleasure to me and also i tried it today again but can't get it to work. Get a parse error in the main xul file of the project, window is an undefined entity. ??? I create a sample project like: http://mdn.beonex.com/en/Getting_started_with_XULRunner.html
I do not know what to do about this error. Also i think documentation is not up-to-date? Most documentation is from around 2006.
The question, what i want to know:
Before i am going to waste my time (see also introduction), is it
possible to create frameless (full-screen) desktop executables with
use of XULRunner like with PhoneGap?
Is it possible to create cross-platform applications with XULRunner, i mean, does it really work seamless. Where can i find a ready-to-publish example of a XULRunner project and is it possible to load local HTML file(s) like in PhoneGap?
It is possible and allowed to access external resources?
Long story, but maybe there is somebody that have tried this before and can lead me to choose the right direction.
is it possible to create frameless (full-screen) desktop executables with use of XULRunner like with PhoneGap?
Yes. You use disablechrome attribute to remove the window frame and sizemode="maximized" to have it open full-screen. Alternatively you can use the full-screen API if you want your application to run in a normal window and only switch to full-screen mode on request.
Is it possible to create cross-platform applications with XULRunner
Yes. There are things like menus that work very differently on OS X but most of the time you don't need to care what operating system your application runs on (Windows, Linux and Mac OS X supported).
Where can i find a ready-to-publish example of a XULRunner project
See documentation for a XULRunner application example. For "ready-to-publish" you would need an installer which doesn't come with the platform.
is it possible to load local HTML file(s) like in PhoneGap?
Yes. The top-level window has to be XUL but you can use some very minimal code here - essentially a single <iframe flex="1"/> tag. You can load HTML pages into that frame then.
It is possible and allowed to access external resources?
Yes, XULRunner applications have full privileges and can access files on disk as well as web resources without any restrictions.
I have a blackberry application with lots of images that was build for pre-OS7 handsets. I have to make it up to date with the new screen sizes, and my 5Mb app will be almost twice as big, which means over the limit for it to work.
What is the best way to handle that in the BB Java Plug-in for Eclipse ?
I've come to the conclusion that i have 2 choices :
Including the new images as a cod (or is it jar?) library in my current project, but didn't manage to do that. Most of what i read was for the JDE anyway and i'd like to do that in Eclipse.
Have a second Bundle for new handsets, but how to do that without having 2 different projects ?
Downloading the new images on install seems to be another one, but it's not an option for this project.
Details and/or links appreciated, as i'm quite new to BB development.
Many thanks
From my point of view the better way is to use only the biggest possible images in the project and scale them down proportionally for every device at the runtime.
When you scale down an image its quality {almost} does not change. There are exceptions, sure. But in general this rule works.
Also you may use preprocessor to build different cod files for different devices with different screens.
You can keep bigger images and get rid of smaller ones. You can handle devices that has lower resolution via image scaling. This way your application becomes smaller.
According to me i suggest you that you have to make same app for only Blackberry OS 7.0 because it has different different resolution and if you manager your application for all Blackberry OS than your app will become larger size and it may be possibilities that we cant upload our app in Blackberry app world.
Remove all previous OS graphic and put into for only Blackberry OS 7 and upload it on market so OS 7.0 user download the latest app.
A newb question and one I haven't been able to see much advice on, but is it possible to create a single package that will install and run on both blackberry OS5 and OS6 devices?
I want to avoid preprocessing or creation of two different COD files.
I am not using anything special that differs between the two OS's (afaik!)
Yes, absolutely. So far, RIM has made all of it's OS revisions backwards-compatible. So anything you write against any given OS version will work on that version and all newer versions.
That's not to say that you won't run into funny quirks when moving to newer OS versions, but your code will execute without recompilation. You just can't take advantage of any of the newer OS's API changes without doing preprocessing.
Basically in this case you just should not use APIs which were added in OS6.