0

I have an android media player application and I want to set that default after installation . How can i do it? I am posting its manifest below . Any code will be appreciated .

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="mP.myplayer"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="mP.myplayer.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.MUSIC_PLAYER"/>
                <category android:name="android.intent.category.APP_MUSIC"/>
                <data android:mimeType="audio/*"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>
Renjith
  • 5,783
  • 9
  • 31
  • 42
Gaganpreet Singh
  • 886
  • 1
  • 9
  • 20

2 Answers2

5

You can't.

Third party developers cannot set their own app as default applications. Only the users of your app can do this on their own devices.

You can however, register to receive intents of the types your app supports so that users can select your app as their default. For example, to register your app as a music player, see here.

Community
  • 1
  • 1
Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
1

This is impossible. this can not be done using code . if one application need to set as default it must do by the user.not thrid party

Lahiruzz
  • 665
  • 1
  • 12
  • 24