UX-Studio does not provide the actual development methods for creating apps. Therefore, apps need to be made using the development environment provided by Android and iOS, and you can follow the general app development procedures.
App development environment configuration
Android
Apps for Android are created using Eclipse and Android SDK, and the method is identical with the method for creating general apps. The Google Android webpage with the information on how to install and download Eclipse and Android SDK is http://developer.android.com/sdk/installing.html. Since the renewal cycle of the newest Eclipse and Android SDK is very fast, you need to install the latest development environment from the website. The detailed contents are altered whenever the latest version of Eclipse/ADT/ Android SDK is updated, so please refer to the related web page that deals with the relevant information.
The basic implementation of Android development environment is as the following.
Eclipse installation
ADT Plugin installation
Android SDK installation
iOS
iOS apps are developed using XCode and iOS SDK, and the method is the same as that of making general apps. XCode, iOS SDK can only run on a Mac, so a Mac that can load the latest version of OS X is needed. To run on terminals, an Apple developer account is required.
iOS development environment basically is formed of the following procedures and the detailed information may change every time XCode/ iOS SDK version is updated, so please refer to the relevant part in the information webpage. (reference : http://developer.apple.com/devcenter/ios/index.action )
Creating Apple Developers account
For iOS, testing is only possible on the terminals that are registered with a developer’s account. Therefore unlike Android, a developer’s account is required not only for distributing but also for developing. The Apple developer’s account for developing iOS App can be created in the website below. http://developer.apple.com/devcenter/ios/index.action After creating an account, you need to create an authentication certificate (for developing/distributing), register the testing terminal, create APP ID and create provisioning (for developing/distributing). After logging into the account created in the website above, you can go into the iOS Provisioning portal menu in iOS Developer Program on the right side, to check the necessary categories for setting and create them.
Certificate generation (for developing / distributing)
The certificate will be created subordinately to the Mac it is being created on. You must create separate certificates for developing purpose and distributing purpose. Proceed according to the How to tab.
The test device registration
Up to 100 testing terminals can be registered per account and you cannot delete the terminals added before a year, which is the renewal period of a developer’s account.
Generating App ID
App ID must be created, one per App. Proceed according to the How to tab.
Provisioning creation (for developing / distributing)
Provisioning is the function that links certificates, testing terminals and App IDs. You must create separate ones for developing and distributing. Proceed according to the How to tab.
Install XCode for development environment
XCode can be downloaded/installed through the Apple developer webpage or mac AppStore. In the OS X Snow Leopard of mac App store is loaded from default. You can download and install XCode from here.
If you do not have the Mac App Store as the picture shown above, you must update OS X as the latest version. Updating OD X software can be done by clickking on the Apple logo button on the upper left side of the screen.
When you search for XCode in mac App sotre and click the install button, iOS SDK is installed along with XCode.
App project development
Develop app project in the app development tool appropriate for each OS.
Android
In Eclipse, develop App project for Androids according to the following procedures
Generate the app project.
ProjectName : Enter the name of the project to generate.
Contents : “Create new project in workspace”
Build Target : Check on Android 3.0.
Application name : Type in the application name.
Package name : Enter the form of a domain name of the package
(ex : com.tobesoft.test)
Min SDK Version : Enter the minimum supported SDK Version 7. (XPLATFORM Hybrid support starting from Android 2.1 and the SDK level of Android 2.1 is 7.)
Add to the project so that it refers to XPLATFORM.jar to reference.
Add the Resource.
Add the necessary resources for supporting XPLATFORM Hybrid to the project as the following. hybrid_typedef.xml created in UX-Studio must be added as well.
icon.png : It is the icon image of the application.
splashimage_phone_landscape.png : It is the configuration image for Android Phone Landscape mode(horizontal screen). (Everything is in small letters.)
splashimage_phone_portrait.png : It is the configuration image for Android Phone Portrait mode (vertical screen). (Everything is in small letters.)
splashimage_pad_landscape.png : It is the configuration image for Android Phone Landscape mode (horizontal screen) (everything is in small letters.)
splashimage_pad_portrait.png : It is the configuration image for Android Phone Portrait mode (vertical screen). (Everything is in small letters.)
strings.xml : It defines the string resource used by application
(It is the file created by default when creating Android project in Eclipse.)
hybrid_typedef.xml : It is the type definition xml generated in UX-Studio.
Modify too enable the inheritance of the generated activity, and insert configuration image and the code designating hybrid_typedef.xml.
package com.tobesoft.TestTobe; // [XPLATFORM] XPLATFORM Main Activity import import com.tobesoft.xplatform.loader.Main; import android.app.Activity; import android.os.Bundle; // [XPLATFORM] XPLATFORM Main Activity Inheritance public class TestTobeActivity extends Main/*Activity*/ { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } }
Organize Android Manifest
To configure the activity occurring in XPLATFORM Hybrid and receiver, put in the information below in the tag of Android Manifest Application.
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:hardwareAccelerated="true"> <activity android:label="@string/app_name" android:name=".TestTobeActivity" android:configChanges="keyboardHidden|orientation" android:screenOrientation="sensor"> <activity android:name="com.tobesoft.xplatform.deviceAPI.CameraListener" android:screenOrientation="landscape"> <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.tobesoft.xplatform.deviceAPI.SmsSend" > <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.tobesoft.xplatform.deviceAPI.FileDialogActivity" android:screenOrientation="sensor"> <intent-filter> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name="com.tobesoft.xplatform.deviceAPI.SmsRecv"> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> <receiver android:name="com.tobesoft.xplatform.deviceAPI.SmsRecv"> <intent-filter> <action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" /> <data android:mimeType="application/vnd.wap.mms-message" /> </intent-filter> </receiver>
To use the MobileAPI offered by XPLATFORM Hybrid, add the permission below to Android Manifest.
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.SEND_SMS" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.READ_SMS" /> <uses-permission android:name="android.permission.WRITE_SMS" /> <uses-permission android:name="android.permission.BROADCAST_WAP_PUSH" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.RESTART_PACKAGES" /> <uses-permission android:name="android.permission.UPDATE_DEVICE_STATS" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.GET_TASKS" />
iOS
Follow the procedures below to develop app projects for iOS in XCode.
Generate app project.
From the File menu, select New Project and generate Empty Project.
When it is generated, the information that needs to be inserted are as below.
Product Name : Insert application name.
Company Identifier : Enter a company identifier in the form of a domain (Ex : com.tobesoft)
Finally, an empty project is created by selecting the generation folder.
Add on to project so that XPLATFORM.framework will be referred to. (Also add IOS framework)
Add XPLATFORM.framework to project by drag & drop
Add iOS framework as it is necessary for operation of MobileAPI.
iOS framework can be added by selecting project and clicking the right view of XCode> in the Build Phrases tab, the Link Binary with Libraries category.
If all the frameworks are added then it will appear as below.
To specify the installation image, add an image resource.
The following are the detailed information of installation image. .
splashimage_phone_landscape.png : iPad Landscape mode configuration image (horizontal screen)
splashimage_phone_portrait.png : iPad Portrait mode configuration image (vertical screen)
splashimage_pad_landscape png : iPhone Landscape mode configuration image (horizontal screen)
splashimage_pad_landscape.png : iPhone Portrait mode configuration image (vertical screen)
When you select the project from the project navigator, a summary tab will appear and find the Launch Images category to designate the configuration image as the image below. After designation, the image that will start by default is automatically created and since it is automatically created and managed in XCode, do not change its name.
The following are the detailed information of the default images that are applied automatically.
Default@2x : iPhone default images (auto-generated)
Default-Landscape~ipad.png : iPad Landscape default images (auto-generated)
Default-Portrait~ipad.png : iPad Portrait default images (auto-generated)
Add the hybrid_typedex.xml file, which was generated in UX-Studio, to the data folder, right under the project folder. The hybrid_typedex.xml file consists of the below codes. (Added in October 15)
<?xml version="1.0" encoding="utf-8"?> <TypeDefinition> <Update> <Item systemtype="XP-HybridApp" url="http://127.0.0.1:8080/hybridtest"> <Os type="default" url="./HBDeviceTest"> <Device type="all" url="./"> <Resource type="Theme" file="default.zip" targetpath="/_theme_"/> <Resource type="Engine" file="Component.zip" targetpath="/" /> <Resource type="Engine" file="Run.zip" targetpath="/" /> <Resource type="File" file="Arcive00.xzip" targetpath="/" /> </Device> </Os> <!-- <Os type="Android" url="./Android"> <Device type="default" url="./"> <Resource type="Theme" file="default.zip" targetpath="/" /> </Device> </Os> <Os type="IPhone" url="./IPhone"> <Device type="default" url="./"> <Resource type="Theme" file="default.zip" targetpath="/" /> </Device> </Os> --> </Item> </Update> </TypeDefinition>
Choose the project, select [Add files to (project)] from the context menu, and make the project refer to the data folder.
Go through the following process to set error messages. (Added in October 15)
Localization settings
Add your desired languages by clicking the [+] button at the menu [Project > Info > Localization]. In this sample, we added English, Korean and Japanese,
Creating a file for error message strings
Choose the Supporting Files folder and select [New File] from the context menu. After the window of the file template list is opened, access [OSX > Resource > Strings File] and specify the file name as "Localizable."
Now that you can see the Localizable.stirngs file has been created under the Supporting Files folder, select the file and click the [Localize] button in the [Localization] field on the right-hand pane.
As English, Korean and Japanese are presented as localizable languages. check them all.
Add error messages to the Localizable.strings files of each language. Those files will be provided in the form of UTF-8-encoded text files while being located in the path [Engine > errordefile > iOS], in the XPLATFORM module.
Modify so that the generated AppDelegate will inherit the AppDelegate of XPLATFORM.
Modify AppDelegate.h / m files as the following so that XPLATFORM.framework can operate.
AppDelegate Header modification
Modify so that AppDelegate of XPlaform.framework is inherited and eliminate the unnecessary codes that have been automatically generated.
#import <UIKit/UIKit.h> #import <XPlatform/XPlatformAppDelegate.h> // [XPLATFORM] @interface AppDelegate : XPlatformAppDelegate <UIApplicationDelegate> // Delete all the code inside the class. @end
AppDelegate m modification
Make it so that the call of all delegates of super class that belong to AppDelegate is possible to all delegates of XPLATFORM.framework’s AppDelegate will be processed. (Keep in mind the / / [XPLATFORM] part).
#import "AppDelegate.h" @implementation AppDelegate // Delete all the code inside the class. @end
Modifying the main.m file (Added in October 15)
Modify the main.m file, which is located under the Supporting Files folder, as described below.
#import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); [pool release]; return retVal; }
Organize the setting of the project.
Due to the iOS framework of XPLATFORM, you need to add the following settings to Build Settings.
Other Linker Flags : -lxml2
Header Search Paths : /usr/include/libxml2
Creating and running the apps
Android
Connect the Android terminal to PC with a USB.
Execute Run in Eclipse. The Run of Eclipse is a function that enables APK generation and execution.
You can also execution by using a pop-up menu as shown below.
iOS
Connect the iOS device to a Mac using a USB.
Execute Run in XCode. Run o Xcode is a function which allows the creation and installation to terminal of APP and even execution.