0

I am trying to make an app for Android Tv it is a screen saver app I am taking help from an official document from Google and this link

[https://android-developers.googleblog.com/2012/12/daydream-interactive-screen-savers.html]

Here is my manifest file the app is simply using DayDream Service to load the URL on WebView, if I install this app on my phone it works perfectly( am talking about the only installation, I still have a problem in running screen saver), but before that how do I resolve this error? "There was an error in parsing the package"

<?xml version="1.0" encoding="utf-8"?>

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

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:banner="@drawable/app_icon_your_company"
        android:icon="@drawable/app_icon_your_company"
        android:label="@string/app_name"
        android:logo="@drawable/app_icon_your_company"
        android:screenOrientation="landscape">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
        </intent-filter>
    </activity>
    <service
        android:name="Screensaver"
        android:exported="true"
        android:label="WebView">
        <intent-filter>
            <action android:name="android.service.dreams.DreamService" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </service>

    <activity
        android:name="SetURL"
        android:label="Dream URL"
        android:theme="@android:style/Theme.Translucent.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>
    <activity
        android:name="SetURLInteractive"
        android:label="Dream URL (Interactive)"
        android:theme="@android:style/Theme.Translucent.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>
</application>

rajat singh
  • 165
  • 1
  • 11
  • Check http://stackoverflow.com/questions/15407502/how-to-check-if-an-intent-can-be-handled-from-some-activity. If there is no app that handle the intent then there is nothing you can do – Raghunandan May 07 '17 at 11:59
  • @Raghunandan i have ttorrent installed on my phone but just for the sake of experiments i tried installing bitTorrent , utorrent also but nothing seems to be working for me , What i really think is that there is no such Intent handling function defined in torrent clients – rajat singh May 08 '17 at 05:28
  • you can check if a intent can be handled by existing apps on phone using PackageManager packageManager = getActivity().getPackageManager(); `if (intent.resolveActivity(packageManager) != null) { startActivity(intent); } else { Log.d(TAG, "No Intent available to handle action"); }` – Raghunandan May 08 '17 at 05:44
  • I tried this still same error _no app can handle this intent_ but i have installed each and every _ttorrent_ client application, i think there is something wrong with the type of the file i changed it to text/plain still no response am gonna leave this now as nothing is working – rajat singh May 08 '17 at 06:49
  • that code is only checks if there is an app that can handle your intent. – Raghunandan May 08 '17 at 07:11
  • okay, but i want to open the selected file in ttorrent application using intent i know the code to check if there is an app that handle intent, i just want to know how to open that file in ttorrent using intents which i am unable to do :( – rajat singh May 08 '17 at 17:08

0 Answers0