Import and Develop an Existing FeedHenry Application with JBoss Developer Studio 10.x

Updated -

Important: This article is intended for use with Red Hat JBoss Developer Studio 10.x. See Develop an Existing FeedHenry Application with JBoss Developer Studio 9.x or Develop an Existing FeedHenry Application with JBoss Developer Studio 8.x for instructions about performing these tasks with an older version of JBoss Developer Studio.

Red Hat JBoss Developer Studio 9.x includes an Import wizard to allow users to quickly and easily import previously created FeedHenry applications. Once the application is imported, you can change or enhance the application, test the changes, and then push it back to the FeedHenry server.

IMPORTANT: Before attempting to install or create a hybrid mobile project with JBoss Developer Studio, ensure that the Android SDK is installed and up to date. Creating or installing hybrid mobile projects without a working and updated installation of Android SDK can result in unexpected errors.

Follow the provided steps to import and make changes to a FeedHenry application using your Red Hat JBoss Developer Studio workspace:

  1. Import Your FeedHenry Application
  2. Change the Application
  3. Test the Application
  4. Push the Changes Back to the FeedHenry Server

Prerequisites

Ensure that the following prerequisites are met to enable the FeedHenry feature in JBoss Developer Studio:

Enable the JBoss Hybrid Mobile Tools + CordovaSim Feature

To enable the JBoss Hybrid Mobile Tools + CordovaSim feature:

  1. In JBoss Central, click the Software/Update tab.
  2. In the Features Available list, select the JBoss Hybrid Mobile Tools + CordovaSim check box and then click Install/Update.

    Hybrid Mobile Tools + CordovaSim Check Box Selected

  3. Follow the on-screen instructions to complete the installation.

During the installation process you may receive warnings about installing unsigned content. If this is the case, review the details of the content and if satisfied click OK to continue with the installation.

Once installation is complete, you are prompted to restart Eclipse. Click Yes to restart immediately and No if you need to save any unsaved changes to open projects. Note that IDE changes do not take effect until the IDE is restarted.

Install Android SDK

To install Android SDK:

  1. Download Android SDK and then unzip the file at a desired location.
  2. In JBoss Developer Studio, click Window > Preferences.
  3. In the Preferences window, type filter text field, type Hybrid Mobile.
  4. In the Hybrid Mobile category, click Android.
  5. Click Browse to locate and select the Android SDK directory on your machine.

    Select the Android SDK Location

  6. Click Apply and then click OK.

Set the Preferences

To set the preferences:

  1. Click Window > Preferences.
  2. In the Preferences window, in the search field type, FeedHenry and press Enter.
  3. Complete the following fields in the Preferences window:

    • Ensure that the Target URL field displays the URL to your FeedHenry server. The URL to your FeedHenry server should be something like: https://[your-studio-domain].feedhenry.com.

    • In the API Key field, copy and paste the API key from the FeedHenry website.

      Setting Preferences for FeedHenry

      Note: The user can either use an existing API key or generate a new one to set the preferences. To obtain the API key from the FeedHenry website click Settings > API Key Management. To generate a new API key, click Settings > API Key Management, and then click Add New Key.

  4. Click Apply and then click OK to close the Preferences window.

1. Import Your FeedHenry Application

Ensure that your JBoss Developer Studio preferences are set before importing a FeedHenry application. If not set yet, JBoss Developer Studio will prompt you to set the preferences. These preferences are set once when importing an application for the first time and the configured preferences are used for all imports in the future.

To import your FeedHenry application:

  1. Click File > Import.
  2. Expand FeedHenry, click Import Cordova Application, and click Next.
  3. The Import wizard displays the projects that you can import into JBoss Developer Studio. Expand the project to import an application from and select the FeedHenry application to be imported.
  4. In the Directory field, enter the location where you want to clone the application locally.
  5. Click Finish.

    Selecting an App to be Imported

If you have set a password for the SSH keys, the IDE will prompt you to enter the password so that it can import the application.

