BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-03-2008, 05:37 AM   #1
MobileDeveloper
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Default 2 Warnings when Project is built

Please Login to Remove!

Hi

When I try bulding my Project it shows 2 warnings

Warning!: No entry points found

Warning!: No definition found for exported static routine: .main(String[])


What are those warnings about ?

Can some one please say how they can be avoided ?
Offline  
Old 07-03-2008, 06:05 AM   #2
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

Maybe you are trying to compile a MIDlet that is defined as CLDC-Application in the project options. Check the settings of your project.
Offline  
Old 07-03-2008, 06:39 AM   #3
MobileDeveloper
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Default

Hi Ivanov

I am trying to compile an application

Here is the starting part

Can you please say what is the error ?


package com.blackberrydeveloper.FileName;
import net.rim.blackberry.api.phone.*;
public final class FileName extends AbstractPhoneListener {
static public void main(String[] args)
{
MyPhone.registerOnStartup();
}
static private void registerOnStartup()
{
FileName nm = new FileName();
Phone.addPhoneListener(nm);
}


Quote:
Originally Posted by Ivanov View Post
Maybe you are trying to compile a MIDlet that is defined as CLDC-Application in the project options. Check the settings of your project.
Offline  
Old 07-03-2008, 06:51 AM   #4
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

you have to extend either the Application or UiApplication class...
Offline  
Old 07-03-2008, 08:08 AM   #5
MobileDeveloper
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Default

Hi Ivanov

I have already made it extend from AbstractPhoneListener Class

How can I extend it further so that it wil extend from the UiApplication class too ?

Iam pretty weak in Java especially regarding extensions

Do you know how I can make it extend from both the Classes ?


Quote:
Originally Posted by Ivanov View Post
you have to extend either the Application or UiApplication class...
Offline  
Old 07-03-2008, 08:21 AM   #6
samwize
New Member
 
Join Date: Apr 2008
Model: none
PIN: N/A
Carrier: starhub
Posts: 11
Default

Java cannot extend multiple classes.

I think what you need here is to create another class eg. MainApp and then do what you need in there. When the application is started, main will run.

Code:
public class MainApp extends Application {
  private static void main(String[] args) {
    ......
    MyPhone.registerOnStartup();
  }
}
Offline  
Old 07-03-2008, 09:01 AM   #7
MobileDeveloper
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Default

Hi

Do you have any idea how I should write it ?

I am absoultely stuck and not sure how I should extend the PhoneListner class inside the main

Would you be able to show me the sample ?

Here is the main part of code ( that compiles with still those 2 errors ) that I am using

I have left outthe call listening and part as they are generic
Code:

package com.blackberrydeveloper.ImplCallDiverter;
import net.rim.blackberry.api.phone.*;
public final class ImplCallDiverter implements AbstractPhoneListener extends UiApplication {
static public void main(String[] args)
{
    
ImplCallDiverter.registerOnStartup();


ImplCallDiverter theApp = new ImplCallDiverter();
theApp.enterEventDispatcher();

}
static private void registerOnStartup()
{
    
ImplCallDiverter phn_hndl = new ImplCallDiverter();
Phone.addPhoneListener(phn_hndl);

}
Quote:
Originally Posted by samwize View Post
Java cannot extend multiple classes.

I think what you need here is to create another class eg. MainApp and then do what you need in there. When the application is started, main will run.

Code:
public class MainApp extends Application {
  private static void main(String[] args) {
    ......
    MyPhone.registerOnStartup();
  }
}
Offline  
Old 07-03-2008, 09:10 AM   #8
irlennard
Knows Where the Search Button Is
 
irlennard's Avatar
 
Join Date: Jan 2008
Location: Berlin
Model: 9000
Carrier: T-Mobile
Posts: 32
Default

I think your code should look something like this:

Code:
package com.blackberrydeveloper.ImplCallDiverter;

import net.rim.blackberry.api.phone.*;

public final class ImplCallDiverter extends UiApplication implements PhoneListener
{
    public static void main(String[] args)
    {
        ImplCallDiverter theApp = new ImplCallDiverter();
        theApp.enterEventDispatcher();
    }
    
    // Constructor
    ImplCallDiverter()    
    {
        Phone.addPhoneListener(this);
        
        // ...
    }    
}
-- Ian
Offline  
Old 07-03-2008, 09:17 AM   #9
MobileDeveloper
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Posts: 134
Default

Hello Ian

I will try it

Thanks very much for your help
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black) picture

BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black)

$36.06



Bonsenkitchen Compact Automatic 5-in-1 Vacuum Sealer Machine for Food picture

Bonsenkitchen Compact Automatic 5-in-1 Vacuum Sealer Machine for Food

$34.94



Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.  picture

Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.

$220.00



Zurn-Wilkins 1-720A Pressure Vacuum Breaker picture

Zurn-Wilkins 1-720A Pressure Vacuum Breaker

$80.00



3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit picture

3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit

$46.09



VEVOR 5 Gallon Vacuum Chamber with 5CFM Vacuum Pump Kit 1/3HP Single Stage 110V picture

VEVOR 5 Gallon Vacuum Chamber with 5CFM Vacuum Pump Kit 1/3HP Single Stage 110V

$121.98







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.