You Are Here:

Community: Developer Discussion Boards

#1 Old NetBeans 6.1 Mobility - Adding Method Call - 2008-09-09, 23:59

Join Date: Jul 2008
Posts: 13
DG002
Offline
Registered User
Hi,

This is probably a stupid and really easy question to answer, but I'm new to NetBeans and J2ME.

I have a Bluetooth app, that works fine and I even created a Desktop App in NetBeans, but porting over to Mobility and J2ME is proving a little more difficult!

I (finally) created the interface and the basic ItemCommands I need, but in the main MIDlet I'm having trouble calling my functions.

Two main problems I'm having... (one not code related)

1. I have my java app and its method is:

Code:
public class DeviceInformation {

	/*
	 * Send Carriage Return after every AT command as they will not run without
	 * a return sent!
	 */
	private static final String cr = "\r";

	 public static void main (String[] args)throws IOException,
			InterruptedException {
                DeviceInformation dvi = new DeviceInformation();
                dvi.executeDeviceInformation();
        }
        
        public List executeDeviceInformation ()throws IOException,
			InterruptedException 
        {
//Rest of code here...
Then in the MIDlet code, the ItemCommand reference is automatically created and is:

Code:
  //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand11 ">
    /**
     * Returns an initiliazed instance of itemCommand11 component.
     * @return the initialized component instance
     */
    public Command getItemCommand11() {
        if (itemCommand11 == null) {
            // write pre-init user code here
            itemCommand11 = new Command("Device Info : IMEI", Command.ITEM, 0);
            // write post-init user code here
        }
        return itemCommand11;
    }
    //</editor-fold>
Do I simply call the method the same way I did in Desktop App within the post-init, e.g.:

Code:
@Action
    public void hack4() {
       try {
            DeviceInformation dvi = new DeviceInformation();
            List ls = dvi.executeDeviceInformation();  
            String entries = "IMEI Number \n";
            for (Iterator it = ls.iterator(); it.hasNext();) {
                String entry = (String)it.next();
                entries+=entry+"\n";
                
             
                
                
            }
           
           jTextArea1.setText(entries);
           
        }
        catch(IOException ex)
        {
            //
        }
        catch(InterruptedException ex)
        {
            //
        }
        finally 
        {   
            // System message could go here...
        }
               
         
    }
Obviously minus the Action bit and the public void call etc...

I'm a little confused, any pointers would be great! Plus, the previous was using jTextArea, but I'm not sure how to output the responses to the screen. Do I use TextItem?

Finally (sorry for big email) second issue is in compile. I'm getting errors from the libs I've included, its gripiping with the following:

Code:
Preverifying 1652 file(s) into C:\Documents and Settings\Mark\My Documents\NetBeansProjects\BlueAT_Attack\build\preverified directory.
Error preverifying class com.intel.bluetooth.btgoep.Connection
    java/lang/NoClassDefFoundError: com/ibm/oti/connection/CreateConnection
C:\Documents and Settings\Mark\My Documents\NetBeansProjects\BlueAT_Attack\nbproject\build-impl.xml:431: Preverification failed with error code 1.
BUILD FAILED (total time: 22 seconds)
Any help is much appreciated!

Thanks,
DG.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
adding png file in Netbeans 4.0 netpunkz Mobile Java Tools & SDKs 2 2005-02-15 15:54
when to call the ConnectL(pref, stat) method of CIntConnectionInitiator? smallfish_ntu Symbian Networking & Messaging 3 2003-09-25 08:58
when to call the ConnectL(pref, stat) method of CIntConnectionInitiator? smallfish_ntu General Symbian C++ 0 2003-05-29 10:09
Public method call kaisub General Symbian C++ 1 2003-04-10 16:08
Nokia 30 - CORBA method call hrdonka Nokia M2M 1 1970-01-01 02:00

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