Following code is used to open PDF document through Mobile App. This code is working on Apple and Android phones. But I encounter this issue only on Android Samsung Tab E. Please advise if anyone else has same issue. Does this depend on adobe acrobat software which I have downloaded on my Tablet ? I have tried with 2 different Apps installed on the device to make sure App has enough compatibility with the software.
On opening screen, I provide link to open PDF file and when user opens the file, I will save the file and open it when ever it is needed. This is working on all other devices except on this particular tablet with version 7.1.1. Please suggest
Code to place the file:
Button b = new Button("Terms of Service");
b.getAllStyles().setTextDecoration(Style.TEXT_DECORATION_UNDERLINE);
b.addActionListener(e3 -> {
try {
FileSystemStorage fs = FileSystemStorage.getInstance();
final String homePath = fs.getAppHomePath();
String fileName = homePath + "Terms of Service.pdf";
Util.copy(Display.getInstance().getResourceAsStream(getClass(), "/Terms of Service
.pdf"),
fs.openOutputStream(fileName));
Display.getInstance().execute(fileName);
} catch (IOException ex) {
}
});
Code to retrieve the file:
Button devGuide = new Button("Terms");
devGuide.setUIID("TextField");
devGuide.addActionListener(e -> {
FileSystemStorage fs = FileSystemStorage.getInstance();
final String homePath = fs.getAppHomePath();
String fileName = homePath + "Terms of Service.pdf";
Display.getInstance().execute(fileName);
});