2017-12-24 48 views
0

私はAndroid Music Playerアプリケーションを開発しています。音声で再生と検索の曲を制御するため、Google Assistantと統合したいと考えています。 official documentationの指示に従って、私のアプリですでにMedia Sessionを実装しました。私のアプリで何かを再生するアシスタントを要求する場合私のアプリをGoogle Assistantのデフォルトの音楽サービスとして定義します

、私は「MyAppのいくつかのアーティストを再生する」のようなものを言っています。 「Play some artist」と言うと、アシスタントはデフォルトの音楽プロバイダを設定していないことを伝えます。

これは、Googleアシスタントアプリで、次の画面に私をリード:私はのMyAppは「あなたの音楽サービス」に記載されていないことに注意してください

enter image description here

。 私の質問は次のとおりです。デフォルトの音楽サービスとして選択できるようにするには、アプリで何を変更する必要がありますか?現時点では

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="fr.nihilus.music"> 

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 

    <uses-feature 
     android:name="android.hardware.audio.output" 
     android:required="true" /> 

    <application 
     android:name=".NihilusMusicApplication" 
     android:allowBackup="true" 
     android:fullBackupContent="@xml/backup" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:roundIcon="@mipmap/ic_launcher_round" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme" 
     tools:ignore="GoogleAppIndexingWarning"> 

     <!-- Main activity for music browsing. --> 
     <activity 
      android:name=".HomeActivity" 
      android:launchMode="singleTop" 
      android:theme="@style/AppTheme.NoActionBar"> 

      <!-- Make this Activity visible in launcher --> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 

      <!-- Make this activity available as the default music app. --> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.APP_MUSIC" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 

      <!-- Intent filter that enables voice searches, such as "Play the Beatles" --> 
      <intent-filter> 
       <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" /> 

       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 

      <meta-data 
       android:name="android.app.default_searchable" 
       android:value=".ui.SearchResultActivity" /> 
      <meta-data 
       android:name="android.app.shortcuts" 
       android:resource="@xml/shortcuts" /> 
     </activity> 

     <!-- Activity showing detail and tracks of an album. --> 
     <activity 
      android:name=".ui.albums.AlbumDetailActivity" 
      android:parentActivityName=".HomeActivity" 
      android:theme="@style/AppTheme.NoActionBar" /> 

     <!-- Activity for toggling user preferences. --> 
     <activity 
      android:name=".settings.SettingsActivity" 
      android:label="@string/action_settings" 
      android:parentActivityName=".HomeActivity" /> 

     <!-- 
      Activity to be opened as a dialog window when a track is selected 
      from the file explorer. 
     --> 
     <activity android:name=".FileViewerActivity" 
      android:theme="@style/AppTheme.FileViewer" 
      android:excludeFromRecents="true"> 
      <intent-filter> 
       <action android:name="android.intent.action.VIEW" /> 

       <category android:name="android.intent.category.DEFAULT" /> 

       <data 
        android:mimeType="audio/*" 
        android:scheme="content" /> 
      </intent-filter> 
     </activity> 

     <!-- 
      Main music service, provides media browsing and media playback services to 
      consumers through MediaBrowserService and MediaSession. Consumers connect to it through 
      MediaBrowser (for browsing) and MediaController (for play session control) 
     --> 
     <service 
      android:name=".service.MusicService" 
      android:exported="true" 
      android:label="@string/playback_service_label" 
      android:process=":musicplayer" 
      tools:ignore="ExportedService"> 
      <intent-filter> 
       <action android:name="android.media.browse.MediaBrowserService" /> 
      </intent-filter> 
     </service> 

     <!-- 
      A receiver that will receive media buttons and send as intents to MusicService. 
      Required on pre-Lollipop. 
     --> 
     <receiver android:name="android.support.v4.media.session.MediaButtonReceiver"> 
      <intent-filter> 
       <action android:name="android.intent.action.MEDIA_BUTTON" /> 
      </intent-filter> 
     </receiver> 
    </application> 

</manifest> 

答えて

0

Googleのアシスタントは、リスト内の特定のパートナーのアプリを許可します。あなたの情報については

は、ここにマニフェストファイルです。パートナーには、あなたがしていることを正確には分かりません。大手音楽プロバイダーの企業に所属している場合は、Google Business Developmentの担当者が、適切な人とつながるはずです。

Googleとまだ連絡がない場合は、このページにさまざまな連絡先オプションがあります。https://developers.google.com/actions/「1日目から必要なサポートを受ける」セクションにあります。私はこれ以上試したいと思います。うまくいけば、あなたは正しいチームにあなたを連れて行きます。

関連する問題