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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 16
Registered: ‎03-22-2013
My Device: 8520,9900,9930,9330,9790,9780
My Carrier: BlackBerry
Accepted Solution

How to launch Documents To Go Programmatically

Hello,

 

I am newbie at BB development. In my app I want to let user view document of type .txt ,.pdf , .doc etc.

I want to open the document using  ''Documents To Go" App which I suppose is by default in every  BB device(Since OS 6) . (Please correct me if I am wrong).

I got some info from following link.

http://stackoverflow.com/questions/2535727/launch-documents-to-go-app-from-third-party-blackberry-ap... 

 

The code given here is :

Invocation invocation = new Invocation(path);
Ragistry reg =  = Registry.getRegistry("<your app namespace.class>");
reg.invoke(invocation);

 

I am not getting what to put under <your app namespace.class> and "path" . I am not getting the full qualified path for 'Documents To Go'.

Please help.

 

Thanks in advance.

 

 

Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to launch Documents To Go Programmatically

welcome to the forums.

the path would be the location of the document you want to open.
your namespace is just the namespace qualifier of your app, like com.mycompany.myapp
it does not invoke DocsToGo targeted, but rather tells the system "hey, i have a doc file, can you handle that for me"

you can also see the invocation sample.
----------------------------------------------------------
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
Contributor
Posts: 16
Registered: ‎03-22-2013
My Device: 8520,9900,9930,9330,9790,9780
My Carrier: BlackBerry

Re: How to launch Documents To Go Programmatically

Thanks Simon_hain for Quick reply..

 

 

Contributor
Posts: 16
Registered: ‎03-22-2013
My Device: 8520,9900,9930,9330,9790,9780
My Carrier: BlackBerry

Re: How to launch Documents To Go Programmatically

Hi Simon_Hain,

 

I have tried the way you told but I am getting the following Exception  :

 

java.lang.IllegalArgumentException : Classname is not implemented.

 

This is my code..

public class DispDoc extends MainScreen 
{
	public DispDoc()
	{
		setTitle("Use the menu to open a document");
		MenuItem menu = new MenuItem("Open File", 40, 40)
		{
			public void run()
			{
				try
				{
					//Create the invocation request.
					Invocation invocation = new Invocation("file:///SDCard/Synopsis.docx");
					invocation.setAction(ContentHandler.ACTION_OPEN);
					
					//Use the registry to perform the invocation.
					Registry registry = Registry.getRegistry("PackageName.classname.class");
					registry.invoke(invocation);
					
				}
				catch (Exception ex)
				{
					System.out.println("Exception: " +ex.toString());
				}
			}
		}; 
		addMenuItem(menu);		
	}
}

 Am I mistaking in entering class path ?

I am getting exception at  following line..

 

Registry registry = Registry.getRegistry("PackageName.classname.class");

 Please help.

Thank you.

 

 

 

 

Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to launch Documents To Go Programmatically

replace this with the values of your own program
----------------------------------------------------------
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
Highlighted
Contributor
Posts: 16
Registered: ‎03-22-2013
My Device: 8520,9900,9930,9330,9790,9780
My Carrier: BlackBerry

Re: How to launch Documents To Go Programmatically

Registry registry = Registry.getRegistry("com.test.doc.DispDoc.class");

 Here,

com.test.doc is my package Name and DispDoc.class is class name.