Friday 29 March 2013

Porting Java Android Application into multi platform

CONVERTIGO :
-----------------
To accommodate the many-device to many-platform mobile application integration scenario and the BYOD (Bring Your Own Device) paragdim that most IT teams operate within, analysts predict that 95% of organizations will choose Enterprise Mobile Application Platform (MADP/MEAPs) and packaged mobile application vendors as their primary mobile development through 2013.*

CODENAME ONE:

Codename One offers several services to ease the process of mobile app development using Codename One. Most of these services are delivered via verified partners and are backed by support from Codename One. All services are available at half price for enterprise developers.


Saturday 2 March 2013

phonegap multiple mobileApp

https://build.phonegap.com/

https://build.phonegap.com/docs/preparing-your-app

https://build.phonegap.com/docs/config-xml


xcode phonegap (ios) set up

Link1:
=====
http://phonegap.pbworks.com/w/page/16494778/Getting%20Started%20with%20PhoneGap%20(iOS)%20-%20Xcode%203



This tutorial provides instruction on setting up 0.9.5 PhoneGap for your web application on an iOS device using Xcode3
For information regarding setting up PhoneGap with Xcode 4, click here.
For information on setting up an iOS device for development, see the iOS Dev Center.

Requirements

  • Intel-based computer with Mac OS X Snow Leopard (10.6) with Xcode and the iPhone SDK installed.  Make sure to install the default with the UNIX tools included.
  • an Apple iOS device (iPhone, iPad, iPod Touch)
  • iOS developer certification. (only necessary to install apps on an iOS device)

 

Step 1


  • Download the latest copy of PhoneGap and extract its contents. We are only interested in the iOS directory
  • Run the installer until completion.  (Make sure Xcode is closed)
  • Launch Xcode then under the File menu, select "New Project..."
  • Navigate to the "User Templates" section, select PhoneGap, then in the right pane, select "PhoneGap-based Application"
  
  •  Select the "Choose..." button, name your project and choose the location where you want the new project to be.
  • Modify the contents of the "www" directory to add your HTML, CSS and Javascript.
  • Open [AppName]-Info.plist and change "BundleIdentifier" to the identifier provided by Apple. If you have a developer license, you can access and run the Assistant at http://developer.apple.com/iphone/manage/overview/index.action and register your App. If you do not have a developer license and simply wish to test PhoneGap on your desktop simulator, you can skip this step.
  • IMPORTANT: Make sure to change the Active SDK in the top left menu from "Use Base SDK" to Device+version#. If for whatever reason, the top left menu says "Base SDK missing", you have to first set the Base SDK in the the project settings.
    • Project -> Edit Project Settings.
      Then choose the tab called "General".
      Under "Base SDK for All Configurations", select "iOS Device 4.x" or "Latest SDK" 
                   Restart xCode



  • Build and Go.

Step 2


  • Open [AppName]-Info.plist and change "BundleDisplayName" to the name of your web application.
  • Replace icon.png with your web application's icon 57 by 57 pixels


  • Change Default.png 320 by 480 pixels. (optional)
  •  





Link2:  Adobe Developer Connection   ADOBE PHONEGAP SYSTEM Method

Getting started with PhoneGap in Xcode for iOS


http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-xcode-for-ios.html

This article describes steps needed to set up an environment and a workflow for developing PhoneGap/Apache Cordova applications in Xcode, targeting iOS devices. Xcode is the integrated development environment (IDE) provided by Apple for developing OS X and iOS applications. iOS is Apple's mobile operating system for iPhone, iPad, and iPod touch devices. PhoneGap is an open source application platform that enables you to create natively-installed mobile applications using HTML and JavaScript, also known as Apache Cordova.

Setting up Xcode


The first step to setting up Xcode for PhoneGap applications is to download and install the Xcode IDE from Apple. You can download Xcode from the Apple developer site. Before you can download Xcode, you must register as a developer with Apple. Once you do, you get access to Xcode, the iOS device simulator, and Apple developer documentation for free. If you want to deploy your applications to an actual device or distribute your applications via the iTunes store, you will have to register with Apple as an iOS developer, which has a yearly cost associated with it.
After you download Xcode, simply follow the setup wizard to complete the installation process.

Downloading and installing PhoneGap


