]> sjero.net Git - linphone/commitdiff
Sending pictures through chat
authorSylvain Berfini <Sylvain.Berfini@Belledonne-Communications.com>
Fri, 14 Sep 2012 14:54:57 +0000 (16:54 +0200)
committerSylvain Berfini <Sylvain.Berfini@Belledonne-Communications.com>
Fri, 14 Sep 2012 14:54:57 +0000 (16:54 +0200)
12 files changed:
LinphoneCallImpl.java
LinphoneCallLogImpl.java
LinphoneChatMessageImpl.java [new file with mode: 0644]
LinphoneChatRoomImpl.java
LinphoneCoreFactoryImpl.java
LinphoneCoreImpl.java
LinphoneProxyConfigImpl.java
tutorials/AndroidTutorialNotifier.java [deleted file]
tutorials/TutorialBuddyStatusActivity.java [deleted file]
tutorials/TutorialChatRoomActivity.java [deleted file]
tutorials/TutorialHelloWorldActivity.java [deleted file]
tutorials/TutorialRegistrationActivity.java [deleted file]

index 27ed253efdc32894408c3fa7f4d51924787b4280..5d886d43e459dcd1b3449ab7e8c172e519c8e7bf 100644 (file)
@@ -155,7 +155,7 @@ class LinphoneCallImpl implements LinphoneCall {
        public float getPlayVolume() {
                return getPlayVolume(nativePtr);
        }
-
+       
        private native void takeSnapshot(long nativePtr, String path);
        public void takeSnapshot(String path) {
                takeSnapshot(nativePtr, path);
index 895e27a388597463782b10afcf8c5ed4dfd17a3f..8972f0a76a343474cf6dd4dbc39ac5f86bea9165 100644 (file)
@@ -26,11 +26,14 @@ class LinphoneCallLogImpl implements LinphoneCallLog {
        private native long getFrom(long nativePtr);
        private native long getTo(long nativePtr);
        private native boolean isIncoming(long nativePtr);
+       private native int getStatus(long nativePtr);
+       private native String getStartDate(long nativePtr);
+       private native int getCallDuration(long nativePtr);
+       
        LinphoneCallLogImpl(long aNativePtr)  {
                nativePtr = aNativePtr;
        }
        
-       
        public CallDirection getDirection() {
                return isIncoming(nativePtr)?CallDirection.Incoming:CallDirection.Outgoing;
        }
@@ -43,17 +46,18 @@ class LinphoneCallLogImpl implements LinphoneCallLog {
                return new LinphoneAddressImpl(getTo(nativePtr));
        }
        public CallStatus getStatus() {
-               throw new RuntimeException("not implemented yet");
+               return LinphoneCallLog.CallStatus.fromInt(getStatus(nativePtr));
+       }
+
+       public long getNativePtr() {
+               return nativePtr;
        }
-       @Override
+       
        public String getStartDate() {
-               // TODO Auto-generated method stub
-               return null;
+               return getStartDate(nativePtr);
        }
-       @Override
+
        public int getCallDuration() {
-               // TODO Auto-generated method stub
-               return 0;
+               return getCallDuration(nativePtr);
        }
-
 }
diff --git a/LinphoneChatMessageImpl.java b/LinphoneChatMessageImpl.java
new file mode 100644 (file)
index 0000000..a93aae8
--- /dev/null
@@ -0,0 +1,50 @@
+package org.linphone.core;
+
+public class LinphoneChatMessageImpl implements LinphoneChatMessage {
+       protected final long nativePtr;
+       private native void setUserData(long ptr);
+       private native String getMessage(long ptr);
+       private native LinphoneAddress getPeerAddress(long ptr);
+       private native String getExternalBodyUrl(long ptr);
+       private native void setExternalBodyUrl(long ptr, String url);
+       
+       protected LinphoneChatMessageImpl(long aNativePtr)  {
+               nativePtr = aNativePtr;
+               setUserData();
+       }
+       
+       public long getNativePtr() {
+               return nativePtr;
+       }
+       
+       @Override
+       public Object getUserData() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void setUserData() {
+               setUserData(nativePtr);
+       }
+
+       @Override
+       public String getMessage() {
+               return getMessage(nativePtr);
+       }
+       
+       @Override
+       public LinphoneAddress getPeerAddress() {
+               return getPeerAddress(nativePtr);
+       }
+       
+       @Override
+       public String getExternalBodyUrl() {
+               return getExternalBodyUrl(nativePtr);
+       }
+       
+       @Override
+       public void setExternalBodyUrl(String url) {
+               setExternalBodyUrl(nativePtr, url);
+       }
+}
index 76874675d35a454be33fb5cf6ee7415a71196ac3..806e8b68ae1919e252509eb7c476b811f36a6596 100644 (file)
@@ -18,10 +18,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 package org.linphone.core;
 
+import org.linphone.core.LinphoneChatMessage.StateListener;
+
 class LinphoneChatRoomImpl implements LinphoneChatRoom {
        protected final long nativePtr;
+       private native long createLinphoneChatMessage(long ptr, String message);
        private native long getPeerAddress(long ptr);
        private native void sendMessage(long ptr, String message);
+       private native void sendMessage2(long ptr, long message, StateListener listener);
 
        protected LinphoneChatRoomImpl(long aNativePtr)  {
                nativePtr = aNativePtr;
@@ -34,4 +38,19 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
        public void sendMessage(String message) {
                sendMessage(nativePtr,message);
        }
+       
+       @Override
+       public void sendMessage(LinphoneChatMessage message, StateListener listener) {
+               sendMessage2(nativePtr, message.getNativePtr(), listener);
+               
+       }
+       @Override
+       public void sendMessage(Object opaque, String message) {
+               // ignore, deprecated.
+               
+       }
+       @Override
+       public LinphoneChatMessage createLinphoneChatMessage(String message) {
+               return new LinphoneChatMessageImpl(createLinphoneChatMessage(nativePtr, message));
+       }
 }
index 7d0be46e3957eb9353a0891dd718033eedc96ce0..a99509fa38ef5c5c44f39f9229098a56297103a6 100644 (file)
@@ -71,7 +71,7 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
                //Main library
                if (!hasNeonInCpuFeatures()) {
                        try {
-                               if (!isArmv7()) {
+                               if (!isArmv7() && !Version.isX86()) {
                                        System.loadLibrary("linphonearmv5"); 
                                } else {
                                        System.loadLibrary("linphonenoneon"); 
index c742ea313bc855485a22a8e825cddbd212b7b9b9..8a870cc0e90f95ed4e45895a044eb94283370747 100644 (file)
@@ -24,7 +24,6 @@ import java.io.IOException;
 
 class LinphoneCoreImpl implements LinphoneCore {
 
-       @SuppressWarnings("unused")
        private final  LinphoneCoreListener mListener; //to make sure to keep a reference on this object
        private long nativePtr = 0;
        private native long newLinphoneCore(LinphoneCoreListener listener,String userConfig,String factoryConfig,Object  userdata);
@@ -47,6 +46,7 @@ class LinphoneCoreImpl implements LinphoneCore {
        private native int getNumberOfCallLogs(long nativePtr);
        private native void delete(long nativePtr);
        private native void setNetworkStateReachable(long nativePtr,boolean isReachable);
+       private native boolean isNetworkStateReachable(long nativePtr);
        private native void setPlaybackGain(long nativeptr, float gain);
        private native float getPlaybackGain(long nativeptr);
        private native void muteMic(long nativePtr,boolean isMuted);
@@ -56,7 +56,7 @@ class LinphoneCoreImpl implements LinphoneCore {
        private native void sendDtmf(long nativePtr,char dtmf);
        private native void clearCallLogs(long nativePtr);
        private native boolean isMicMuted(long nativePtr);
-       private native long findPayloadType(long nativePtr, String mime, int clockRate);
+       private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels);
        private native int enablePayloadType(long nativePtr, long payloadType,  boolean enable);
        private native void enableEchoCancellation(long nativePtr,boolean enable);
        private native boolean isEchoCancellationEnabled(long nativePtr);
@@ -93,7 +93,6 @@ class LinphoneCoreImpl implements LinphoneCore {
        private native int getSignalingTransportPort(long nativePtr, int code);
        private native void setSignalingTransportPorts(long nativePtr, int udp, int tcp, int tls);
        private native void enableIpv6(long nativePtr,boolean enable);
-       private native void adjustSoftwareVolume(long nativePtr,int db);
        private native int pauseCall(long nativePtr, long callPtr);
        private native int pauseAllCalls(long nativePtr);
        private native int resumeCall(long nativePtr, long callPtr);
@@ -107,7 +106,10 @@ class LinphoneCoreImpl implements LinphoneCore {
        private native void setMediaEncryption(long nativePtr, int menc);
        private native boolean isMediaEncryptionMandatory(long nativePtr);
        private native void setMediaEncryptionMandatory(long nativePtr, boolean yesno);
-       
+       private native void removeCallLog(long nativePtr, long callLogPtr);
+       private native int getMissedCallsCount(long nativePtr);
+       private native void resetMissedCallsCount(long nativePtr);
+       private native String getVersion(long nativePtr);
        
        LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object  userdata) throws IOException {
                mListener=listener;
@@ -252,9 +254,9 @@ class LinphoneCoreImpl implements LinphoneCore {
        public synchronized boolean isMicMuted() {
                return isMicMuted(nativePtr);
        }
-       public synchronized PayloadType findPayloadType(String mime, int clockRate) {
+       public synchronized PayloadType findPayloadType(String mime, int clockRate, int channels) {
                isValid();
-               long playLoadType = findPayloadType(nativePtr, mime, clockRate);
+               long playLoadType = findPayloadType(nativePtr, mime, clockRate, channels);
                if (playLoadType == 0) {
                        return null;
                } else {
@@ -440,8 +442,9 @@ class LinphoneCoreImpl implements LinphoneCore {
                return codecs;
        }
        public synchronized boolean isNetworkReachable() {
-               throw new RuntimeException("Not implemented");
+               return isNetworkStateReachable(nativePtr);
        }
+       
        public synchronized void enableKeepAlive(boolean enable) {
                enableKeepAlive(nativePtr,enable);
                
@@ -470,7 +473,7 @@ class LinphoneCoreImpl implements LinphoneCore {
                enableIpv6(nativePtr,enable);
        }
        public synchronized void adjustSoftwareVolume(int i) {
-               adjustSoftwareVolume(nativePtr, i);
+               //deprecated, does the same as setPlaybackGain().
        }
 
        public synchronized boolean pauseCall(LinphoneCall call) {
@@ -703,35 +706,34 @@ class LinphoneCoreImpl implements LinphoneCore {
        {
                setCpuCountNative(count);
        }
-       private native void tunnelSetHttpProxyNative(long nativePtr, String proxy_host, int port, String username, String password);
-       @Override
-       public void tunnelSetHttpProxy(String proxy_host, int port,
-                       String username, String password) {
-               tunnelSetHttpProxyNative(nativePtr,proxy_host, port, username, password);
-       }
-
-       private native void removeCallLog(long nativePtr, LinphoneCallLog log);
-       public void removeCallLog(LinphoneCallLog log) {
-               removeCallLog(nativePtr, log);
-       }
-
-       private native int getMissedCallsCount(long nativePtr);
+       
        public int getMissedCallsCount() {
                return getMissedCallsCount(nativePtr);
        }
+       
+       public void removeCallLog(LinphoneCallLog log) {
+               removeCallLog(nativePtr, ((LinphoneCallLogImpl) log).getNativePtr());
+       }
 
-       private native void resetMissedCallsCount(long nativePtr);
        public void resetMissedCallsCount() {
                resetMissedCallsCount(nativePtr);
        }
        
+       private native void tunnelSetHttpProxy(long nativePtr, String proxy_host, int port,
+                       String username, String password);
+       @Override
+       public void tunnelSetHttpProxy(String proxy_host, int port,
+                       String username, String password) {
+               tunnelSetHttpProxy(nativePtr, proxy_host, port, username, password);
+       }
+       
        private native void refreshRegisters(long nativePtr);
        public void refreshRegisters() {
                refreshRegisters(nativePtr);
        }
+       
        @Override
        public String getVersion() {
-               // TODO Auto-generated method stub
-               return null;
+               return getVersion(nativePtr);
        }
 }
index cf5b3a30425f3b26449e3fb25192792b2e8bad91..0b7aa7f6e7a0141f9f37551e237f64ce87b49941 100644 (file)
@@ -75,7 +75,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
        private native int setRoute(long ptr,String uri);
        private native void enablePublish(long ptr,boolean enable);
        private native boolean publishEnabled(long ptr);
-       
+       private native void setContactParameters(long ptr, String params);
        
        public void enableRegister(boolean value) {
                enableRegister(nativePtr,value);
@@ -143,4 +143,8 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
        public boolean publishEnabled() {
                return publishEnabled(nativePtr); 
        }
+       @Override
+       public void setContactParameters(String params) {
+               setContactParameters(nativePtr, params);
+       }
 }
diff --git a/tutorials/AndroidTutorialNotifier.java b/tutorials/AndroidTutorialNotifier.java
deleted file mode 100644 (file)
index 7721f7d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-AndroidTutorialNotifier.java
-Copyright (C) 2010  Belledonne Communications, Grenoble, France
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-*/
-package org.linphone.core.tutorials;
-
-import android.os.Handler;
-import android.widget.TextView;
-
-/**
- * Write notifications to a TextView widget.
- * This is an helper class, not a test activity.
- * 
- * @author Guillaume Beraudo
- *
- */
-class AndroidTutorialNotifier extends TutorialNotifier {
-
-       private Handler mHandler;
-       private TextView outputTextView;
-       
-       public AndroidTutorialNotifier(Handler mHandler, final TextView outputTextView) {
-               this.mHandler = mHandler;
-               this.outputTextView = outputTextView;
-       }
-       
-       
-       @Override
-       public void notify(final String s) {
-               mHandler.post(new Runnable() {
-                       public void run() {
-                               outputTextView.setText(s + "\n" + outputTextView.getText());
-                       }
-               });
-       }
-}
diff --git a/tutorials/TutorialBuddyStatusActivity.java b/tutorials/TutorialBuddyStatusActivity.java
deleted file mode 100644 (file)
index 1bf4f98..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-TutorialBuddyStatusActivity.java
-Copyright (C) 2010  Belledonne Communications, Grenoble, France
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-*/
-package org.linphone.core.tutorials;
-
-import org.linphone.R;
-import org.linphone.core.LinphoneCoreException;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-/**
- * Activity for displaying and starting the BuddyStatus example on Android phone.
- *
- * @author Guillaume Beraudo
- *
- */
-public class TutorialBuddyStatusActivity extends Activity {
-
-       private static final String defaultSipAddress = "sip:";
-       private TextView sipAddressWidget;
-       private TextView mySipAddressWidget;
-       private TextView mySipPasswordWidget;
-       
-       private TutorialBuddyStatus tutorial;
-       private Handler mHandler =  new Handler() ;
-       private Button buttonCall;
-
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.hello_world);
-               sipAddressWidget = (TextView) findViewById(R.id.AddressId);
-               sipAddressWidget.setText(defaultSipAddress);
-
-               mySipAddressWidget = (TextView) findViewById(R.id.MyAddressId);
-               mySipAddressWidget.setVisibility(View.VISIBLE);
-               mySipPasswordWidget = (TextView) findViewById(R.id.Password);
-               mySipPasswordWidget.setVisibility(TextView.VISIBLE);
-               
-               
-               // Output text to the outputText widget
-               final TextView outputText = (TextView) findViewById(R.id.OutputText);
-               final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
-
-               
-               // Create BuddyStatus object
-               tutorial = new TutorialBuddyStatus(notifier);
-
-               
-               
-               // Assign call action to call button
-               buttonCall = (Button) findViewById(R.id.CallButton);
-               buttonCall.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               TutorialLaunchingThread thread = new TutorialLaunchingThread();
-                               buttonCall.setEnabled(false);
-                               thread.start();
-                       }
-               });
-
-               // Assign stop action to stop button
-               Button buttonStop = (Button) findViewById(R.id.ButtonStop);
-               buttonStop.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               tutorial.stopMainLoop();
-                       }
-               });
-       }
-       
-       
-       private class TutorialLaunchingThread extends Thread {
-               @Override
-               public void run() {
-                       super.run();
-                       try {
-                               String myIdentity = mySipAddressWidget.getText().length()>0?mySipAddressWidget.getText().toString():null;
-                               String myPassword = mySipPasswordWidget.getText().length()>0?mySipPasswordWidget.getText().toString():null;
-                               tutorial.launchTutorial(sipAddressWidget.getText().toString(), myIdentity, myPassword);
-                               mHandler.post(new Runnable() {
-                                       public void run() {
-                                               buttonCall.setEnabled(true);
-                                       }
-                               });
-                       } catch (LinphoneCoreException e) {
-                               e.printStackTrace();
-                       }
-               }
-       }
-}
diff --git a/tutorials/TutorialChatRoomActivity.java b/tutorials/TutorialChatRoomActivity.java
deleted file mode 100644 (file)
index f7dab4c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-TutorialChatRoomActivity.java
-Copyright (C) 2010  Belledonne Communications, Grenoble, France
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-*/
-package org.linphone.core.tutorials;
-
-import org.linphone.R;
-import org.linphone.core.LinphoneCoreException;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-/**
- * Activity for displaying and starting the chatroom example on Android phone.
- *
- * @author Guillaume Beraudo
- *
- */
-public class TutorialChatRoomActivity extends Activity {
-
-       private static final String defaultSipAddress = "sip:";
-       private TextView sipAddressWidget;
-       private TutorialChatRoom tutorial;
-       private Handler mHandler =  new Handler() ;
-       private Button buttonCall;
-
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.hello_world);
-               sipAddressWidget = (TextView) findViewById(R.id.AddressId);
-               sipAddressWidget.setText(defaultSipAddress);
-
-               // Output text to the outputText widget
-               final TextView outputText = (TextView) findViewById(R.id.OutputText);
-               final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
-
-               
-               // Create HelloWorld object
-               tutorial = new TutorialChatRoom(notifier);
-
-               
-               
-               // Assign call action to call button
-               buttonCall = (Button) findViewById(R.id.CallButton);
-               buttonCall.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               TutorialLaunchingThread thread = new TutorialLaunchingThread();
-                               buttonCall.setEnabled(false);
-                               thread.start();
-                       }
-               });
-
-               // Assign stop action to stop button
-               Button buttonStop = (Button) findViewById(R.id.ButtonStop);
-               buttonStop.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               tutorial.stopMainLoop();
-                       }
-               });
-       }
-       
-       
-       private class TutorialLaunchingThread extends Thread {
-               @Override
-               public void run() {
-                       super.run();
-                       try {
-                               tutorial.launchTutorial(sipAddressWidget.getText().toString());
-                               mHandler.post(new Runnable() {
-                                       public void run() {
-                                               buttonCall.setEnabled(true);
-                                       }
-                               });
-                       } catch (LinphoneCoreException e) {
-                               e.printStackTrace();
-                       }
-               }
-       }
-}
diff --git a/tutorials/TutorialHelloWorldActivity.java b/tutorials/TutorialHelloWorldActivity.java
deleted file mode 100644 (file)
index 60bd872..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-TutorialHelloWorldActivity.java
-Copyright (C) 2010  Belledonne Communications, Grenoble, France
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-*/
-package org.linphone.core.tutorials;
-
-import org.linphone.R;
-import org.linphone.core.LinphoneCoreException;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-/**
- * Activity for displaying and starting the HelloWorld example on Android phone.
- *
- * @author Guillaume Beraudo
- *
- */
-public class TutorialHelloWorldActivity extends Activity {
-
-       private static final String defaultSipAddress = "sip:";
-       private TextView sipAddressWidget;
-       private TutorialHelloWorld tutorial;
-       private Handler mHandler =  new Handler() ;
-       private Button buttonCall;
-
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.hello_world);
-               sipAddressWidget = (TextView) findViewById(R.id.AddressId);
-               sipAddressWidget.setText(defaultSipAddress);
-
-               // Output text to the outputText widget
-               final TextView outputText = (TextView) findViewById(R.id.OutputText);
-               final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
-
-               
-               // Create HelloWorld object
-               tutorial = new TutorialHelloWorld(notifier);
-
-               
-               
-               // Assign call action to call button
-               buttonCall = (Button) findViewById(R.id.CallButton);
-               buttonCall.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               TutorialLaunchingThread thread = new TutorialLaunchingThread();
-                               buttonCall.setEnabled(false);
-                               thread.start();
-                       }
-               });
-
-               // Assign stop action to stop button
-               Button buttonStop = (Button) findViewById(R.id.ButtonStop);
-               buttonStop.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               tutorial.stopMainLoop();
-                       }
-               });
-       }
-       
-       
-       private class TutorialLaunchingThread extends Thread {
-               @Override
-               public void run() {
-                       super.run();
-                       try {
-                               tutorial.launchTutorial(sipAddressWidget.getText().toString());
-                               mHandler.post(new Runnable() {
-                                       public void run() {
-                                               buttonCall.setEnabled(true);
-                                       }
-                               });
-                       } catch (LinphoneCoreException e) {
-                               e.printStackTrace();
-                       }
-               }
-       }
-}
diff --git a/tutorials/TutorialRegistrationActivity.java b/tutorials/TutorialRegistrationActivity.java
deleted file mode 100644 (file)
index 9467048..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-TutorialRegistrationActivity.java
-Copyright (C) 2010  Belledonne Communications, Grenoble, France
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-*/
-package org.linphone.core.tutorials;
-
-import org.linphone.R;
-import org.linphone.core.LinphoneCoreException;
-
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-/**
- * Activity for displaying and starting the registration example on Android phone.
- * 
- * @author Guillaume Beraudo
- *
- */
-public class TutorialRegistrationActivity extends TutorialHelloWorldActivity {
-
-       private static final String defaultSipAddress = "sip:";
-       private static final String defaultSipPassword = "";
-       private TextView sipAddressWidget;
-       private TextView sipPasswordWidget;
-       private TutorialRegistration tutorial;
-       private Button buttonCall;
-       private Handler mHandler =  new Handler();
-       private TextView outputText;
-
-
-       @Override
-       protected void onCreate(Bundle savedInstanceState) {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.hello_world);
-               sipAddressWidget = (TextView) findViewById(R.id.AddressId);
-               sipAddressWidget.setText(defaultSipAddress);
-               sipPasswordWidget = (TextView) findViewById(R.id.Password);
-               sipPasswordWidget.setVisibility(TextView.VISIBLE);
-               sipPasswordWidget.setText(defaultSipPassword);
-
-               // Output text to the outputText widget
-               outputText = (TextView) findViewById(R.id.OutputText);
-               final TutorialNotifier notifier = new AndroidTutorialNotifier(mHandler, outputText);
-
-               
-               // Create Tutorial object
-               tutorial = new TutorialRegistration(notifier);
-
-               
-               
-               // Assign call action to call button
-               buttonCall = (Button) findViewById(R.id.CallButton);
-               buttonCall.setText("Register");
-               buttonCall.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               TutorialLaunchingThread thread = new TutorialLaunchingThread();
-                               buttonCall.setEnabled(false);
-                               thread.start();
-                       }
-               });
-
-
-               Button buttonStop = (Button) findViewById(R.id.ButtonStop);
-               buttonStop.setOnClickListener(new View.OnClickListener() {
-                       public void onClick(View v) {
-                               tutorial.stopMainLoop();
-                       }
-               });
-       }
-       
-       
-       private class TutorialLaunchingThread extends Thread {
-               @Override
-               public void run() {
-                       super.run();
-                       try {
-                               tutorial.launchTutorial(
-                                               sipAddressWidget.getText().toString(),
-                                               sipPasswordWidget.getText().toString());
-                       } catch (LinphoneCoreException e) {
-                               e.printStackTrace();
-                               outputText.setText(e.getMessage() +"\n"+outputText.getText());
-                       }
-               }
-       }
-}