The Android copy project does not cover the configuration method of the original project

Source: Internet
Author: User

Today, I want to discuss A question: how to copy the project on the android mobile phone without overwriting the configuration method of the original project, such as project A, I copy the code of Project, on the basis of Project A, I developed Project B. In this case, because of the package name or some of the configurations, Project A and Project B cannot run on A virtual machine or A real machine at the same time, to make A total of. Project B runs on mobile phones in a friendly way. Please use the following:

The company developed an android management system. The clients are divided into Super Users and ordinary users (I cannot figure out why I didn't control the permissions of the User Role and helped the two clients form a single client ); he is developed based on a common client. After development, he develops the Super Client directly on the code of the common client. Later, we found that each installation of the Super Client will overwrite the previous normal client. He thought a lot, for example, setting configuration in AndroidManifest. xml ~~~~ No solution is found.

The younger brother is not very familiar with the android mobile phone installation mechanism. He also tested the installation mechanism and finally figured out a set of methods.

In fact, android is installed on the package that starts the activity. Change the package name and then change the corresponding configuration in AndroidManifest. xml. The following describes the younger brother's method.

Create a new project and copy the project:



 

2.com. wanli. test is the original package name. I changed the copied package name to com. wanli. test. test.

3. We are not eager to modify the gen package name here. One trick is to allow gen to automatically modify its package name.

4. Click AndroidMainfest. There are 5 tags. Select the first Mainfest as follows:




 

5. expand the package drop-down box and you will be surprised to find a com. wanli. test. test package name. Click com. wanli. test. test, save, you will be more surprised to find that gen's package name is converted into com. wanli. test. test. Well. Just one step away from success. Click the fifth tag AndroidMainfest of AndroidMainfest and modify android: name = ". myTestOneActivity ", because it also changes when the package name is changed, it also changes the package name that starts the activity code import. After modification, everything will be OK.

6. Run two programs of the same version respectively:




Running at the same time: Haha, even the same name !!! Haha


From the wanli_smile Column

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.