Opening pdf from mobile application

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Feb 28, 2012
Company:

Hi i am trying to open a pdf from a mobile application. I am using the following code. In windows it works fine but on Android nothing happens when i run this. No error no nothing. Anyone knows why?

Code
&AtClient
Procedure openFileTest(Command)
   SysInfo = New SystemInfo;
   if Find(SysInfo.PlatformType,"Windows") = 0 then
      path="/sdcard/Download";
   else
      path="c:\temp";
   endif;   
   
   BeginRunningApplication(New NotifyDescription("Attachable_EmptyHandler", ThisForm),"test.pdf",path);
   
   
   
EndProcedure


&AtClient

Procedure Attachable_EmptyHandler(CodeReturn, AdditionalParameters) Export

   Return;

EndProcedure

 
#2
People who like this:0Yes/0No
Administrator
Rating: 14
Joined: Oct 3, 2019
Company:

Hello Constantinos,

you are specifying an incorrect second parameter to the BeginRunningApplication procedure.

Here we need to pass the full name of the file that we want to open, including the path to it. The third parameter - Path - is optional and can be omitted.

Here's an example of how a call to this procedure might look like in Android:

Code
&AtClient
Procedure Command1(Command)
   
    BeginRunningApplication(New NotifyDescription("Attachable_EmptyHandler", ThisForm),"file:///storage/sdcard1/Downloads/test.pdf");   

EndProcedure

 
#3
People who like this:0Yes/0No
Administrator
Rating: 14
Joined: Oct 3, 2019
Company:

You can also read how to run third-party applications from mobile 1C in our blog:

https://1c-dn.com/blog/launching-third-party-applications-from-mobile-1c/

 
Subscribe
Be the first to know tips & trick on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.