So currently I added shortcuts to my app but I have two different package name for two different versions of my app. Using ${applicationId} inside shortcuts.xml does not work nor does a string resource reference. How do I point my targetPackage to point to the different applicationId to my productFlavors in my app?
App Shortcuts were introduced in Android 7.1 (API level 25). App Shortcuts allow users to perform multiple actions within a short period of time with relatively less effort. Shortcuts let users quickly start common or recommended tasks within your app. You can have a maximum of five Shortcuts at a time for your application.
Here, android:resource will the source of your shortcuts. Create shortcuts.xml file under res/xml folder. Here, you can define all your static shortcuts. As you can see, the root element is <shortcuts>, inside which you can define multiple shortcuts using <shortcut> tag.
When trying to create an application that works across multiple generations of the Android platform, naturally you want your application to take advantage of new features on new devices, without sacrificing backwards compatibility. It may seem at the outset as though multiple APK support is the best solution, but this often isn’t the case.
In order to create your multiple APK chart, start out with a row of cells representing the various API levels of the Android platform. Throw an extra cell at the end to represent future versions of Android. Now just color in the chart such that each color represents an APK.
How do I point my targetPackage to point to the different applicationId to my productFlavors in my app?
Have a different shortcut XML file in each of your product flavors' flavorname/src/res/xml/
directories.
Using ${applicationId} inside shortcuts.xml does not work
At present, that is only for the manifest.
nor does a string resource reference
Ideally, this would work, but is not supported at the present time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With