'Can I use same package name for Android Mobile and Android TV apps for play store?

I have created apps for a streaming video site and offer apps on both android phone, and android tv. Code will be different, I am using different code to target different platforms, but they’ll be the same app with same functionality and same package name. So can I upload it to play store under same package name? If Yes, then How? Any help will be appreciable.



Solution 1:[1]

Ok so to upload multiple apks(tv & mobile both at same time) in same upload. I just followed the steps as below.

1.) Define below feature in manifest when are creating an apk for mobile/tablet device.

<uses-feature android:name="android.hardware.touchscreen" 
 android:required="true"/>
<uses-feature android:name="android.software.leanback" 
 android:required="false" />
   

2.) Define below feature in manifest when are creating an apk for tv device.

<uses-feature android:name="android.hardware.touchscreen" 
 android:required="false"/>
<uses-feature android:name="android.software.leanback" 
 android:required="true" />

Note:- Both the apk needs different version code(for example:- tv apk contains versionCode as "12" then mobile apk contains versionCode as "13") so before generating apk you must update the version code. Also the above 2 conditions may vary as per the target device.

For amazon store upload check for this link:- https://www.geeksforgeeks.org/how-to-publish-your-android-app-on-amazon-app-store-for-free/

Solution 2:[2]

Yes, you can upload a mobile APK and a TV APK that have the same package name to the Play Store. This works the similarly to if you have two APKs for different architectures. The TV APK will have the leanback feature required and touch screen not required, which prevents it from overlapping with the mobile APK (which requires touch screen).

The Play console allows you to upload multiple APKs either at the same time or separately. Note that for TV you have to specifically opt in to TV distribution in the Play console. You also need to make sure the version number is unique for each build (e.g., you can have version 123 for mobile and then upload version 123 for TV).

You can read additional details at https://developer.android.com/google/play/publishing/multiple-apks

Solution 3:[3]

You can publish a single app for both platforms. In the manifest file, you need to define different activities.
For TV:

<activity android:name=".ui.MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    </intent-filter>
</activity>

For mobile:

<activity android:name=".mobile.MobileWelcomeActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Ian G. Clifton
Solution 3 sdex