Click here to Skip to main content
15,919,749 members
Home / Discussions / Java
   

Java

 
AnswerRe: Socket is closed Pin
TorstenH.20-Mar-11 7:49
TorstenH.20-Mar-11 7:49 
AnswerRe: Socket is closed Pin
Yadav Akash21-Mar-11 2:25
Yadav Akash21-Mar-11 2:25 
Questionorg/apache/http/params/HttpParams Pin
williamroma17-Mar-11 13:32
williamroma17-Mar-11 13:32 
AnswerRe: org/apache/http/params/HttpParams Pin
williamroma17-Mar-11 13:55
williamroma17-Mar-11 13:55 
GeneralRe: org/apache/http/params/HttpParams Pin
Peter_in_278017-Mar-11 14:10
professionalPeter_in_278017-Mar-11 14:10 
GeneralRe: org/apache/http/params/HttpParams Pin
williamroma17-Mar-11 14:19
williamroma17-Mar-11 14:19 
GeneralRe: org/apache/http/params/HttpParams Pin
Peter_in_278017-Mar-11 14:32
professionalPeter_in_278017-Mar-11 14:32 
QuestionJML where is the wrong? Pin
williamroma16-Mar-11 11:07
williamroma16-Mar-11 11:07 
hi
i am working with JML (java MSN library)
i found this code
but it doesn't work with me
any one help me please
this is the code
/*
 * Copyright 2004-2005 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package example1;

import net.sf.jml.MsnMessenger;
import net.sf.jml.impl.MsnMessengerFactory;

/**
 * @author Roger Chen
 */
 public class BasicMessenger {

    private String email;
    private String password;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    protected void initMessenger(MsnMessenger messenger) {
    }

    public void start() {
        //create MsnMessenger instance
        MsnMessenger messenger = MsnMessengerFactory.createMsnMessenger(email,
                password);

        //MsnMessenger support all protocols by default
        //messenger.setSupportedProtocol(new MsnProtocol[] { MsnProtocol.MSNP8 });

        //default init status is online,
        //messenger.getOwner().setInitStatus(MsnUserStatus.BUSY);

        //log incoming message
        messenger.setLogIncoming(true);

        //log outgoing message
        messenger.setLogOutgoing(true);

        initMessenger(messenger);
        messenger.login();
    }

    public static void main(String[] arg) throws Exception {
        /*if (args.length != 3) {
            System.out.println("Usage: java messengerClassName email password");
            return;
        }*/
        
        String args[]=new String[3];
        args[0]="william";
        args[1]="rojjffjjj887hghgma@hotmail.com";
        args[2]="uullro33";

        BasicMessenger messenger = (BasicMessenger) Class.forName(args[0])
                .newInstance();
        messenger.setEmail(args[1]);
        messenger.setPassword(args[2]);
        messenger.start();
    }
}

AnswerRe: JML where is the wrong? Pin
Richard MacCutchan16-Mar-11 12:56
mveRichard MacCutchan16-Mar-11 12:56 
GeneralRe: JML where is the wrong? Pin
williamroma16-Mar-11 13:07
williamroma16-Mar-11 13:07 
GeneralRe: JML where is the wrong? Pin
williamroma16-Mar-11 13:21
williamroma16-Mar-11 13:21 
GeneralRe: JML where is the wrong? Pin
Richard MacCutchan16-Mar-11 13:47
mveRichard MacCutchan16-Mar-11 13:47 
GeneralRe: JML where is the wrong? Pin
williamroma16-Mar-11 13:52
williamroma16-Mar-11 13:52 
GeneralRe: JML where is the wrong? Pin
Richard MacCutchan16-Mar-11 23:01
mveRichard MacCutchan16-Mar-11 23:01 
GeneralRe: JML where is the wrong? Pin
williamroma16-Mar-11 23:04
williamroma16-Mar-11 23:04 
GeneralRe: JML where is the wrong? Pin
Richard MacCutchan17-Mar-11 1:32
mveRichard MacCutchan17-Mar-11 1:32 
GeneralRe: JML where is the wrong? Pin
williamroma17-Mar-11 2:06
williamroma17-Mar-11 2:06 
GeneralRe: JML where is the wrong? Pin
_Erik_17-Mar-11 3:43
_Erik_17-Mar-11 3:43 
AnswerRe: JML where is the wrong? Pin
TorstenH.16-Mar-11 20:57
TorstenH.16-Mar-11 20:57 
QuestionVoice Recognition for Reading Program Pin
luc53252316-Mar-11 9:03
luc53252316-Mar-11 9:03 
AnswerRe: Voice Recognition for Reading Program Pin
Richard MacCutchan16-Mar-11 12:53
mveRichard MacCutchan16-Mar-11 12:53 
AnswerRe: Voice Recognition for Reading Program Pin
TorstenH.16-Mar-11 21:02
TorstenH.16-Mar-11 21:02 
GeneralRe: Voice Recognition for Reading Program Pin
luc53252317-Mar-11 7:08
luc53252317-Mar-11 7:08 
QuestionEvent Listener problem Pin
kurt114-Mar-11 10:46
kurt114-Mar-11 10:46 
AnswerRe: Event Listener problem Pin
TorstenH.14-Mar-11 23:33
TorstenH.14-Mar-11 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.