Note:- Some PPTs are available on my slideshare account related to android linphone project.
.............................................................................................................
1. org.linphone : This package has mostly all activities, fragments and important manager classes. Easily understandable by class name which class what will do.
2. org.linphone.compatibility : This package has compatibility classes for each android API level. To use notifications and gestures in different android versions.
3. org.linphone.gcm : This package has GCM service classes. Linphone uses SIP server for Push notifications to show chat, video call, etc. notification.
4. org.linphone.setup : This package has account setup classes. To register, login or manage user account.
5. org.linphone.ui : This package has user interface's widget classes. To manage action on widgets like call button, erase button, number button, on scrolling, on sliding drawer, etc.
.............................................................................................................
Now I am going to share some useful classes and codes:-
1. LinphoneCore : The LinphoneCore is the root for all liblinphone operations. You need only one per application.
LinphoneCore lc = LinphoneCoreFactory.instance().createLinphoneCore(listener, context)
Parameters:
listener(LinphoneCoreListener) - listener to receive notifications from the core.
context - an application context, on android this MUST be the android.content.Context object used by the application.
Throws: LinphoneCoreException
about listener class: create a class and implement LinphoneCoreListener and make an object "listener" and pass it.
you can also create it simply by using LinphoneManager in Linphone project:
LinphoneCore lc=LinphoneManager.getLc();
2. How to set/get register user details?
LinphonePreferences : This class uses setter and getter method for user info and every method is easily understandable.
To get default user index:
now using default account index, we can set or get user details easily.
LinphonePreferences : This class uses setter and getter method for user info and every method is easily understandable.
LinphonePreferences mPrefs = LinphonePreferences.instance();
To get default user index:
int account_index=mPrefs.getDefaultAccountIndex(); String user_name=mPrefs.getAccountUsername(account_index);
now using default account index, we can set or get user details easily.
3. How to initiate/terminate/accept call on a sip address?
LinphoneManager.getInstance().newOutgoingCall(AddressType address); //Or LinphoneManager.getInstance().newOutgoingCall(String to, String displayName);
Address/to can be user_name or user_name@sip.linphone.org beacuse interpretUrl(String to) method converts string to LinphonAddress(SIP Address). InterpretUrl is a method of LinphoneCore class.
To terminate call, use:-
LinphoneManager.getInstance().terminateCall();
To check current call status(After State than write dot than press CTRL+SHIFT for all other options) in any class:-
lc.getCurrentCall().getState()==LinphoneCall.State.Connected
where lc is LinphoneCore object.
If you implement LinphoneCoreListener in any class(as LinphoneManager.java has) than the below method will call on every change in call status:-
public void callState(final LinphoneCore lc,final LinphoneCall call, final State state, final String message) { //code here }
To accept call:-
lc.acceptCall(aCall) // lc is LinphoneCore object & aCall is LinphoneCall object.
4. How to send/recieve chat message?
To send message, pass destination sip address as parameter:
LinphoneChatRoom chat_room = lc.createChatRoom("sip:joe@sip.linphone.org"); //lc is object of LinphoneCore chat_room.sendMessage("Hello world");
To receive chat message, Implement LinphoneCoreListener in your class(as LinphoneManager.java
has) and textReceived method will call when you got message from someone.
void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from,String message) { //write code here to display message on gui. }
5. How to add video call support in running audio call?
//Obtain reference of current call LinphoneCall lCall = lc.getCurrentCall(); //lc is LinphoneCore object //Obtain configuration parameter copy for current call LinphoneCallParams params = lCall.getCurrentParamsCopy(); //Enable video params.setVideoEnabled(true); //Initiate reInvite lc.updateCall(lCall, params);
For more download excel sheet of Linphone notes(Check all tabs of excel sheet) and check official document.
Related Programs:-
★ Start Working on Linphone Android
★ Add Google AdMob Ads in Android App & Earn Money
★ Add Facebook SDK in Android Application
★ Android Twitter Fabric SDK Integration with user details in Android Studio
★ Advance Android Google Map 2 Tutorial with Examples - Part 1
in linphonerc_default (sample/res/raw) , I want to test a few samples. However, in readme it says:
ReplyDelete"[misc]
config-uri=INSERT_URL_TO_CONFIG_TO_TRY_HERE" which URL do I need to specify? thanks
This comment has been removed by a blog administrator.
ReplyDeleteThanks, really informative. Would like if a simple video call example can be shown
ReplyDeleteAfter set-up this project, you can call and chat. This is embedded in project already.
DeleteWhere is linphone.core package in that sample code???That package is missing
ReplyDeleteHi, I am not aware of new changes in Linphone. May be they changed packages.
DeleteThat is available in linphone's submodules folder.
DeleteIs there any method for message seen in Linphone?
ReplyDeleteHow to create LinphoneConferenceParams in android?
ReplyDeleteHi Sheena, This is an interface and you have to implement it to use methods of this interface. As I saw your question on stack-overflow. First make LinphoneCore object using: LinphoneCore lc=LinphoneManager.getLc(); than use: lc.createConference(this);
DeleteThank you Mohsin, but i got error with this code,
Deletelc.createConference(this); I got error here , they recommended Linphoneconferenceparams instead of context
Try this:-
Deletelc.createConference(new Linphoneconferenceparams(){
.....
});
Thank you Mohsin, Now i have an another issue
Deletewhen i call this method
chatRoom = lc.getOrCreateGroupChatRoom(groupName, groupMembers, groupSize, 0, 0);
i got an error
Error
--------
UnsatisfiedLinkError: No implementation found for long org.linphone.core.LinphoneCoreImpl.getOrCreateGroupChatRoom(long, java.lang.String, java.lang.String[], int, int, int) (tried Java_org_linphone_core_LinphoneCoreImpl_getOrCreateGroupChatRoom and Java_org_linphone_core_LinphoneCoreImpl_getOrCreateGroupChatRoom__JLjava_lang_String_2_3Ljava_lang_String_2III)
I'm not getting the idea as you described. Stuck in Linphone Core. Help me. !
ReplyDeleteHi,
ReplyDeleteI've cloned Linphone source from git://git.linphone.org/linphone-android.git and library from Linphone SDK from http://linphone.org/snapshots/android/liblinphone-android-sdk-latest.zip
I'm using Android Studio on Windows to open the project. I've correctly unzipped the library files to the /libs directory. But there is an error message on many of the source files on this import:
import org.linphone.tools.OpenH264DownloadHelper;
Error: cannot resolve symbol tools.
It seems that the liblinphone.jar file is missing the package tools
Any help would be greatly appreciated
Hi, Can you please tell me where you have put native libraries under folder(armeabi,armeabi-v7a,x86) inside your android application or in a linphone.jar ?
ReplyDeleteHi,
ReplyDeleteI'm working with android linphone source. Actually I haven't finished compiling yet. :-(
By the way..I want to add some other "media description" (not aduio/video) to the message body.
(e.g.) m=application 1234 RTP/AVP 102
Are there any APIs that i can use?
Thanks in advance.
hello i cant able to download excel sheet,its showing 404 error
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletesomeone listening? help me guys i need to integrate linphone in project and i don't have linux, am using windows + Android studio.
ReplyDeleteDon't. I tried building on windows and gave up. Not worth the trouble. Just get a Linux VM up, setup the environment by following the steps on the linphone android github, then build the project once successfully. It'll take about 30 minutes to build all the native modules. Once you have the native modules built once you can continue your project on the windows environment.
ReplyDeleteHi guys, could you please tell how to do echo cancecancel in linphone?
ReplyDelete