| NEWS | | |  | | FORUMS | | |  | | FREEWARE | | |  | | ABOUT US | | |  | |
05-09-2007, 08:29 AM
|
#1 | | Lost in the wires.
Join Date: Mar 2006
Posts: 808
| Programaticaly Open Files with DocsToGo Hello!
I'm writing an app that needs to open doc files form the card through DocsToGo.
What I dont want is use the Exchange Manager to perform a local beaming since this will cause duplication of the file in RAM.
I know there is a way to do it (resco explorer is doing it for example) but I can't find how. According to Dataviz, DocsToGo has no public API.
Any ideas?
Many Thanks! |
| |
05-09-2007, 09:17 AM
|
#2 | | Lifeflash'd and loving it
Join Date: Nov 2006 Location: Phoenix AZ US
Posts: 1,537
| You can always have iit copy to RAM and set the recyclable bit on the RAM copy, just be sure to keep it open till the program exits (at this point the RAM copy would be deleted.)
Just a suggestion,
__________________
[b] /*PhreakOnALeash*/
Ryan Rix -- KDE Developer, HomePage |
| |
05-09-2007, 11:43 AM
|
#3 | | Programmer by Grace
Join Date: Nov 2005
Posts: 1,318
| My guess would be that Resco temporarily creates the file in RAM, then deletes it when you exit Docstogo.
__________________ Software Development Versions - here
developer AT programmerbygrace dot com
|
| |
05-09-2007, 12:36 PM
|
#4 | | Registered User
Join Date: Feb 2005 Location: SW, VA, USA
Posts: 937
| I think (my memory could be faulty) what you are looking for is in the Exchange Manager. I recall the Exchange Manager supports different ways to "launch" a file, one of which is "Yo launch this file on the SD" without actually "sending" the file to the application only the reference to where the file is. Information in the Exchange Manager's MIME tables note if a given handler can handle this type of exchange. |
| |
05-09-2007, 03:30 PM
|
#5 | | Lifeflash'd and loving it
Join Date: Nov 2006 Location: Phoenix AZ US
Posts: 1,537
| Quote: | Originally Posted by potter I think (my memory could be faulty) what you are looking for is in the Exchange Manager. I recall the Exchange Manager supports different ways to "launch" a file, one of which is "Yo launch this file on the SD" without actually "sending" the file to the application only the reference to where the file is. Information in the Exchange Manager's MIME tables note if a given handler can handle this type of exchange. |
I have gone through the docs for about a minute (companion pI/II, reference) and can find no refernce to YoLaunchThisFileOnSD()  . Methinks that the easiest situation would be to just launch it with the exchange manager, and clear the RAM cop afterwards.
__________________
[b] /*PhreakOnALeash*/
Ryan Rix -- KDE Developer, HomePage |
| |
05-09-2007, 04:42 PM
|
#6 | | Lost in the wires.
Join Date: Mar 2006
Posts: 808
| @phreakonaleash: Yeah it does seem to be the easiest way of doing it.
What I don't get is that if I use the exchange manager to beam the file to Docs To Go, control will go to it automaticaly (which is great). When I exit DocsToGo though won't it send me back to the launcher? If so, how can I set the recyclable property?
I did dig up this: Code:
When the File Browser wants to open a file, it does so through the Exchange
Manager. Applications typically receive sysAppLaunchCmdExgReceiveData to open
files. The application won’t receive a sysAppLaunchCmdExgAskUser sublaunch but will
receive a sysAppLaunchCmdExgReceiveData sublaunch, just as it would for incoming
beams.
Applications should check the name field in the socket to see if it is a “file:” URL. If so,
the application should set the goToCreator field in the socket to its own creator ID.
It can then proceed as if a beam was received, but it shouldn’t create a new record.
Instead, it should store the parsed data somewhere temporarily and set the
goToParams struct in the socket to refer to this temporary area.
The wrapper function is as follows:
static Char *ParseFileURL (const Char *url, UInt16 *volRefNumP)
{
Char *path = NULL;
UInt16 refNum;
Err err;
err = SysLibFind(kFileBrowserLibName, &refNum);
ErrFatalDisplayIf(err, "Can't find file browser lib");
err = FileBrowserLibOpen(refNum);
ErrFatalDisplayIf(err, "Can't open file browser lib");
FileBrowserLibParseFileURL(refNum, url, volRefNumP, &path);
FileBrowserLibClose(refNum);
return path;
}
The fileBrowserlib only exists on devices with the Files app right? |
| |
05-09-2007, 04:47 PM
|
#7 | | Lost in the wires.
Join Date: Mar 2006
Posts: 808
| @I love my mom
I'm sure they use a different way... There is no delay to allow for the copying of the file to RAM. Possibly a private API someone needs to pay for? |
| |
05-09-2007, 04:53 PM
|
#8 | | Programmer by Grace
Join Date: Nov 2005
Posts: 1,318
| Probably not, if they're using ARM it'll make things much faster. But there could be..
What you should do is manually copy the file to RAM, set the bit, then open it with SysAppLaunchOpenDB.
Anyway that's what I'd do.
__________________ Software Development Versions - here
developer AT programmerbygrace dot com
|
| |
05-09-2007, 04:59 PM
|
#9 | | Lifeflash'd and loving it
Join Date: Nov 2006 Location: Phoenix AZ US
Posts: 1,537
| Quote: | Originally Posted by I love my mom 1)Probably not, if they're using ARM it'll make things much faster. But there could be..
2)What you should do is manually copy the file to RAM, set the bit, then open it with SysAppLaunchOpenDB.
Anyway that's what I'd do. |
1) ARMing it, imho, won't speed it up as you are using the PACE APIs to do it.
2) I believe this is the best way.
__________________
[b] /*PhreakOnALeash*/
Ryan Rix -- KDE Developer, HomePage |
| |
05-09-2007, 05:08 PM
|
#10 | | Lost in the wires.
Join Date: Mar 2006
Posts: 808
| OK copying to RAM it is then! 
But how can I copy a native file to the Palm? |
| |
05-09-2007, 05:18 PM
|
#11 | | Lifeflash'd and loving it
Join Date: Nov 2006 Location: Phoenix AZ US
Posts: 1,537
| Try consulitng the files stream API documentation.
__________________
[b] /*PhreakOnALeash*/
Ryan Rix -- KDE Developer, HomePage |
| |
05-10-2007, 07:26 AM
|
#12 | | Programmer by Grace
Join Date: Nov 2005
Posts: 1,318
| Quote: | Originally Posted by phreakonaleash 1) ARMing it, imho, won't speed it up as you are using the PACE APIs to do it. |
Aye, but it will. You don't have to use the PACE APIs. Take a look at Pruss' apps like cmenu.
Maybe you'll end up using the Beaming API 
__________________ Software Development Versions - here
developer AT programmerbygrace dot com
|
| |
05-10-2007, 01:48 PM
|
#13 | | Lifeflash'd and loving it
Join Date: Nov 2006 Location: Phoenix AZ US
Posts: 1,537
| :-D well you 'can' do that... But what is the purpose? Rewriting something that should be perfectlly fine as a 68k code is redundant and really a time waster imho.
__________________
[b] /*PhreakOnALeash*/
Ryan Rix -- KDE Developer, HomePage |
| |
05-10-2007, 02:07 PM
|
#14 | | Registered User
Join Date: Feb 2005 Location: SW, VA, USA
Posts: 937
| Quote: | Originally Posted by phreakonaleash I have gone through the docs for about a minute (companion pI/II, reference) and can find no refernce to YoLaunchThisFileOnSD()  . | I went searching for what I recalled. It took me a while. I did find it. It was not in Access/PalmSource's SDK. It was in Palm's SDK. Section 9.2 of the Palm Developer Guide, Palm OS Platform documents the so called "File Browser API". Alas, according to the documentation, this API is only on the LifeDrive and the T5. Hmm, further reading may be needed. |
| |
05-10-2007, 02:10 PM
|
#15 | | Lifeflash'd and loving it
Join Date: Nov 2006 Location: Phoenix AZ US
Posts: 1,537
| It is 'only on the t5/ld' yes. However, you CAN distribute the library (I am in doubt about the legality of this, however) and you will have full acces to the File Browser API.
I suppose it would be easier (and legaller probably) to create a function that could do that, using the way Luke and I came up with.
__________________
[b] /*PhreakOnALeash*/
Ryan Rix -- KDE Developer, HomePage |
| | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 01:24 AM. | |