Intent to handle files opened in browser ending .droid.txt

by Alec » Sun, 19 Apr 2009 02:13:06 GMT


Sponsored Links
 Hi Im having an issue with intents. Im attempting to have the google
browser open my application when it opens a blahblah.droid.txt however
am having no luck. Here's what ive got so far:

<activity android:name=".engines.droidTxtHandler">
                        <intent-filter>
                                <action 
android:name="android.intent.action.VIEW" />
                                <category 
android:name="android.intent.category.DEFAULT" />
                                <category 
android:name="android.intent.category.BROWSABLE" />
                                <data android:mimeType="text/*" 
android:scheme="http"
                                        android:host="*" 
android:pathPattern=".*\\.droid.txt" />
                        </intent-filter>
</activity>

Could anyone point out where im going wrong? At the moment the file
just opens in the browser.

Many thanks

Alec
--~--~---------~--~----~------------~-------~--~----~



Intent to handle files opened in browser ending .droid.txt

by CaptainFanatic » Tue, 26 May 2009 08:14:26 GMT


 I am having trouble with this too.

I have tried using a html file with a new mime type for my
application:

...
<head>
<meta http-equiv="Content-Type" content="application/myapp">
</head>
...

I have tried using .html and .myapp file extensions.

My intent filters are something like this:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="application/myapp" android:scheme="http" /
</intent-filter>

But my application is not started.

I have found a few different suggestions for this problem but none
have worked so far. Has anyone gotten this to work?

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Intent to handle files opened in browser ending .droid.txt

by Alec » Tue, 26 May 2009 16:28:25 GMT


 Hi,

Here's what i ended up using hopefully it will help you. This intent
only matches on the file name, not on the mimetype.

Let me know how you got on.

                        <intent-filter>
                                <action 
android:name="android.intent.action.VIEW"></action>
                                <category 
android:name="android.intent.category.DEFAULT"></
category>
                                <category 
android:name="android.intent.category.BROWSABLE"></
category>
                                <data android:scheme="http" android:host="*"
                                        android:pathPattern=".*\\.droid.txt" />
                        </intent-filter>

Alec



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Starting Text to Speech activity

Hi,

I can successfully call the code below from the parent process with
speaker.sayHello() and it works as expected.  What I want to do is to
call speaker.sayHello() from a livewallpaper rather than a foreground
activity.  I've tried to start the activity with this code in the
parent :-

Intent i = new Intent(context, speaker.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);

after removing these lines from the manifest :-

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

but I get a Force Close.  Can somebody point out what I'm doing wrong.

Thanks,
Simon.


speaker.java :-

import android.speech.tts.*;
import android.app.Activity;
import android.os.Bundle;

public class speaker extends Activity {
    /** Called when the activity is first created. */
        private static TextToSpeech myTts;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        myTts = new TextToSpeech(this, ttsInitListener);
    }
    private TextToSpeech.OnInitListener ttsInitListener = new
TextToSpeech.OnInitListener() {
        public void onInit(int version) {
        }
    };

   public static void sayHello()
   {
          String myText1 = "Hello";
          myTts.speak(myText1, 0, null);

   }
}



AndroidManifest.xml :-

<activity android:name=".speaker"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
</activity>

-- 

2. Emma code coverage for UI events on device

Hi,

I would like to measure the code coverage for the UI application
without using JUnit test cases. Is there any way that we can capture
the report for the user key events on the application which is running
on device.

Thanks,
Android user.

-- 

3. FourCC code for PixelFormat YCbCr_422_SP?

4. Good Cannels to Generate Larger Revenue

5. about late resume, when PowerManagerService write on to /sys/power/state to call late resume

6. App released but only tested using the emulator. Could you please test it to me?

7. how to read database of one application in another application using contentproviders