Follow steps below to download an image file to the mobile device and show the picture in the mobile application:
Step 1: Install the Appeon File Server. Detailed instructions can be found in Configuring and deploying Appeon File Server.
Step 2: Upload the image file to the Appeon File Server, and then download it from the Appeon File Server to the mobile device. Here are the specific steps:
-
Add Appeon Workarounds PBL to your PowerBuilder application.
-
Define a variable and create an instance for the AppeonFileService object.
-
Call of_logonfileserver to connect to the file server.
-
Call of_appeonupload to upload the image file to the file server.
-
Call of_appeondownload to download the image file from the file server to the mobile device.
The file is automatically saved to the %cachedir%/plugin/ directory. %cachedir% indicates the cache directory for the current mobile application. You can determine the cache directory by calling the AppeonGetCacheDir function.
-
Call of_logofffileserver to disconnect from the file server.
Step 3: Access the image file through AppeonGetCacheDir()+"/plugin/"+%filename% in your mobile application.
Alternatively, if you only need to show the image file in the application and does not need to download the image to the mobile device, you can also take advantage of an Appeon enhanced feature to efficiently implement it. Appeon has enhanced the PictureName property of the Picture/PictureButton/PictureHyperLink control, the DataWindow column's content (when Display as Picture option is on), and the DataWindow Bitmap function to support the Internet URL. Therefore, you can post the image file to a Web site that is accessible by the mobile device, and utilize the aforementioned features to directly show the picture in the mobile application.