Your SlideShare is downloading. ×
RoboVM
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

RoboVM

9,968
views

Published on

Published in: Technology, Education

0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
9,968
On Slideshare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
28
Comments
0
Likes
8
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. JJUG CCC @tikemin 13年11月9日土曜日
  • 2. Attention 13年11月9日土曜日
  • 3. Biographi • @tikemin • えすあいあー • JJUGとは今年の4月から • 本格的にJava始めたのもそのぐらい • Bio:Web/Embedded/Robo もの作りが趣味 13年11月9日土曜日
  • 4. RoboVM 13年11月9日土曜日
  • 5. What is RoboVM • Compiler translates Java bytecode into native ARM or x86 code • RoboVM 0.0.6 • Niklas Therning(@robovm) • Apache License v2.0 • Alpha software Java Translator 13年11月9日土曜日
  • 6. iOS app development according to java J2ObjC • An open-source command-line tool from Google • Translator tool Java code to Objective-C for the iOS platform • Does not provide any sort of platform-independent UI toolkit Apps that use J2ObjC 13年11月9日土曜日
  • 7. What is RoboVM • Warning! RoboVM is alpha software. It's not yet ready for production use. Expect to be bitten by bugs. If you find a bug, please report it. • It is not enough to use for iOS applications... But last update is 1 week ago 13年11月9日土曜日
  • 8. Hello RoboVM 13年11月9日土曜日
  • 9. Hallo RoboVM How to Install(Eclipse) • install new Software 13年11月9日土曜日 http://download.robovm.org/eclipse/
  • 10. Hallo RoboVM • How to Install • command line tool http://download.robovm.org/robovm-0.0.6.tar.gz only donwload and unpack it 13年11月9日土曜日
  • 11. Hello RoboVM 1 public class HelloWorld { 2 public static void main(String[] args) { 3 System.out.println("Hello world!"); 4 } 5 } mkdir classes javac -d classes/ HelloWorld.java robovm-0.0.6/bin/robovm -verbose -cp classes/ HelloWorld Let s try Build 13年11月9日土曜日
  • 12. You ll wait too long time A simple class like HelloWorld References about 1500 classes directly or indirectly. RoboVM keeps a cache of compiled classes and only recompiles a class when it or any of its direct dependencies have changed. HelloWorld/lib/boot/robovm-rt.jar HelloWorld/lib/classes0.jar HelloWorld/HelloWorld Let's take a quick peek at the contents of the HelloWorld folder 13年11月9日土曜日
  • 13. iOS Demo 6 public class IOSDemo extends UIApplicationDelegate.Adapter { 7 8 private UIWindow window = null; 9 private int clickCount = 0; 10 11 @Override 12 public boolean didFinishLaunching(UIApplication application, 13 NSDictionary launchOptions) { 14 15 final UIButton button = UIButton.fromType(UIButtonType.RoundedRect); 16 button.setFrame(new CGRect(115.0f, 121.0f, 91.0f, 37.0f)); 17 button.setTitle("Click me!", UIControlState.Normal); 18 19 button.addOnTouchUpInsideListener(new UIControl.OnTouchUpInsideListener() { 20 @Override 21 public void onTouchUpInside(UIControl control, UIEvent event) { 22 button.setTitle("Click #" + (++clickCount), UIControlState.Normal); 23 } 24 }); 25 26 window = new UIWindow(UIScreen.getMainScreen().getBounds()); 27 window.setBackgroundColor(UIColor.lightGrayColor()); 28 window.addSubview(button); 29 30 window.makeKeyAndVisible(); 31 32 return true; 33 } ... 13年11月9日土曜日
  • 14. Simple Sample Program Demo 13年11月9日土曜日
  • 15. iphone application like very... 6 public class IOSDemo extends UIApplicationDelegate.Adapter { 7 11 12 13 14 @Override public boolean didFinishLaunching(UIApplication application, NSDictionary launchOptions) { UIButton create. 15 16 17 18 19 20 21 22 23 24 13年11月9日土曜日 final UIButton button = UIButton.fromType(UIButtonType.RoundedRect); button.setFrame(new CGRect(115.0f, 121.0f, 91.0f, 37.0f)); button.setTitle("Click me!", UIControlState.Normal); button.addOnTouchUpInsideListener(new UIControl.OnTouchUpInsideListener() { @Override public void onTouchUpInside(UIControl control, UIEvent event) { button.setTitle("Click #" + (++clickCount), UIControlState.Normal); } });
  • 16. Objective-c block 1 2 3 4 5 6 7 8 9 10 11 12 public static void main(String[] args) { Dispatch.Queue queue = Dispatch.getGlobalQueue( Dispatch.QUEUE_PRIORITY_DEFAULT, 0); for (int i = 1; i <= 5; i++) { final String msg = String.format("Block #%d", i); Dispatch.async(queue, new VoidBlock() { public void invoke() { System.out.println(msg); } }); } } u able to run tasks asynchronously like this 13年11月9日土曜日
  • 17. RoboVM java.util.* and java.lang.* can use. 1 2 3 4 5 6 final java.util.Date date = new java.util.Date(); //can't use SimpleDateFormat... String title = "JJUG 2013" + date.toString(); final UIButton button = UIButton.fromType(UIButtonType.RoundedRect); button.setFrame(new CGRect(30.0f, 121.0f, 250.0f, 37.0f)); button.setTitle(title, UIControlState.Normal); 1 2 3 4 5 6 7 8 9 10 11 final java.util.List<String> arrlist = arrlist.add("spring"); arrlist.add("fall"); 13年11月9日土曜日 new java.util.ArrayList<String> (); button.addOnTouchUpInsideListener(new UIControl.OnTouchUpInsideListener() { @Override public void onTouchUpInside(UIControl control, UIEvent event) { button.setTitle("Click #" + (++clickCount) + " " + arrlist.get(1), UIControlState.Normal); } });
  • 18. JavaFX 13年11月9日土曜日
  • 19. Simple Java FX Program Demo 13年11月9日土曜日
  • 20. JavaFX8 Java 1 MigPane root = new MigPane("gap 10, flowy", "[fill,grow,center]", "[]"); ... 4 5 6 7 8 13年11月9日土曜日 Scene scene = new Scene(root, 320, 480); scene.getStylesheets().add("/com/ultramixer/ javafx4ios/javafx4ios.css"); primaryStage.setTitle("JavaFX8 on iOS"); primaryStage.setScene(scene); primaryStage.show();
  • 21. RoboVM+JavaFX(CSS) Java 26 27 Label headline = new Label("JavaFX8 on iOS JJUG 2013 CCC Fall"); headline.setId("headline"); CSS 1 #headline { 2 -fx-font-size: 15; 3 } u can make a design with CSS 13年11月9日土曜日
  • 22. RoboVM+JavaFX(CSS) Java 40 41 42 43 44 45 46 47 48 49 Button b2 = new Button("JJUG!!"); b2.setId("btn"); b.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { primaryStage.close(); } }); CSS 1 #btn { 2 -fx-background-radius: 10px; 3 -fx-background-color: linear-gradient(to bottom, 4 #BBBBCC 0%, #AAAAAA 100%); 5 } 13年11月9日土曜日
  • 23. Birck Breaker Demo 13年11月9日土曜日
  • 24. Birck Breaker Splash UI is programmed by ImageView(Java) 1 package brickbreaker; 2 3 import javafx.animation.KeyFrame; 4 import javafx.animation.Timeline; 5 import javafx.event.ActionEvent; 6 import javafx.event.EventHandler; 7 import javafx.scene.Group; 8 import javafx.scene.Node; 9 import javafx.scene.Parent; 10 import javafx.scene.image.ImageView; 11 import javafx.scene.input.KeyEvent; 12 import javafx.scene.input.MouseEvent; 13 14 public class Splash extends Parent { 15 16 private static final int STATE_SHOW_TITLE = 0; 17 private static final int STATE_SHOW_STRIKE = 1; 18 private static final int STATE_SUN = 2; 19 20 private static final int SUN_AMPLITUDE_X = Config.SCREEN_WIDTH * 2 / 3; 21 private static final int SUN_AMPLITUDE_Y = Config.SCREEN_WIDTH / 2; 22 23 private ImageView background; 24 private ImageView brick; 25 private ImageView brickShadow; 26 private ImageView breaker; ... need the effort..x( 13年11月9日土曜日
  • 25. FXML 13年11月9日土曜日
  • 26. Setting forceLinkClasses • robovm.xml 1 <forceLinkClasses> 2 <pattern>javafx.scene.web.WebView</pattern> 3 </forceLinkClasses> currently experimental... 13年11月9日土曜日
  • 27. OpenGL ES 13年11月9日土曜日
  • 28. Using OpenGL Program Demo 13年11月9日土曜日
  • 29. Using OpenGL Program sorry. i can not show you.. Demo 13年11月9日土曜日
  • 30. RoboVM + OpenGLES 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 private void update(GLKViewController controller) { if (increasing) { curRed += 1.0f * controller.getTimeSinceLastUpdate(); } else { curRed -= 1.0f * controller.getTimeSinceLastUpdate(); } if (curRed >= 1.0f) { curRed = 1.0f; increasing = false; } if (curRed <= 0.0f) { curRed = 0.0f; increasing = true; } } @Override public void draw(GLKView view, CGRect rect) { GL.glClearColor(curRed, 0.0f, 0.0f, 1.0f); GL.glClear(GL.GL_COLOR_BUFFER_BIT); } 13年11月9日土曜日
  • 31. RoboVM + OpenGLES 1 import org.robovm.rt.bro.*; 2 import org.robovm.rt.bro.annotation.*; 3 4 @Library("OpenGLES") 5 public class GL { 6 static { 7 Bro.bind(GL.class); 8 } 9 10 public static final int GL_DEPTH_BUFFER_BIT = 0x00000100; 11 public static final int GL_STENCIL_BUFFER_BIT = 0x00000400; 12 public static final int GL_COLOR_BUFFER_BIT = 0x00004000; 13 14 @Bridge 15 public static native void glClearColor(float red, 16 float green, float blue, float alpha); 17 18 @Bridge 19 public static native void glClear(int mask); 20 } I never thought a screen fading from black to red would look this great! It almost made me cry. :-) 13年11月9日土曜日
  • 32. A serious Happning 13年11月9日土曜日
  • 33. iOS7 + Mavericks 13年11月9日土曜日
  • 34. Warning • iOS6 provisioning is expired... • Need to Xcode5.x(but Xcode4.x) • I can t demo... \(^o^)/OWATA 13年11月9日土曜日
  • 35. RoboVM Update v0.0.6 • The reason why it failed is that gdb has been removed from Xcode5 and the tool RoboVM used to launch on device (fruitstrap) relied on gdb 13年11月9日土曜日
  • 36. new RoboVM • libimobiledevice • libimobiledevice is a cross-platform software library that talks the protocols to support iPhone, iPod Touch, iPad and Apple TV®devices. switched to using libgpod 13年11月9日土曜日
  • 37. How to use in iOS7 • Get Java SE JDK 7 from Oracle • Get Xcode 5.0.1 from the Mac App Store • https://github.com/robovm/robovm/wiki/Hackingon-RoboVM I plan to try bonus comes out 13年11月9日土曜日
  • 38. Development Environment 13年11月9日土曜日
  • 39. Maven git git clone https://github.com/robovm/robovm-sample-ios-app.git cd robovm-sample-ios-app mvn robovm:iphone-sim To run on a device do mvn robovm:ios-device Your device has to be provisioned properly for this to work u can use Intellij IDEA 13年11月9日土曜日
  • 40. but i recommend eclipse • Why? • Easy to install (only add packege..) • Offical update early so, i recommend eclipse 13年11月9日土曜日
  • 41. Why so English? 13年11月9日土曜日
  • 42. 実は... • こんなやりとりが... @tikemin @skrb It would be great to have these #JavaFX RoboVM slides translated to English http:// t.co/Izvtzywzjl」 ということで英語の資料に 13年11月9日土曜日
  • 43. 実は... • こんなやりとりが... @tikemin @skrb It would be great to have these #JavaFX RoboVM slides translated to English http:// t.co/Izvtzywzjl」 (Bio: Java/JavaFX/IoT developer, author and speaker) ということで英語の資料に 13年11月9日土曜日
  • 44. Summary 13年11月9日土曜日
  • 45. Summary • RoboVM • Compiler translates Java bytecode into native ARM or x86 code • RoboVM+JavaFX • RoboVM+OpenGLES • iOS7(Java7) Future is very fun! 13年11月9日土曜日
  • 46. +α 13年11月9日土曜日
  • 47. libGDX • Desktop/Android/iOS/HTML5 Java game development framework • • • • • • • Windows Linux Max OS X Android (+1.5) iOS Java Applet (requires JVM to be installed) Javascript/WebGL (Chrome, Safari, Opera, Firefox, IE via Google Chrome Frame) 406 games listed in this gallery 13年11月9日土曜日
  • 48. git hub • robovm-llvm(Only .md file) • https://github.com/robovm/robovm-llvm • ObjC2RoboVM • It is a parser that creates RoboVM bindings from CLang AST dumps Future is very fun! 13年11月9日土曜日
  • 49. halt 13年11月9日土曜日