Difference between revisions of "Efxclipse/Tutorials/Tutorial5"
(→Create a Mobile iOS App with RoboVM app on OS-X) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Efxclipse}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | } | + | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Create a Mobile iOS App with RoboVM app on OS-X = | = Create a Mobile iOS App with RoboVM app on OS-X = | ||
Line 75: | Line 6: | ||
<ol> | <ol> | ||
+ | <li>You need to have JDK8beta and JDK7u45 installed</li> | ||
<li><b>You need to have XCode and its command line tools installed</b></li> | <li><b>You need to have XCode and its command line tools installed</b></li> | ||
<li>Install additional Eclipse Plugin | <li>Install additional Eclipse Plugin |
Latest revision as of 15:08, 5 January 2014
Create a Mobile iOS App with RoboVM app on OS-X
In this tutorial we'll guide you through the creation of JavaFX iOS application using e(fx)clipse tooling. While development of the application is possible with the default e(fx)clipse tooling. You need to install an additional plugin to get the robovm support.
- You need to have JDK8beta and JDK7u45 installed
- You need to have XCode and its command line tools installed
- Install additional Eclipse Plugin
If you have downloaded our all in one download [1] (you need the nightly-sdk) no extra install is needed. In case you've not done so you need to post install additional features from [2]
- Navigate to the JavaFX project wizard
- Give the project a name
- Navigate to the last page
- The resulting project should look like this
- Open the Sample.fxgraph-File and add the following code
package application import org.eclipse.fx.ui.mobile.Deck import application.SampleController import org.eclipse.fx.ui.mobile.Card import javafx.scene.shape.Rectangle component Sample styledwith "application.css" controlledby SampleController { Deck id deck { cards : [ Card { name : "c1", center : Rectangle { ^id : "r1", width : 100, height : 100, onMouseClicked : controllermethod c1 } }, Card { name : "c2", center : Rectangle { ^id : "r2", width : 100, height : 100, onMouseClicked : controllermethod c2 } } ] } }
- Open the application.css and add the following selector definitions
Rectangle#r1 { -fx-fill: red; } Rectangle#r2 { -fx-fill: green; }
- Open the SampleController and make it look like this
package application; import javafx.fxml.FXML; import org.eclipse.fx.ui.mobile.Deck; import org.eclipse.fx.ui.mobile.TransitionType; public class SampleController { @FXML Deck deck; @FXML public void c1() { deck.moveTo("c2", TransitionType.SLIDE_LEFT); } @FXML public void c2() { deck.moveTo("c1", TransitionType.FADE); } }
- Bring up the Context-Menu on the Main.java and navigate to "Run As" > "Mobile Simulator"
A Java Application will launch showing the surface of a iPhone (you can modify screen size, ... in the launch configuration dialog)
- Bring up the Context-Menu on the Main.java and select "Generate RoboVM Build"
- Select the robovm-ant.xml and select "External Tools Configurations ..." in the toolbar menu
- Select "Ant" Build and press the "New" button and enter -Dbuild.compiler=javac1.7 in the arguments field
- Wait for some minutes ...
- When the Simulator comes up flip it to show in horizontal format
- In the outline of the ant-file open the context menu on "do-run-device" and select "Run As" > "Ant Build"
- Wait for some minutes ... (in the meanwhile connect your iPad/iPhone)