I currently have the following problem:
I have created a narrowcasting client for in a shop, which runs on a Raspberry Pi 2B model. Specs: Quad-core 900MHz ARM Cortex A7-processor (BCM2836 chipset), 1024MB RAM LPDDR2 and 16GB MicroSD is of class 10.
I have installed the latest JDK and extended it with the JavaFX packages (as stated in the first answer here). JavaFX is running now, so that should be fine.
However, when I try to run my application, the animations run very slow (see this video). I am using the code below for the animations:
public void initImagesTransitions() {
EventHandler<ActionEvent> fadeIn = event -> {
TranslateTransition in = new TranslateTransition(Duration.seconds(1), imageHolder);
in.setFromY(-(SystemUtils.getScreenHeight()+100));
in.setToY(-80);
in.setCycleCount(1);
in.play();
imageHolder.setVisible(true);
};
EventHandler<ActionEvent> zoomIn = event -> {
ScaleTransition st = new ScaleTransition(Duration.millis(5000), imageHolder);
st.setByX(0.8f);
st.setByY(0.8f);
st.setCycleCount(1);
st.play();
};
EventHandler<ActionEvent> fadeOut = event -> {
TranslateTransition out = new TranslateTransition(Duration.seconds(1), imageHolder);
out.setToY(500+SystemUtils.getScreenHeight());
out.setCycleCount(1);
out.play();
out.setOnFinished(e -> imageHolder.setVisible(false));
};
Timeline timeline = new Timeline(
new KeyFrame(Duration.ZERO, fadeIn),
new KeyFrame(Duration.seconds(3), zoomIn),
new KeyFrame(Duration.seconds(19), fadeOut)
);
timeline.playFromStart();
}
So nothing special there in my opinion. The Raspberry Pi is only using 30% CPU, so this is also unclear to me. The only other thing running in the background is a like-checker which communicates with my server API every minute.
Anyone any clue on why the animations are slow?
Any help is greatly appreciated!