Associate Browser to File Type

by tekmunki » Sat, 19 Jun 2010 03:12:38 GMT

Sponsored Links
 I'm attempting to write a simple app that associates a file type to
the browser;  this is assuming the browser will open the file
locally...  If this doesn't work, the local file - editor will be

I have an option of auto-mailing .ELC files from a custom app,  they
are basically html formatted TEXT or TXT only files;  I would like to
associate the .elc extension so that it will open direct from mail
rather than just "Save to SD Card" as a mail option.

Here's the code I'm at right now;

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="" ;
    <application android:icon="@drawable/icon" android:label="@string/
        <activity android:name=".ELCViewer"
                <action android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />
                <action android:name="android.intent.action.VIEW" />
android:name="android.intent.category.DEFAULT" />
android:name="android.intent.category.BROWSABLE" />
                <data android:mimeType="text/elc" />
                <data android:mimeType="application/elc" />
                <data android:mimeType="file/elc" />
    <uses-sdk android:minSdkVersion="2" ></uses-sdk>

package com.tekmunki.ELCViewer;

import android.os.Bundle;
import android.widget.TextView;

public class ELCViewer extends Activity {
   /** Called when the activity is first created. */
   public void onCreate(Bundle savedInstanceState) {
       TextView tv = new TextView(this);
       tv.setText("ELC Viewer Installed!  Now, when you receive the
ELC files, they will open in the browser.");

1) How do I make the browser associated with the ELCViewer Activity?
     (Do I need to make a second activity,  or can that all be done in
the manifest?)
2) How do I make it persist after the app has been ran once?


Other Threads

1. connection with Gdata : problem

I'm having the same problem.  Apparently lots of people are, judging
from searches I've done...



2. bug in maps, interprets link from email incorrectly

I emailed this link to myself (from google maps on computer's
browser). Opened Gmail on G1, selected the link.,+Hillsboro,+Washington,+Oregon+97124&hl=en&geocode=&mra=ls&sll=45.544711,-122.919974&sspn=0.020618,0.038624&ie=UTF8&ll=45.543479,-122.904353&spn=0.020619,0.038624&z=15

When I got it on the phone, I selected "Maps" application. The mapper
interpreted a journey of 2 miles to be a journey of 1800 miles.
Clearly broken. Started with some city in IA instead of my location

Selecting Browser instead of maps showed the correct location but the
route never appeared.


3. Official HOWTO for reflashing Dev 1 system image

4. Bitmap.getPixels()

5. Native method support - or - how to install a new codec

6. Adapting bionic libc for non-Linux kernels.

7. Regarding android registration