Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Opening downloaded files in Steel
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel  
View profile  
 More options Jun 12 2009, 2:31 am
From: Daniel <daniel.on...@gmail.com>
Date: Thu, 11 Jun 2009 23:31:38 -0700 (PDT)
Local: Fri, Jun 12 2009 2:31 am
Subject: Opening downloaded files in Steel
I recently took the plunge and bought a PDF viewer in the Market. This
has revealed one of the very few shortcomings of Steel compared to the
built-in browser, which allows you to invoke the relevant application
after the file finishes downloading.

It's hardly a super-huge hassle to simply save the file and open it
manually, but I just wanted to request this feature because it would
be pretty slick. It looks like all the built-in browser does to
achieve this effect is the following (run when an item in the download
list is clicked):

int filenameColumnId =
        mDownloadCursor.getColumnIndexOrThrow(Downloads._DATA);
String filename = mDownloadCursor.getString(filenameColumnId);
int mimetypeColumnId =
        mDownloadCursor.getColumnIndexOrThrow
(Downloads.COLUMN_MIME_TYPE);
String mimetype = mDownloadCursor.getString(mimetypeColumnId);
Uri path = Uri.parse(filename);
// If there is no scheme, then it must be a file
if (path.getScheme() == null) {
    path = Uri.fromFile(new File(filename));

}

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
    startActivity(intent);
} catch (ActivityNotFoundException ex) {

    new AlertDialog.Builder(this)
            .setTitle(R.string.download_failed_generic_dlg_title)
            .setIcon(R.drawable.ssl_icon)
            .setMessage(R.string.download_no_application)
            .setPositiveButton(R.string.ok, null)
            .show();

}

So if Steel did something similar (and simply did nothing if
startActivity failed due to no application associated with that MIME
type), that would be truly excellent!

   Daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kolbysoft  
View profile  
 More options Jun 12 2009, 8:54 am
From: kolbysoft <kolbys...@gmail.com>
Date: Fri, 12 Jun 2009 05:54:51 -0700 (PDT)
Local: Fri, Jun 12 2009 8:54 am
Subject: Re: Opening downloaded files in Steel
Daniel,

thanks for posting the code :) It's not like steel doesn't already do
it for video links. I'll look into adding a dialog after downloads are
finished to prompt the user to open the file.

However,
I was going to revamp the whole downloading part, to enable having
multiple asynchronous downloads, so I'm trying to avoid touching new
stuff for downloading before that's done.

Anyway, thanks for the suggestion, not sure when and how it will go in
yet,

Michael

On Jun 12, 2:31 am, Daniel <daniel.on...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »