BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links



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

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 ?
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
Ivanov Offline
Thumbs Must Hurt
 
Posts: 185
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Default 07-03-2008, 06:05 AM

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

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.
   
Reply With Quote
  (#4 (permalink)) Old
Ivanov Offline
Thumbs Must Hurt
 
Posts: 185
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Default 07-03-2008, 06:51 AM

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

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...
   
Reply With Quote
  (#6 (permalink)) Old
samwize Offline
New Member
 
Posts: 11
Join Date: Apr 2008
Model: none
PIN: N/A
Carrier: starhub
Default 07-03-2008, 08:21 AM

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();
  }
}
   
Reply With Quote
  (#7 (permalink)) Old
MobileDeveloper Offline
Thumbs Must Hurt
 
Posts: 126
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Default 07-03-2008, 09:01 AM

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();
  }
}
   
Reply With Quote
  (#8 (permalink)) Old
irlennard Offline
Knows Where the Search Button Is
 
irlennard's Avatar
 
Posts: 30
Join Date: Jan 2008
Location: Berlin
Model: 9000
Carrier: T-Mobile
Default 07-03-2008, 09:10 AM

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
   
Reply With Quote
  (#9 (permalink)) Old
MobileDeveloper Offline
Thumbs Must Hurt
 
Posts: 126
Join Date: Jun 2008
Model: 8100
PIN: N/A
Carrier: Vodafone
Default 07-03-2008, 09:17 AM

Hello Ian

I will try it

Thanks very much for your help
   
Reply With Quote
Reply


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1