Questions about using ApplicationID in Android Studio

Source: Internet
Author: User

Now I need to do a performance test on a feature of the project app, mainly testing how much power it consumes.

1. The way I think about it is that I need to test on the same phone, the same app that needs to be installed on the phone two times, the second installation does not overwrite the first installation.

In Android Studio, modify the Defaultconfig in Build.gradule directly.

Modify or add in the inside

ApplicationID "***.***.***"

As a result, two applications exist at the same time.


2. Next, when reading Versioncode (at Androidmanifest.xml),
Used a

Context.getpackagemanager (). Getpackageinfo (
PackageName, 0). Versioncode
Where PackageName was written directly as a string, resulting in the modification of ApplicationID without changing back

Next, I would have directly found Defaultproductflavor's Getapplicationid, intending to quote directly, to find

Com.android.builder.core can not directly reference (this I have to check the reference method) Finally, I directly quoted Context.getpackagename (), only to succeed.





Questions about using ApplicationID in Android Studio

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.