Once you have successfully installed Xcode, your next step is to download and install PhoneGap.
  1. Visit the PhoneGap download page (http://phonegap.com/download) in your browser and click the orange Download link to start the download.
Note: The following steps are shown for PhoneGap 1.5.0, but the process should be applicable or similar to all versions of PhoneGap.
  1. Extract the ZIP file's contents.
  2. Navigate to the libs/ios/ folder of the extracted files, and double-click on the Cordova-1.5.0.pkg package installer.
This will launch the PhoneGap installation wizard, which will guide you through the process of installing PhoneGap on your system (see Figure 1).

Figure 1. The PhoneGap/Cordova installer.
Figure 1. The PhoneGap/Cordova installer.

  1. Follow the installation instructions provided by the installer until you see "Thanks for installing PhoneGap 1.5.0! ".
When you see this message, PhoneGap installation is complete. You are now ready to create your first PhoneGap project within Xcode.

Creating a project in Xcode


The PhoneGap installer adds a PhoneGap project template to Xcode, which streamlines the creation of PhoneGap applications.
  1. To get started, simply click Create A New Xcode Project in the Xcode welcome screen (see Figure 2). Alternatively, you can choose File > New > New Project to create your new PhoneGap project.

Figure 2. The Xcode welcome screen.
Figure 2. The Xcode welcome screen.

The first step in creating a new Xcode project is to select a project template.
  1. Find and select the Cordova-based Application template, located under iOS > Application, and then click Next (see Figure 3).

Figure 3. Choosing a project template.
Figure 3. Choosing a project template.

After you have chosen the project template, you'll need to name your project. Give it a name indicative of what you're going to be building.
  1. In this case just type Hello, since you're building a simple Hello World application (see Figure 4).

Figure 4. Setting the project name and other options.
Figure 4. Setting the project name and other options.

On the New Project Options screen, you also need to enter a company identifier. The company identifier is the prefix that is concatenated with the product name to create the unique bundle identifier for your application. The bundle identifier should match the App ID that you create for a unique application within the Apple Provisioning Portal (see Figure 5).

Figure 5. Specifying the bundle identifier in the Apple Provisioning Portal.
Figure 5. Specifying the bundle identifier in the Apple Provisioning Portal.

If you aren't sure what to type here, or if you are not deploying to a device or distributing this application right away, you can type whatever you want or leave this blank. You can always change the bundle identifier later by editing the Identifier field in the Xcode project summary screen, or by manually editing your project's Info.plist file.
Note: On the project options screen, you also have the option to turn on Automated Reference Counting (ARC). If you aren't writing any native code within your PhoneGap application, you can ignore this. You only need to worry about ARC if you are writing PhoneGap native plugins or writing native code. PhoneGap native plugins enable you to write your own native code and JavaScript APIs to extend the capabilities of the PhoneGap container.
PhoneGap projects will work regardless of whether ARC is enabled or disabled. If ARC is enabled, then you do not need to manage memory allocation using retain and release instructions in any native code. The Xcode LLVM compiler will automatically generate the appropriate retain and release instructions for you. If ARC is not enabled, you will have to manually manage memory. Remember, ARC only applies to native code, not HTML or JavaScript code.
  1. Click Next.
  2. Select a folder on your file system in which your PhoneGap project will reside (see Figure 6).

Figure 6. Selecting the project location.
Figure 6. Selecting the project location.

  1. Click Create.
Your PhoneGap project will be created within Xcode. However, there are a few more steps you need to complete before your project is up and running.
All of the HTML and JavaScript used to create the interface for your PhoneGap project will be contained within a wwwfolder. Initially, this www folder will not exist within your PhoneGap project. To create it, you first have to run the application.
  1. Run the application by clicking Run in the upper left hand corner of the window (see Figure 7). Alternatively, you can choose Product > Run.

Figure 7. The Xcode Run button.
Figure 7. The Xcode Run button.

Xcode will attempt to launch the PhoneGap application in the iOS simulator. For the first launch, you will see the error message "ERROR: Start Page at 'www/index.html' was not found." Do not worry, this is normal! During this first step, thewww folder will be created. After you add it to your project, you should not encounter this error again.
  1. To add the www folder to your project, Ctrl-click the project root and select Add Files To "Hello" (see Figure 8).

Figure 8. Preparing to add files to the project.
Figure 8. Preparing to add files to the project.

  1. In the dialog box that opens, select the www folder inside of the newly created project. Be sure to select the actualwww folder, not a parent folder or contents inside of the folder.
  2. Select Create Folder References For Any Added Folders (see Figure 9). If you do not select this option, your will encounter errors with your project.

Figure 9. Adding files to the project in Xcode.
Figure 9. Adding files to the project in Xcode.

  1. Click Add.
You should now see the www folder under your project root (see Figure 10).

Figure 10. The www folder in the project root.
Figure 10. The www folder in the project root.

  1. Click Run to launch the project again.
At this point, your project should be correctly configured and should launch in the iOS simulator. If you haven't changed any of the HTML files inside of the www folder, you will see the default PhoneGap starter page inside of your application running within the iOS simulator (see Figure 11).

Figure 11. The iOS simulator
Figure 11. The iOS simulator

If you see this, then you are now ready to begin developing iOS applications within Xcode using PhoneGap.

Working with PhoneGap in Xcode


With your PhoneGap environment properly set up, reviewing some Xcode and PhoneGap basics will help you make the most of this development environment.
In general, Xcode should be fairly easy to navigate. On the left side of the screen you will see the project hierarchy, and in the center of the screen you will see the main content area. As you select files on the left side, the content will be displayed within the main editor area.
Here is one simple tip that trips up a lot of people: single-clicking a file in the project hierarchy displays that file's contents in the same window; double-clicking a file opens the file in a new window.
If you select the project root, you will see the project summary screen. From this screen, you can easily set the bundle identifier, application version, target devices, icons, splash screens, and supported orientations among other options (see Figure 12). This screen is useful in configuring your application for deployment.

Figure 12. The project summary screen.
Figure 12. The project summary screen.

At the top of the Xcode window, near the Run button, there is a Scheme menu that lets you change the project compilation schemes and target devices or simulators. To target a specific device or change the iOS Simulator target, simply click the project name and then select an alternate device or simulator target (see Figure 13). The next time that you run the application, it will be deployed to the newly selected target.

Figure 13. Selecting a new scheme.
Figure 13. Selecting a new scheme.

Keep in mind that the entire interface of a PhoneGap application is developed using HTML and JavaScript. Maintain all of the HTML assets used within the interface in the www folder. If you want to add additional files from a remote location, you will need to white-list that location inside of the PhoneGap.plist file, otherwise any external requests will be blocked with a security exception.
By default, the content area of Xcode will display source code based upon the files you select in the project hierarchy (see Figure 14).

Figure 14. The Xcode editor
Figure 14. The Xcode editor

If you prefer to open and edit multiple files side-by-side, don't fret. This is possible, although it's not immediately obvious how to do it.
To edit files side-by-side, click the Show The Assistant Editor button located in the top right side of the Xcode window (see Figure 15). Once the second editor instance is visible, you can drag files from the project hierarchy on the left into the new editor window. This is particularly helpful when you want to view separate HTML and JavaScript files at the same time, or when you want to view a native plugin and its JavaScript interface at the same time.

Figure 15. Editing code-by-side in Xcode.
Figure 15. Editing code-by-side in Xcode.

Where to go from here


Now that you have Xcode set up with PhoneGap, you are ready to start building some serious applications for iOS using PhoneGap. Next, you may want to read Extending PhoneGap with native plugins for iOS.
Remember, PhoneGap applications are built using HTML, CSS, and JavaScript for the user interface. This enables you to create great looking applications with ease using traditional web development skills. To learn more about rich experiences created with HTML, CSS, and JavaScript, check out the Adobe Developer Connection HTML5 and CSS3 developer center.



Building for iOS

We're now able to offer support for building to iOS devices through Adobe® PhoneGap™ Build. The process for completing iOS builds is slightly different than that for other platforms: all iOS builds need to be signed by a developer certificate and a provisioning profile, that is tied to your Apple developer account and the device you wish to test on. This document covers how to set this up.
Note: Since PhoneGap Build uses Apple's standard development process to build applications, you will need to sign up for their developer program to build iOS applications on PhoneGap Build. You will also need a Mac to configure your certificate and provisioning profile.
When you upload a new application to PhoneGap Build, if you don't have a default certificate-profile pair attached to your account, you will be alerted that the iOS build can not be completed:
iOS Key Required
Your key will actually consist of two files: a certificate and a provisioning profile. Apple has extensive documentation for setting up your environment locally: the best approach is to ensure you can build an iOS application to your iOS device locally, to be sure that both your certificate and your provisioning profile are set up correctly for code signing.
Once you have these set up, you can export them for upload to PhoneGap Build. For the provisioning profile, you will need a file with the mobileprovision extension, which looks like this:
Provisioning Profile in Finder
Ensure that this provisioning profile is correctly paired with the device(s) you wish to test on.
Note that when you create your profile, you will specify the App IDs that are linked to the profile. This is important when using PhoneGap Build: the package name you specify for your app, in your config.xml (the id attribute of the widget element) or through the Edit App page, will have to match the ID for the provisioning profile. If they fail to match, your app will not be built correctly.
Apple appends a "Bundle Seed ID," or "App ID Prefix," to the provisioning profile when you generate it through the iOS Developer Center. Note that you do not to include this App ID Prefix in your config.xml for PhoneGap Build to build successfully. You just need the reverse-domain style Bundle Identifier - com.domainname.appname. This will also be best compatible with building for other platforms.
To prepare your certificate, you will need to open the Keychain Access utility on your Mac, and identify the certificate that you use for iOS development. Right click on that certificate and select Export ...
Export from Keychain Access
Save the certificate in a location you can remember, and enter a password. Remember the password: you will need to give it to PhoneGap Build, otherwise we cannot use your certificate.
Enter Certificate Password
Now back to the website. On the app detail page, simply select the "new key..." option from the signing key dropdown for the app in question, and then, from the list of platforms with signing available, hit add a key for iOS. Fill out the form: add your p12 certificate file and your mobileprovision file, and enter the password associated with your certificate.
Add Certificate to PhoneGap Build
Once your key is added, we'll attempt to rebuild the application for iOS. If all goes well, you should see a link for the built ipa file available.
You can then download the ipa file and use iTunes to install it directly on your provisioned iOS device.
Happy building!




ios - Xcode sutup guide


Xcode Setup Guide

what is phonegap ? : ref link http://html.adobe.com/edge/phonegap-build/faq.html
Step 1 -- Install Xcode
Step 2 -- Using openFrameworks
Xcode Quirks: Spaces in main project folder name
Xcode Quirks: Adding files to project
Xcode 4.0 Notes, 10.7.2 and 10.8 Issue
Xcode is Apple's free gcc based IDE for OS X. You can download it from the Apple Developer Center, though you have to be registered as an apple developer. Registration is free and relatively painless.
adcLogin
Once you are logged in, select the link in the for Mac Dev Center
adcDeveloperTools
Download the latest version of Xcode 3 or Xcode 4.
Note: Currently there are two distinct version of Xcode - Xcode 3 and Xcode 4 ( for Lion ). We recommend Xcode 3 as Xcode 4 is still quite buggy and not as easy to navigate but openFrameworks does work on both.
adcDownload
Once the download completes, mount the installer and run the XcodeTools package. Click through the installer till you see the customize option.
Click it. This gives you the option to skip certain parts of the install. If you are short on disk space you'll probably want to skip the 1.3GB of developer documentation.
It is also recommended that you check any boxes that indicate support for older versions of OS X ie 10.5 / 10.6 etc.
xcodeCustomize
The installer starts installing.
xcodeInstalling
The Developer Tools installer will have installed a folder called Developer in the root (highest level) of your hardrive. The Xcode application is located at /Developer/Applications/Xcode.app
xcodeLocation
Now that Xcode has been successfully installed on your computer, it is time to check out the openFrameworks examples.
Note: these instructions largely apply to Xcode 3. For differences in Xcode 4, check out the Xcode 4 notes, below.
Download the openFrameworks examples from the download section of this website. Once downloaded and unzipped, place the folder in an appropriate location on your hardrive. Unzipped, the contents of the folder should look something like this:
ofFolderStructure
The examples are located within the examples folder. Within each example folder is an Xcode project file (e.g. graphicsExample.xcodeproj) This file will open the Xcode project for that example.
When the example opens in Xcode, you will see a list of files in the left column and the content of the currently selected file (in this case testApp.cpp) in the right panel.
xcodeLeftSide
The first thing you will probably want to do is to compile and run the app to make sure it works. Along the top of the Xcode window you should see a button called Build and Run (or a "Play" button if using Xcode 4). This button will compile the example app. Assuming there are no errors, it should then launch the app successfully. If you get a ton of errors on the first compile, try going to the Build menu and selecting "Clean All Targets", then try compiling again.
xcodeButtons
ofTypeWindow
Once the app is running -- you can terminate it by hitting the "Esc" key on your keyboard.
While the app is compiling you'll notice a little circular progress meter on the bottom right corner of the Xcode window. This indicates the percentage of the files compiled.
The yellow triangle and the number next to it indicates the number of warning messages from the compiler. Most of the time you can ignore the warning messages; if you would like to read them, click on the triangle and Xcode will open a separate window which will show them as a list.
xcodeCompileProgress
If the compiler finds errors in your code, the compile will fail and you will see something like this in the bottom right hand corner of your Xcode window.
xcodeError
As with the warning messages, to view the errors click on the red circle and Xcode will bring up a new window where it will list the errors and attempt to highlight the line in the code where the errors occurred.
xcodeErrorShow
Bear in mind that the error message might not always make sense to you, but most of the time just showing you where the error is will be enough for you to realize where the error is.
For example, in looking at highlighted line above, it is quite easy to see that I forgot to put a coma betweenfrabk.tff (the font name I wanted to load) and 32 (the size I wanted to font to be).
If I insert the proper comma, both errors go away and the app compiles and launches nicely.
ofGraphicsWindow
One of the most useful features of Xcode is the Debug Console. This is a console that will give youfeedback about your app while it is running.
To turn this on by default, go to Preferences > Debugging, and select On Start: Show Console. The Debug Console will now start automatically when you compile and run your application.
When the app launches, the first thing that is printed to the Debug Console is something like:
[Session started at 2007-02-25 15:34:07 +0100.]
When the app exits, it will print something like this
Program exited with status value:0.
The useful thing about the Debug Console is that you can print out to it while your app is running. See the ofLog function for details. If there are openFrameworks related messages or errors, they will be printed here as well.
DebugConsole
The application that you are compiling and running with Xcode is located in the bin/ folder of each project directory. You can always run the application directly by double clicking it. Everything will be the same as when you launch it with Xcode except you won't see the Debug Console output.
buildLocation
Spaces in main project folder name: For some reason Xcode freaks out if your main project folder (the one that contains the apps and libs folder) has spaces in the name.
It will give linking errors, meaning it can't find certain libraries in the libs folder.
badFolder
The folder name above, with the space between 'my' and 'apps', will give you all sorts of problems. Replacing the space with a dash or concatenating the spaces as below will keep everything happy.
goodFolder
Adding files to project: relative vs absolute path When you add source code files or libraries to your project, Xcode will ask you whether you wish the path to the file be a relative path or an absolute path.
addDialogRelative
As a rule for all files in your main openFrameworks folder and its sub-folders, make sure you choose Relative to Project. If you select Absolute Path, then everytime you move your openFrameworks folder around or onto another computer, Xcode will freak out because your files will have been listed with paths that don't exist anymore.
For example, a path like: /User/yourname/Documents/openFrameworksProjects means that the Xcode project will only work if the openFrameworks folder is in that specific place. Obviously this is not a good thing.
The default path it will give you is usually an absolute one so make sure you change it to Relative to Project before you click add.
The only files that should have absolute paths are the System Frameworks which you will most likely not need to add.
This is the ideal layout for your Xcode 4 project:
xc4
Xcode 4 has a completely redesigned interface. Here are some important differences:
Side bar view mode:
When you first open an openFrameworks project you might find the files in the sidebar aren't showing up. Click the folder icon at the top of the sidebar to show the traditional file view ( you might need to expand out the list with the sidebar arrows ).
xc4sideBarTop
xc4sidebarFileSelected
Run button:
In Xcode 4 the Run button has replaced the "Build" and "Build and Run" buttons.
To compile and launch your app hit the "Run" button.
xc4Run
Select the correct Target:
You might also find that your example is not running.
This could be because the openFrameworks library and not the example project is set as the active target.
To correct this, select the example project name from the 'Scheme' drop down.
xc4changeScheme
Change from Debug to Release:
When you are done with your app you will want to create a 'Release' version of this. In Xcode 3 this is as easy as switching the Build from Debug to Release mode. In Xcode 4 by default only Debug is enabled.
To switch to Release, select the "Edit Schemes" from the Schemes menu, then click your app in the sidebar and change the Build Configuration to Release.
xc4editSchemes1
xc4editSchemes2
Errors:
Xcode 4 compiles code as you type so you might see red errors appear in your code before you build.
This is actually quite handy and can help you spot mistakes. Also the Errors icon which was in the bottom right corner of the window has now moved to the top panel.
xc4errors
If you get QuickTime MacSetRect errors on 10.7 with Xcode 4.0, this is because a part of your project is set to 10.7 SDK.
Currently OF doesn't build against the 10.7 SDK because of QT 7 dependencies.
To set the project back to 10.6 SDK follow these steps posted from this blog:
  • Switch from the openFrameworks scheme to the project scheme
  • Click on the project on the sidebar to bring up the settings
  • Change the Base SDK to 10.6
  • Repeat the previous line for the build target
  • Click on the openFrameworks folder in the sidebar
  • Click on the project to bring up the settings
  • Change the Base SDK to 10.6 like you did before
  • Repeat for the build target
Because 10.8 deprecates the 10.6 SDK, all QuickTime-based code in OF is broken. This means you need to manually install the 10.6 SDK until we have a replacement for quicktime. For instructions, check this thread on the forum.