简体   繁体   English

Linphone Android如何导入库项目?

[英]Linphone Android how to import the library project?

I am working on SIP application and using Linphone Library. 我正在研究SIP应用程序并使用Linphone库。 I am trying to make and run the build on the device but getting few issues 我试图在设备上制作并运行构建,但问题很少

I have setup the Android SDK and NDK set up on my Mac. 我在Mac上设置了Android SDK和NDK。 Now when i copy the repo via Terminal using command 现在,当我使用命令通过终端复制repo时

$ git clone git://git.linphone.org/linphone-android.git --recursive

And than to Makefile ran this code: 而且Makefile运行这段代码:

$make

在此输入图像描述 and Then it show's Build Successfull. 然后它显示的是Build Successfull。

Now i need to import this project into Eclipse and when i do this imported project (folder named "linphone-adroid") into my Eclipse it shows me alot's of projects i am confused which one should i use and if i choose all of them then it gives me lot's of errors in other's (Shown in image below) 现在我需要将这个项目导入Eclipse,当我将这个导入的项目(名为“linphone-adroid”的文件夹)导入我的Eclipse时,它向我展示了很多项目我很困惑应该使用哪一个,如果我选择所有这些项目那么它给了我很多其他的错误(如下图所示)

liblinphone-android --> Ran this on Device runs fine but when i call the numbers it changes it's view and shows duration 0:00 and does not calls the numbers then i have to press hang off button to dismiss the call. liblinphone-android - >在设备上运行这个运行正常,但是当我调用数字时它会改变它的视图并显示持续时间0:00并且不调用数字然后我必须按下挂断按钮来解除呼叫。 (Not able to make call's) (无法拨打电话)

在此输入图像描述

Please suggest me how should i import this project into my eclipse and what else scripts i need to run on the terminal to make it run. 请建议我如何将这个项目导入我的eclipse以及我需要在终端上运行的其他脚本以使其运行。 So far what i have did is right or wrong? 到目前为止我所做的是对还是错?

Yes , it worked finally. 是的,它终于奏效了。 After build using "make" command.I installed in my device using "make install". 使用“make”命令构建后。我使用“make install”安装在我的设备中。 Also generated sdk using "make linphone-sdk" And then simply imported in eclispe just like normal android project. 还使用“make linphone-sdk”生成sdk然后只需像普通的android项目一样在eclispe中导入。 Without any error it worked. 没有任何错误,它工作。 - thank god. - 感谢上帝。

In windows8 cygwin created many issues, so i did build the code using "make" command in MAC. 在windows8中,cygwin创建了许多问题,因此我使用MAC中的“make”命令构建代码。 And then simply imported in windows eclipse. 然后只需在windows eclipse中导入。 (some admin permission issue in MAC) Note: android-ndk-R9c was failed my build. (MAC中的一些管理员权限问题)注意:android-ndk-R9c在我的构建中失败了。 So then i tried with android-ndk-R9 without additional toolchain it worked great. 那么我尝试使用android-ndk-R9而没有额外的工具链,它工作得很好。 Android-ndk old versions available at ( http://page2rss.com/0dc3a880ab1762303011d69d18408917 ). Android-ndk旧版本可在( http://page2rss.com/0dc3a880ab1762303011d69d18408917 )获得。

after building the library you have to import it in eclipse 在构建库之后,你必须在eclipse中导入它
File -> New -> Other... -> Android -> Android Project from Existing Code -> Browse_your_project 文件 - >新建 - >其他... - > Android - >现有代码中的Android项目 - > Browse_your_project

Now open your application (Project which have activity) and assign linphone library which you have earlier loaded.... 现在打开你的应用程序(有活动的项目)并分配你之前加载的linphone库....
Right click on your project -> select Android tab from left hand side -> from the bottom library section, click on "Add..." -> you will see the listed library which you have in your eclipse workspace -> select correct one -> click "OK" -> now refresh and clean the project -> build and try to run 右键单击您的项目 - >从左侧选择Android选项卡 - >从底部库部分,单击“添加...” - >您将看到您在eclipse工作区中列出的库 - >选择正确的库 - >单击“确定” - >现在刷新并清理项目 - >构建并尝试运行

检查编码器集线器上linphone android的完整指南。

As suggested by @bhavana I was doing wrong while importing the linphone-android project into my eclipse. 正如@bhavana所建议的那样,在将linphone-android项目导入我的eclipse时我做错了。 The correct process is explained below- 正确的程序如下 -

Importing into Eclipse : After i have made the build then now i just need to import the project into eclipse. 导入Eclipse:在我完成构建之后,现在我只需要将项目导入到eclipse中。

Step1 : Go to eclipse click on File Menu then Import then select Existing Android Code into Workspace 步骤1 :转到eclipse,单击File Menu,然后单击Import,然后选择Existing Android Code into Workspace

Hit Next and Browse to the linphone-android project folder And Only tick linohone-android folder and Leave copy project into workspace untick Like the below image: 单击下一步并浏览到linphone-android项目文件夹并且只勾选linohone-android文件夹并将复制项目保留到工作区中取消勾选如下图所示: 在此输入图像描述

And hit finish. 并命中完成。 Now i right clicked on "linphone-android" (project name) and go to Properties and Java Build Path and then Order and Export and then reorder them as my image below and untick gcm.jar 现在我右键单击“linphone-android”(项目名称)并转到“属性和Java构建路径”,然后转到“订购和导出”,然后将它们重新排序为下面的图像并取消gcm.jar 在此输入图像描述

Hit OK And Boom No errors Now just run it on device or emulator. 点击OK和Boom没有错误现在只需在设备或模拟器上运行它。 (Cross check minimum target SDK matches with the device or emulator.) (交叉检查最小目标SDK与设备或模拟器匹配。)

The above steps worked fine for me. 以上步骤对我来说很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM