BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   SOURCE CODE! Adds simple "C"ompose shortcut to OS 4.1 devices (8700r included) (http://www.blackberryforums.com/showthread.php?t=23479)

Mark Rejhon 01-10-2006 06:45 AM

SOURCE CODE! Adds simple "C"ompose shortcut to OS 4.1 devices (8700r included)
 
Hi,

As many of you know, keyboard shortcuts can easily be enabled for icons on the main screen of all BlackBerries (Phone -> Options -> General Options -> Dial From Home Screen -> Off).

PROBLEM:
The 8700 series no longer has a Compose icon like older blackberries.

REASON OF SIGNIFICANCE:
In the past, older BlackBerries had a "C" shortcut for the Compose icon for composing a new email message. This brings up the addressbook equivalently to pressing the "A" key or selecting the Addressbook icon, except that selecting a name automatically brings up a blank email editor, instead of viewing details. The side effect is that someone can avoid using the trackwheel to compose an email, which speeds things up a bit for some people (much like eliminating moving between a keyboard and a mouse - for people who likes keyboard shortcuts). On the 6XXX and 7XXX series full-QWERTY-keyboard BlackBerries, you could type C<name><enter> to start composing to a person. The name was able to be a substring of either the first or last name. That means typing Crej<enter> on these older QWERTY BlackBerry models, automatically composes an email to the first person with a "rej" in name -- in this case "Mark Rejhon". That means I could type just 5 keypresses to compose an email to a frequent contact, without even touching the thumbwheel! (This is a BerryFAQ.com tip, no longer valid for BlackBerry model 8700).

POSSIBLE REASON OF REMOVAL:
RIM may have understadnably deemed this icon somewhat superfluous as the Addressbook icon ("A" key) and the convenience keys (which can go straight to Messages), replaces most of this functionality. Unfortunately, a side effect for keypress-shortcut enthusiasts, is that you either now need to use the thumbwheel to compose an email (if using the Addressbook icon or "A" key), or now need to hit more keypresses such as MT<enter>rej<enter> (87XX) from the main screen instead of just Crej<enter> (72XX) from the main screen. (assuming your "Dial from Home Screen" feature is disabled, so that main screen keypress shortcuts are enabled.)


DEVELOPER REQUEST:
Create a simple application that simply launches RIM's email composer. This would be the same thing as selecting Messages -> Compose Email. This icon should have a keypress shortcut.

This would seem to be an extremely tiny application. A free registration code for IM+ will be provided with either of the following:

(1) Create this mini utility that works as described. Give me a free copy (and to all BlackBerryForums moderators). Do whatever you wish with this software (open source, proprietary, etc)

OR

(2) Help me write the software. I've got the ability to develop software, but don't have much time to research for obscure API's (which can much longer than the time I took to wrote this email message). Need perfectly clear answers to all three questions below:
(a) Is there a way to launch RIM's email composer with a blank To: field? Which API?
(b) Is there a way to program a main-screen keypress shortcut to a user application icon? Which API?
(c) Can this be done without needing to purchase a Signing Key from RIM?

Mark Rejhon 01-10-2006 06:59 AM

More information about the rationale of this...
This would actually make it superior to the old Compose method, because for memorized name substrings, the new OS 4.1 compose email with blank editable To:/Cc: fields is much more convenient and more powerful. Type MT<enter> from the 8700 main screen, versus typing MC, compare the two, and you will clearly see why it's useful to have a single keypress shortcut for the MT<enter> sequence of keypresses. Doing MT<enter> via keyboard from main screen (with Dial From Home Screen disabled), does the same thing as Messages -> Compose New Email. I know other third party applications such as PocketDay provides easy workarounds, but what I want is easy one-keypress access to RIM's improved blank email composer (convenient new BlackBerryOS 4.1 feature of editable To: / Cc: fields without needing to click thumbwheel) because it autosearches the best matching name, AND allows you to type memorized email addresses, conveniently, with a minimum of fuss. Some of us just wish we had a keypress shortcut for this convenient feature, moreso now that RIM has removed the Compose-email-from-main-screen keypress shortcut. A minor nuisance that not many of us complain about these little "step-backs" on the BlackBerry, but developers like some of us, know that it could probably easily be done -- and thus this is why I am posting this message. However, the information for the API's are not easily found in a quick search and I'd rather give a free copy of IM+ Blackberry chat software to help make this a reality...

Mark Rejhon 01-16-2006 04:06 PM

This appears to be a problem among BlackBerryOS 4.1, not just model 8700's. So that means 7290's upgraded to OS 4.1 will benefit from such a utility as this.

Rambler 01-18-2006 09:50 PM

Why not create a simple application that has 'C' as its action character. You could hide the icon and still use the shortcut character. The application would simply run the invoke API to invoke the Messages app in the compose screen when it was started. Should just be a few lines if it works.

Rambler 01-18-2006 10:14 PM

Worked in the sim. About 10 lines of code + imports, etc.

Rambler 01-18-2006 10:14 PM

That new 4.1 compose function is very nice, I agree. Send me an 8700c and I'll test it for you :)

Mark Rejhon 01-20-2006 02:25 AM

Quote:

Originally Posted by Rambler
Worked in the sim. About 10 lines of code + imports, etc.

Mind if you post the code? Or release at least the binary?

This code would also benefit 7290's upgraded to BlackBerryOS 4.1, by the way.

Rambler 01-20-2006 09:46 AM

I probably can't post the binary without first going through my company's legal department and having a license drawn up, etc. Easiest thing will be for me to post the code. Let me go read that post on pasting formatted code :)

Rambler 01-20-2006 09:50 AM

*** The following code is for sample purposes only. If you use it and something breaks, you agree to not hold anyone liable but yourself ***

This is the application source:

Code:


import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.invoke.MessageArguments;

import net.rim.device.api.ui.UiApplication;

public class Composer extends UiApplication {

    public Composer(){}

    public static void main(String[] argv){
        Composer c = new Composer();
        try{
            c.enterEventDispatcher();
        }
        catch(Exception e){
            final String msg = e.getMessage();
            net.rim.device.api.ui.component.Dialog.alert("Error starting app: "+msg);
        }
    }

    public void activate(){
        Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(MessageArguments.ARG_NEW));
    }
}

Once you put this in a project file, there is one other critical piece of information. You need to name it C\u0332omposer. The \u0332 denotes the 'C' as the shortcut key.

Now build and deploy. Not sure if it needs signing, but I suspect it does since you'll be invoking the BlackBerry api. You could even be fancy and copy the icon from the old compose screen and make it the icon for this app. Then you'd have a pretty much seemless solution.

Rambler 01-20-2006 09:59 AM

Sorry for all the posts, but one last thing I should specify. This code will only work with 4.1+ OS due to the new capability to invoke the Messages application in a compose screen (ARG_NEW).

To double check that last point I looked at the api docs and it is a signed api call.

Mark Rejhon 01-20-2006 10:59 AM

Quote:

Originally Posted by Rambler
Sorry for all the posts, but one last thing I should specify. This code will only work with 4.1+ OS due to the new capability to invoke the Messages application in a compose screen (ARG_NEW).

That's it, that's the magic piece of the puzzle.

Now, to see, if I need RIM JDE 4.0 or 4.1 for this...

Rambler 01-20-2006 11:03 AM

Jde 4.1

Mark Rejhon 01-20-2006 04:24 PM

Confirming a successful compile of a source code project (based on code from this threadin RIM JDE 4.1 and it solves the missing OS 4.1 Compose keypress problem perfectly.

However, I now need to get the .cod file signed so I can put it on a real BlackBerry. If I purchase the code signing key and sign this software, is it okay for me to publicly release this software? If I decided to, is it okay to add code derived from this, to the BlackBerryTools SourceForge project?

Your free IM+ registration code is sent to you by PM.

Mark Rejhon 01-20-2006 04:47 PM

Finally purchased my very own RIM signing key ($100 USD).

Now I'll be armed and dangerous in self-employed BlackBerry development. ;-)

This program will be free, though.

Rambler 01-20-2006 05:13 PM

I suppose you could re-type the code and put it in BlackBerry tools since technically, I'm just offering advice rather than software :)

Depending on what our legal department says, I might even release something suspicously similar (for free of course).

Rambler 01-23-2006 04:20 PM

You can download this tool, in binary format, from http://wireless.sra.com/utils/

Pick 'Composer'.

KonTiki 01-23-2006 07:07 PM

Template Application
 
Quote:

Originally Posted by Rambler
You can download this tool, in binary format, from http://wireless.sra.com/utils/

Pick 'Composer'.

As always Rambler, Thank You.

Neat template application, Installed it and its already working.

My hat as always is off to you for helping the rest of us.

kurichan 01-23-2006 10:33 PM

Even though I won't benefit from this in any way until OS v4.1 comes out for the 7250, I cannot help but to comment on how wonderful the Internet is as a collaborative community tool!

Two people who have never met and probably never will have solved a real problem that potentially helps millions of people.

COOL!

NJBlackBerry 01-24-2006 02:42 AM

Thank you Rambler! Outstanding...

penk 01-24-2006 10:44 AM

the thread title may need clarification, to exclude 71XX handsets.

i have recently installed the Hong Kong 4.1 OS onto my 7105t, and within Phone Options, there no longer appears (that i can discover) the ability to disable "dial from home screen".

if this app utility is to work for 71XX devices, then the current 4.1 OS lacks the necessary setting to allow the "override".


All times are GMT -5. The time now is 01:20 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.