Problem opening local files

226 views
Skip to first unread message

jared.thigpen

unread,
Mar 30, 2011, 2:57:10 PM3/30/11
to rhomobile
I am working on an application that is syncing binary files (icons and
pdfs) amongst its data. Once on the device, I need to be able to open
the pdf in whatever application is registered to handle them on the
device. I am attempting to do this using System.open_url in the
controller of my model and have had no luck.

On iOS, I get this in the log:

I 03/30/2011 13:51:33:250 b0457000 RhodesApp|
rho_sys_open_url: /Users/parivedamacbook/Library/Application Support/
iPhone Simulator/4.0.2/Applications/0411C7D7-3313-4C7D-B834-
F28FBBDBD78E/Documents/db/db-files/id_03302011125936711.pdf
I 03/30/2011 13:51:33:250 b0457000 RhodesApp|
rho_sys_open_url failed.

And I get a blank white screen.


On Android I get this:


APP| /data/data/com.rhomobile.rhobooksrhodes/rhodata/db/db-files/
id_03302011095148079.pdf
I/ActivityManager( 60): Starting activity: Intent
{ act=android.intent.action.CHOOSER cmp=android/
com.android.internal.app.ChooserActivity (has extras) }
D/PhoneWindow( 275): couldn't save which view has focus because the
focused view android.webkit.WebView@44f55bf8 has no id.

And I get a popup saying no applications can perform this action. This
happen on an AVD, as well as my personal Android device which
definitely has a program setup to handle pdf intents.

Anything in particular I'm doing wrong here? I am able to use the
synced icons simply by referencing them in the view, but trying to
open the pdfs (or the icons, I did try that as well) externally just
doesn't seem to want to work

jared.thigpen

unread,
Mar 30, 2011, 7:41:44 PM3/30/11
to rhomobile
Ok, so changing to WebView.navigate does successfully open the files
within a web browser. This is better than nothing but it would be much
more preferable to send the pdf request to the registered application
on the phone. Or in the case of iphone, to the document previewer,
maybe?

Is there anything else within the Rhodes framework that can accomplish
this? Am I looking at writing a native plugin?

jared.thigpen

unread,
Mar 30, 2011, 10:38:40 PM3/30/11
to rhomobile
Well, the WebView appears to only be a solutions for iOS. The Android
browser doesn't appear to support rendering a pdf. Which just
reinforces the need to do this with a local application.

I'm intrigued by the ability to create an intent link, the ones used
to open a Rhodes app from another application. Is it possible to setup
an intent link to open a specific package, such as a pdf application
like QuickOffice?

evgeny vovchenko

unread,
Mar 31, 2011, 12:07:29 PM3/31/11
to rhom...@googlegroups.com
Did you try:
System.open_url :
http://docs.rhomobile.com/rhodes/device-caps#system-class

?

--
You received this message because you are subscribed to the Google Groups
"rhomobile" group.
To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to
rhomobile+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rhomobile?hl=en.

jared.thigpen

unread,
Mar 31, 2011, 5:26:26 PM3/31/11
to rhomobile
Yes, my first post shows the results from open_url on both platforms.

I've opened a support ticket for this and Brian has said he thinks
it's a bug in open_url.

On Mar 31, 11:07 am, "evgeny vovchenko" <evgenyvovche...@gmail.com>
wrote:

Priya

unread,
Oct 7, 2015, 2:04:07 AM10/7/15
to rhomobile
I am experiencing the same problem. I have a pdf which i want to bundle in the app under app or app/public folder and want user to be able to open and view it. On android logs says cannot open rhodata/apps/file_name.pdf

Any suggestion ??

Thanks
Reply all
Reply to author
Forward
0 new messages