BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-28-2010, 01:49 PM   #1 (permalink)
New Member
 
Join Date: Jul 2010
Model: Bold
PIN: N/A
Carrier: jordan zain
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy BB Twitter4J problem

Please Login to Remove!

Hi,
I'm developing BB application that interact with Twitter via Twitter4J API, I added library (twitter4j-core-2.1.7-SNAPSHOT.jar)
When I lunched the app to BB simulator, I got "Error Starting TwitterApp: Module 'twitter4j-core-2.1.7-SNAPSHOT' not found"!

My code is:

package com.rim.samples.device.twitterapp;

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.conf.ConfigurationBuilder;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.container.MainScreen;

public class TwitterApp extends UiApplication {

private EditField usernameField;
private EditField passwordField;
private ButtonField login;
private ConfigurationBuilder cb;

public static void main(String[] args) {
TwitterApp theApp = new TwitterApp();
theApp.enterEventDispatcher();
}

public TwitterApp() {
try {
//cb=new ConfigurationBuilder();
} catch (Exception e) {
Dialog.alert(e.getMessage());
}

MainScreen mainScreen = new MainScreen();
mainScreen.setTitle("My Twitter");

usernameField = new EditField("Username: ", "");
passwordField = new EditField("Password: ", "");
login = new ButtonField("Login", ButtonField.CONSUME_CLICK | ButtonField.NEVER_DIRTY);

mainScreen.add(usernameField);
mainScreen.add(passwordField);
mainScreen.add(login);

login.setChangeListener(new FieldChangeListener() {

public void fieldChanged(Field arg0, int arg1) {
Twitter twitter;
try {
twitter = new Twitter(usernameField.getText(), passwordField.getText());
twitter.updateStatus("hi");
} catch (TwitterException e) {
e.printStackTrace();
}
}

});

pushScreen(mainScreen);
}
}
Offline  
Old 10-28-2010, 03:57 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Is this Eclipse or JDE?

It sounds like your build path does not include the jar.
Offline  
Old 10-29-2010, 03:05 AM   #3 (permalink)
New Member
 
Join Date: Jul 2010
Model: Bold
PIN: N/A
Carrier: jordan zain
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Eclipse
what should i do?
Offline  




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