Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
bmorr
Posts: 318
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Open a file from data folder via invocation

oh sorry I misinterpreted it as you wanted users to be able to access and open a ppt file on the phone.  Only thing I would've suggested would be docs2go but you've already thought of that.

 

Just out of curiosity for my own knowledge, why wouldn't you just download the documents to the user's documents folder and just save the reference filepath on download for invocation afterwards?

Please use plain text.
Developer
simon_hain
Posts: 16,107
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Open a file from data folder via invocation


bmorr wrote:

Just out of curiosity for my own knowledge, why wouldn't you just download the documents to the user's documents folder and just save the reference filepath on download for invocation afterwards?


I have to manage the files, if the user leaves the page the file stays cached on the file system, but if the application is closed they get deleted.

The files are part of the app, i don't really want to put them into the users documents. I could use the shared folder, but then i would have the overhead of keeping track of them to delete them when the app is closed.

 

As only one app has the issue of not displaying the attachment file i suspect an error there, if it cannot be resolved i will have to consider other options, sure.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
bmorr
Posts: 318
Registered: ‎04-13-2013
My Device: Z10
My Carrier: Telus

Re: Open a file from data folder via invocation

Ok, thanks for the explanation.

Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 234
Registered: ‎07-14-2008
My Device: Not Specified

Re: Open a file from data folder via invocation

Simon,

I wonder if this is an issue with the cascades InvokeQuery class and not with the underlying invoke framework.. Would you be able to try the invocation framework directly via InvokeManager and InvokeRequest? 

 

I am investigating this as well.

 

Shadid

Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 234
Registered: ‎07-14-2008
My Device: Not Specified

Re: Open a file from data folder via invocation

Simon,

Can you please also provide logs when this fails?

 

Shadid

Please use plain text.
Developer
simon_hain
Posts: 16,107
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Open a file from data folder via invocation

Hi Shadid, thanks for taking a look.

 

Unfortunately using the invokeManager directly does not change the behavior. I do not get much of output in the logfile unfortunately.

Here is the test method i wrote:

void DataServiceUtil::invokeFile(QString mimeType, QString fileURI) {
	qDebug() << "invokeFile"<<fileURI<<mimeType;
	InvokeRequest fileRequest;
	fileRequest.setAction("bb.action.OPEN");
	fileRequest.setMimeType(mimeType);
	fileRequest.setUri(fileURI);
	fileRequest.setTarget("sys.dxtg.stg");
	invokeManager->invoke(fileRequest);
}

 The output:

Debug: 10:20:02.977 invokeFile "file:///accounts/1000/appdata/appID/data/Attachments/CB43CE5001F00149E10000000A0A1E49/Bar Code Beispiel.PPTX" "application/vnd.ms-powerpoint"  

All other debug output is just some console spam i get all the time (timezone changed etc).

I checked the location of the file using FileSystemExplorer and opened it on windows.

 

Edit:

I copied the file to the share folder and i am unable to open it from there as well (not with the file manager and not from docsToGo)

I created a new pptx to test and can open this one fine.

 

So it seems the issue is not related to invocation after all, but there is an issue with the file!

As it is a simple test file i have attached it.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 234
Registered: ‎07-14-2008
My Device: Not Specified

Re: Open a file from data folder via invocation

Thanks Simon. If the logs are not hinting much, is it possible for me to get a test app that reproduces this? I can grab detailed logs using internal tools. I could try to create a test app with the code snippets you provided but I also want to be on the same page by receiving a test app from you.

 

Shadid

Please use plain text.
Developer
simon_hain
Posts: 16,107
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Open a file from data folder via invocation


shaque wrote:

Thanks Simon. If the logs are not hinting much, is it possible for me to get a test app that reproduces this?

 

Shadid


please see the edit of my previous post, i was able to open another pptx successfully, it seems that only this specific file causes the problem.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.