Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Multi-OS Engine Actions Menu

$
0
0

The new update of Multi-OS engine provides “MOE Actions” context menu item for Android Studio. The item contains sub items namely Synchronize to Xcode, Synchronize to Java, Generate Bindings. This article takes a simple app and demonstrates the use of the above mentioned sub items.
To start with let us create a Multi-OS Engine module with Single View Application Template with storyboard. 

Synchronize to Xcode - To generate Objective C UI controller stubs from Java implementation for working in Xcode Interface Builder.

  1. At the module level – right click and select “MOE Actions”. Click on “Synchronize to Xcode”.


     
  2. To view the generated Objective C controller files, change the view of the app to Project.


     
  3. You can see the the Objective files generated under Xcode folder.

Synchronize to Java – Generate or update Java UI Controller based on changes make in Objective C stubs via Xcode.

  1. Start with opening the project with Xcode. To open project with Xcode - At the module level- right click and click on “MOE Actions”. Select “Open Project in Xcode”


     
  2. Once the project open up in Xcode. Open the storyboard file under resource folder. Add a button to the palette.


     
  3. Open the assistant editor to associate IBAction of the button to the AppViewController file (control click to the .h file. Save the files in Xcode.




     
  4. Go back to your Android Studio, on the Xcode folder, right click and under “MOE Actions” click on “Synchronize to Java”.


     
  5. You will see the IBActions associated with the newly added button in your “AppViewController.java” file.

Generate Bindings- Generate or Updates Java classes/interfaces/enums based on Objective C code.

  1. In the same Project, open the project with Xcode again.
  2. Create another storyboard file. To create another storyboard file - Right Click on the project in Xcode and select new fileà User Interface (left panel) à StoryboardCocoa Touch Classes and click on next.


     
  3. Open the newly created storyboard file. Drag and drop the view Controller on to the storyboard.


     
  4. Let us create a custom class for the storyboard. Right Click on the project in Xcode and select new fileà Cocoa Touch Classes and click on next.  


     
  5. Name your class and make it a subclass of UIViewController


     
  6. In your interface builder – change the Custom class of the ViewController to the custom class created in the previous step.


     
  7. Go back to your Android Studio, Right click at the Project level and under “MOE Actions”, click on “Generate Bindings”


     
  8. You can see the custom class created for you using generate bindings . 

Note: The Generate Binding and Synchronize to Java have the same functionality with the following difference- right click on the module to invoke Generate Bindings vs right click on the xcode folder to invoke Synchronize to Java. 


Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>