Note: They are called "app" and "iOS" respectively in the Project pane.
This.myString = " Hello World from common" įinally, let’s add the common module as a dependency in the Android and the iOS apps.
Replace the contents with the following (code in bold are newly added/edited lines):Ĭopy Code package Navigate to common > java > and open the AppLogic class. We will now add some code to our AppLogic class. In general, it will be like this: company_domain_in_, for example Ĭlick finish and let Android Studio refresh the Projects pane and the Gradle scripts. Also edit the Java package name as per the patterns that were generated for other modules. Therefore, let’s name it "common" and have our first Java class called "AppLogic".
In the New Module window, choose "Java Library" and click Next.Again the Project pane, right click and add a new Module:.In our simple example, our shared logic will simply be a Java object which has a method called sayHello() that returns a Java String. Now, let’s proceed with creating a " common" module which will hold our shared application logic (Java). In the next steps, we will create a "common" module, which will, as the name suggests, common Java code for our Android and iOS applications. If Android Studio prompts you to synchronize the Gradle scripts, please do so. We have now created an iOS application in Android Studio. Click Next to configure the new module.Xcode project name: myfirstapp Product name: myfirstapp Organization Name: mycompany Company Identifier: com. In this example, we will enter the following details to match Android S: Enter the Xcode project name (usually the name of your application), Product name (application name), organization and company ID details. Later you may wish to open the iOS project created by Android Studio, in Xcode, especially if you would like to use Xcode’s Storyboard to design your native user interface. In this window, you will create an Xcode project. Click on Hello World application and click Next.We will now proceed with adding a Multi-OS Engine module, which will eventually be your iOS application. In the Project pane, you will notice the app module. Click Finish to accept the default configuration.Īt this point, Android Studio has created an Android project. In the Customize the Activity window, you may wish to leave the settings unchanged. Choose "Blank Activity" in the Add an activity to Mobile window and click Next.
If you just want to just get started, simply proceed with the default settings by clicking Next.
To get started, you need to meet the minimum software requirements below: In a real-world scenario, most of your application logic will be shared.
In this tutorial, I will show you how to create a simple Hello World application for Android and iOS with code-sharing between the two applications. For this scenario, check our getting started guide with Multi-OS Engine (remote build).
You can also develop your Android* and iOS* applications in Android Studio on Windows* but in order to simulate your iOS application, you will need to remotely deploy your app to a Mac system running Xcode* (hence remote build). This tutorial will guide you to your first cross-platform application using the Multi-OS Engine installed on Mac OSX* which we refer to as local build.
Join our communities for Android, Internet of Things, Intel® RealSense™ Technology and Windows to download tools, access dev kits, share ideas with like-minded developers, and participate in hackathon’s, contests, roadshows, and local events. Intel® Developer Zone offers tools and how-to information for cross-platform app development, platform and technology information, code samples, and peer expertise to help developers innovate and succeed.