Creating the Example iOS Mobile App
Copy
The following section describes the procedures for creating the example iOS App.
- Open Microsoft Visual Studio. (Visual Studio 2012 Professional and higher are the only versions of Visual Studio that are compatible with Xamarin.iOS.).
- Set the Name and Solution Name properties to MyApp.
- Add any required references to the Solution. The following is required for this example:
- Right-click on References in the Solution Explorer and select Add References.
- Select the Browse tab and return IOM.IOS.dll from the ‘bin\Debug’ folder of the Solution. The file can be copied to this location from the ‘
\Utilities\Aras Innovator <Version> IOM SDK\COM\IOS’ directory on the Aras Innovator CD Image. - Connect your Mac or iOS device by selecting the appropriate platform.
- From the main menu select Project -->MyAppProperties and then iOS Application.
On the New Project form, select iOS\Universal in the sidebar and create a new Blank App (iOS) using .NET Framework 4.5. (Visual C# is used in this example).
For this example project choose iPhoneSimulator for the platform.
- Add a new controller to your project called MyController.cs.
- In the Solution Explorer, right-click MyApp--> Add -->New Item,and thenUI in the list on the left side of the window.
- Add the following lines to the top of MyController.cs:
- Replace the UIViewController class code in MyController.cs with the code in Appendix B, section 7.1.1
- After pasting in the code, substitute the correct values for the Aras Innovator Server and database name of your Aras Innovator instance:
- Open AppDelegate.cs from the Solution Explorer, and add the lines highlighted below:
- Compile and run your project. Your app should appear in Xcode’s iOS Simulator on your Mac.
Select UIViewController class, set the name to MyController.cs and then click Add.
using Aras.IOM;using System.Threading;...//create connection to Innovator serverHttpServerConnection connection = IomFactory.CreateHttpServerConnection (“http://localhost/InnovatorServer/Server/InnovatorServer.aspx”, “InnovatorSolutions”, “admin”, “innovator”); ...[Register(“AppDelegate”)]public partial class AppDelegate : UIApplicationDelegate{ // class-level declarations UIWindow window; MyController viewController; ... public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); // If you have defined a view, add it here: // window.RootViewController = navigationController; viewController = new MyController(); window.RootViewController = viewController; // make the window visible window.MakeKeyAndVisible(); return true; }}