Live presentation: Top 10 Ways to Launch a Successful Mobile Project
Android apps manage permissions, device features, and other settings in the
AndroidManifest.xml file, which is located at
AndroidManifest.xmlmay reference additional files such as
@string. Read more about Android Resources.
This article covers the basic modifications you’ll need to make to your app. Read the Android Manifest docs to learn a whole lot more.
To change your app’s Package ID (aka
Application ID for Android), edit
<manifest> at the top of
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.capacitorjs.app"> + package="com.mycompany.myapp">
To change the name of your app, change the value for
It may make sense to change the activity name to match, especially if your app has a single activity:
For a Deep Links guide, see here.
To enable deeplinking through Android App Links, follow the official Android guide on Adding Android App Links. Android Studio comes with a handy wizard for configuring App Links.
Your app can respond to custom URLs on launch, making it possible to handle deeplinks and app interactions.
To change the URL, search for and modify this line in
strings.xml. It’s recommended to set this to the Package ID.
In this example, the app will respond to URLs with the
To get any custom URL the app may have launched with, see the Deeplinks section above.
In Android, permissions your app will need are defined in
AndroidManifest.xml inside of the
<manifest> tag, generally at the bottom of the file.
For example, here’s what adding Network permissions looks like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.getcapacitor.myapp"> <activity> <!-- other stuff --> </activity> <!-- More stuff --> <!-- Your permissions --> <!-- Network API --> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> </manifest>
Generally, the plugin you choose to use will ask you to set a permission. Add it in this file.