简体   繁体   中英

How to change Project Name of Linphone in Android Studio?

I have successfully build the Linphone project for android on Mac and its working fine in Android Studio. Now I want to rename the package from

org.linphone

to

com.my.package.name

in the README it is given

To create an apk with a different package name
----------------------------------------------
You need to edit the custom_rules.xml file:
1) look for the property named "linphone.package.name" and change it value accordingly
2) also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears
3) update the path to the sounds in the linphonerc-factory files in the res folders and optionally change default sip account on linphonerc-default
4) run again the Makefile script by calling "make"

I follow the first 2 step, but do not understand the 3rd step. If I try to change the package name from Android Studio then it give me a lot of errors like do not find R file etc. Can anybody tell me the correct way to rename the package name of Linphone in Android Studio.

OR

Is it a good idea to use the Linephone SDK. I also have created the linphone.jar (with armeabi-v7a and x86) and placed in lib folder of other project but do not how to use these lib. in existing project.

If it is a simple issue of changing the package name then click the cog symbol in the top right of the package explorer and uncheck compact Empty Middle Packages. You can then right click each separate package name, re-factor and rename. When renaming the com prefix select Rename All if an error arises. When your finished check compact empty middle packages again and update the applicationID in build.gradle. For a more comprehensive guide follow this answer.

"If it is a simple issue of changing the package name then click the cog symbol in the top right of the package explorer and uncheck compact Empty Middle Packages. You can then right click each separate package name, re-factor and rename. When renaming the com prefix select Rename All if an error arises. When your finished check compact empty middle packages again and update the applicationID in build.gradle. For a more comprehensive guide follow this answer."

No it is not a simple issue! at my work we decided to build an app on top of Linphone. 1. problem change the package name.. ok so i did it, now i can upload the app to Google store! problem solved? no!!! if you try to run your app along side with the original linphone app it will crush! so ===> it will crush along side any other linphone based app (if the programmers done a bad job).

the solution? brute force! change any sub string in the project files named linphone to xxx(xxx=your app name) change all files names containing the name linphone to xxx(xxx=your app name) change all directories names containing name linphone to xxx(xxx=your app name) do the same thing with the string Linphone. (capital latter.)

it took me 3 days! to solve this, the only solution was the brute force, the only affective way i found to solve the collusion errors. in my work i used a simple python script to the job.. it is really simple, the hard part was to think about this brute-force solution. Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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