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
New Developer
ambush276
Posts: 2
Registered: ‎11-18-2009
My Device: Not Specified

Phone API Help /basics

needed some help.

im building a VERY basic Blackberry app..

this is extremely basic.. can somone help me?

basically i want when the app to run to dial a # (but not go to dialer screen do this invisibly).

Connect to the #, once it is connected for 4 seconds .. disconnect.

That is app part 1

then part 2, if a call comes in and it has a certain phone #... do not have it ring or vibrate etc..., automatically pick it up and go straight to the phone dialer..
That is it..

its very simple and should use a few lines of code.?

how can i use this?

(note i know i need that $20 certificate... how do i get that and what do i need to start coding for BB.. i have already made this app for Windows Mobile.. but for BB its in java .. etc. no port..
if u want to see it in C# please ask below and i will post it (if that will help?)

 

here is my c# code..c an someone help convert please.

 

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Telephony;
using Microsoft.WindowsMobile.Status;
using System.Runtime.InteropServices;

namespace celldialer3
{
    public partial class CallKab : Form
    {
        Microsoft.WindowsMobile.Telephony.Phone p;
        SystemState _PhoneCallTalking; // declare it here, so it won't fall out of scope
        SystemState _PhoneIncomingCall;
        const int KEYEVENTF_KEYUP = 0x2;
        const int KEYEVENTF_KEYDOWN = 0x0;
        const int KEYEVENTFF_KEYUP = 0x72;

 

 

 

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Phone API Help /basics

See the javadocs for Phone, PhoneListener, and PhoneCallLog

 

Also see the two "phone" samples that ship with the JDE.

 

New Developer
ambush276
Posts: 2
Registered: ‎11-18-2009
My Device: Not Specified

Re: Phone API Help /basics

i have seen that stuff i just need some help as i dont really know the basics of java.. prerequ's etc.. what i need to use for the phone API?

 

 

also the certificate? can i run it on a simulator without that cert?

 

on the complier its X'd out ... so i cannot use it?

 

 

also i have VS 2008? is there anyway to compile on that? or do i need to do Eclipse?

 

Thanks!

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Phone API Help /basics

[ Edited ]

If you don't know the basics of Java, you are going to struggle trying to code for the Blackberry.

 

There are a couple of beginner Blackberry development books - I suggest that you get one.

 

No, you cannot use VS2008 to code Java for the Blackberry.

 

If you are already an experienced Eclipse user, then install the Eclipse plug in for development. If you are not, then get started with the RIM JDE.

 

You do not need code-signing keys for development or testing on the simulator - you only need these to deploy your app on a real device.

 

 

 

 

Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

C# to Java

Another C# dev, welcome. I'll just go straight through as many questions as you have.

 

  • Your in luck, C# was based off of Java and has a very similar syntax.
  • -Instead of "using" you use "import." Ex.: C#: "using System.Windows.Forms;", Java: "import System.Windows.Forms.*;"
  • -Instead of "namespace **** {}" you declare what package the class/interface is in before you place the import statements and you don't need brackets. Ex: C#: "namespace celldialer3{}", Java: "package calldialer;"
  • -One annoying thing you need to o in Java that you don't have to do in C# is you need to have the file in the correct directory. The class/interface must also be in a file of the same name and cannot have any other types that are not internal classes/interfaces. Ex: you have a class called "CallKab" in package "calldialer". This means the file must be called "CallKab" and it must be located in directory "calldialer."
  • The $20 signing key can be obtained https://www.blackberry.com/SignedKeys/.
  • The app can run in the simulator without the signing keys but you need the keys to run on a actual BlackBerry device.
  • I wish I could do Java development in VS2008 but that will probably never occur so I use Eclipse, its very good and RIM has its development tools designed for it. You install Eclipse, then go to the help menu->Install software, specify the BlackBerry software path and it will list the plug-in and the "Component Packs" that define the API (and minimum OS) you can use.
  • As  said, you might want to look up some BlackBerry books and/or Java books. You should find a bunch of information online for Java and once you install the Eclipse plug-in and a component pack you can go to it's folder and there is a folder called "samples" which RIM created and covers pretty much everything that the BlackBerry can do. They are also well commented.
  • One last note, RIM is currently transitioning from Eclipse 3.4 to Eclipse 3.5 with a new style of plug-in. Some of the information above is different for the new plug-in but I would recommend that you use the new one because it is what RIM is going to and it has a webpage that gives a bunch of information and links to stuff like current documentation and how to use/do certain things on the BlackBerry. It also has a built in menu item to load the samples so you don't need to search through folders to find the samples. An additional bonus is that, though it is not out yet, RIM will be releasing a GUI builder that will be close to the VS GUI builder, so it should simplify your (and everyone else here's) life for making GUIs.

Links:

Signing Keys: https://www.blackberry.com/SignedKeys/

Main development page: http://na.blackberry.com/eng/developers/

Old-Eclipse Plug-In:

New-Eclipse Plug-In:

At the top of the Java Development Forums there are some entries that give links to beginners in BlackBerry development and how to download/use network connections.

That should cover pretty much everything. I know I didn't talk about the Phone development but, like  said, look at the samples, check the documentation, and I would like to add to check the "Resources" link on the main Development site because it has a large amount of information like tutorials and videos.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.