Result: The FeedHenry project is successfully imported into JBoss Developer Studio and appears in the Project Explorer view. The Cordova config.xml file for this project opens in the Editor.

Test the Application Import

To test the application import:

  1. In the Project Explorer view, right-click the application and then click Run As > Run w/remote FeedHenry server. A CordovaSim simulated device displaying the application appears.

    Simulated Device Displaying the Imported App

  2. In the Enter Your Name Here field on the simulated device, type your name.

  3. Click Say Hello From The Cloud.

Result: The simulated device displays the “Hello {Your Name}” string.

2. Change the Application

After successfully importing the FeedHenry application in JBoss Developer Studio, follow the instructions to change the application:

  1. In the Project Explorer view, expand {application name} > www and then double-click index.html to open it using the JBoss Tools HTML Editor.
  2. In the code, locate and delete the following line:
    This is a basic Cordova App that can take in your name, send it to a cloud app and display the response.
  3. Replace the deleted text with the following line:
    Hello from JBoss Developer Studio!
  4. Save the index.html file by pressing Ctrl+S. Alternatively, to save click File > Save or click the Save icon.

    index.html File Edited

3. Test the Application

To test the imported application, right-click the application and then click Run As > Run w/remote FeedHenry server.

FeedHenry App Edited

The changes made to the index.html file are reflected on the simulated device. Click a corner of the displayed device to rotate it in that direction. Alternatively, right-click the simulated device and click Rotate Right or Rotate Left as to rotate it in the desired direction.
To view the application on a different CordovaSim simulated device, right-click the device and click Skin. From the list of skins, select a skin to view the application.

4. Push the Changes Back to the FeedHenry Server

Use the following instructions to push changes to the application back to the FeedHenry server:

  1. In the Project Explorer view, right-click the application name.
  2. Click Team > Commit.
  3. In the Commit Changes window, Commit message field, type a message for the commit.
  4. In the Files field, select the files that you have edited and want to push to the server and then click Commit and Push.
  5. In the Push Results {application name} window, ensure all the details are correct and click OK.
  6. Log into FeedHenry at https://[your-studio-domain].feedhenry.com.
  7. Click Projects.
  8. Click the Project Title under which your application is located and then click the application.

Result: The simulated device in the App Preview section displays the change that you have just pushed to the FeedHenry server.

FeedHenry App Edited and Displayed on the FeedHenry Server

Did You Know

  • Add a new API key to your FeedHenry account by clicking Add New Key and then following the on-screen instructions.

  • Set up your SSH key in the FeedHenry account by clicking Settings > SSH Key Management and then following the on-screen instructions.

Troubleshooting

Git Communication Error

Git Communication Error

Error Message

Problem when cloning the application. This can be due to a network problem or missing security credentials. Refer to error log for details.

Issue

When a FeedHenry account is set up, the user’s API Keys are configured by default, but the SSH Public key must be manually configured. Importing a FeedHenry application into JBoss Developer Studio means that the application repository is accessed via Git. Without a Public SSH key, the IDE is unable to complete the action and this error appears.

Resolution

  1. Click OK to close the Git Communication Error window.
  2. Log into FeedHenry at: https://[your-studio-domain].feedhenry.com.
  3. Click the icon located in the uppermost right-side corner of the screen to display the context menu.
  4. Click Settings > SSH Key Management and then click Add New Key.
  5. In the Public Key field, enter your SSH Public key. An existing Public SSH key is available at ~/.ssh/id_rsa.pub. Alternatively, generate a new Public SSH key with the following command:
    ssh-keygen -t rsa -C "username@example.com"

Invalid Preferences

Invalid Preferences

Issue

When the user logs into FeedHenry for the first time, the Invalid Preferences dialog box appears informing the user that the FeedHenry connection preferences are unidentified or invalid and that the user must correct the preferences. Refer to the Set the Preferences section for details to set the connection preferences.

Comments