How can I reference these assets then using a file:// or similar syntax, so
that when starting them as an intent it will safely expose it to a PDF
viewer already installed on the device?
For instance, let's assume that I've got a Moto Droid 1 with Quickoffice
preinstalled. I'm using code like:
Uri path = Uri.parse("... what goes here???");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
....
this.ctx.startActivity(intent);
It continuously has problems loading the file, claiming the file does not
exist.
On Tue, Jul 19, 2011 at 8:29 AM, Mark Murphy <[email protected]>wrote:
> If they are "packaged in the app" (i.e., assets or raw resources),
> they are already exposed, as all such things are read-only to all
> applications on the device.
>
> On Mon, Jul 18, 2011 at 11:15 AM, rbastic <[email protected]> wrote:
> > I need to display a set of PDF files from within my Android
> > application. I'm trying to figure out the Android security system and
> > whether or not content providers will work. It seems that calling
> > grantUriPermission() would be a good idea, but I'm having problems
> > figuring that out.
> >
> > Do I need to get the list of available intents using something like
> > queryIntentActivities()? If so, how can I pull package names out of
> > the ResolveInfo object for passing to grantUriPermission()?
> >
> > Everything works fine if I push the PDF files to the sdcard, but that
> > is not desirable for security purposes. I would like to keep the PDFs
> > packaged inside the app and only expose access to them when necessary.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
> >
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
--
Ryan Bastic
IT Specialist
Allen Resources, Inc.
http://www.AllenResources.com
1130 Ten Rod Road
Building E, Suite 101
North Kingstown, RI 02852
phone: 401-667-0487
fax: 401-667-0488
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en