Skip to content

Importing Rajawali and RajawaliExamples

contriteobserver edited this page Jul 16, 2017 · 13 revisions

This is a quick guide on how to import Rajawali and RajawaliExamples for the first time.

For this process I am assuming that you have already taken the necessary first steps of getting Eclipse for Android up and running. If you have not done that yet head over to our friends Google and pick up the bundle.

You should also set up a GitHub account, and I highly recommend using the GitHub application (links in the footer of this page) for managing your repositories. Once you have gotten this far you are ready to start working with Rajawali.

Cloning vs. Downloading

The first step is to make a local copy of the Rajawali and RajawaliExamples projects. There are two easy ways in GitHub to do this. You can either download a ZIP archive of the project, or you can clone the project.

I like cloning because it uses the GitHub application, and has an option for instantly synchronizing your local copy with the remote repo. This is a fast and easy way to get the latest updates that are pushed.

You can download or clone the projects from their main repository pages:

Rajawali

RajawaliExamples

Whether you choose to clone or download, you probably will want to use one of the release tags. The master branch of both the library and examples is used for development and should be considered unstable for production code. When we release a stable version, it will be tagged. If you are cloning, you can simply checkout a tag. If you are downloading a copy, you can find the tag zips here:

[Rajawali Tags] (https://github.com/MasDennis/Rajawali/tags)

RajawaliExamples Tags

Importing

With a copy of each project on your local drive you can now import these projects into Eclipse.

Launch Eclipse and create a workspace if you don't already have one. I won't go into the details about using Eclipse, but your workspace is a collection of folders that contain your projects. You can make your worksapce and local Git repository the same folder for easy version control.

  1. To import a project click the File menu and select Import...
  2. In the Import window expand General and select Existing Projects into Workspace
  3. Select the root directory by clicking Browse
  4. Locate and select the Rajawali folder
  5. Select Copy projects into Workspace (optional)
  6. Click Finish

After a short time the project will be copied and imported. Repeat the above steps for RajawaliExamples

OMG Eclipse Errors!!!1!

Upon initial import of RajawaliExamples you may find that Eclipse produces a few errors. This is caused by the linkage between the Rajawali library and the examples project being severed. You have to re-establish this connection before RajawaliExamples will compile.

First, ensure that Rajawali is flagged as a "library" in Properties

  1. Select Rajawali in the Package Explorer view
  2. Click the Project menu, and select Properties
  3. In the Project Properties window click Android in the left navigation column
  4. Tick the is Library box if it is not already
  5. Click Apply
  6. Then click OK

Second, restore the linkage from Rajawali to RajawaliExamples in Properties

  1. Select RajawaliExamples in the Package Explorer view
  2. Click the Project menu, and select Properties
  3. In the Project Properties window click Android in the left navigation column
  4. Select the broken Rajawali library link at the bottom of the window, indicated with a red X
  5. Click the Remove button to delete the old library link
  6. Click Apply -- This is critically important because Eclipse is stupid.
  7. Click the Add... button and select Rajawali from the pop-up
  8. Click Apply again
  9. Then click OK

In most cases this will resolve all current build problems. If some remain there are a couple steps to try before throwing in the towel and asking for support.

Clean the projects individually Sometimes cleaning "all" won't do the trick.

  1. Click Project menu, select Clean...
  2. Choose Clean projects selected below
  3. Select your project
  4. Click OK
  5. Repeat for each project

Restart Eclipse

Simply shutting down the program and reopening your workspace will clear the errors. This is what I have to do almost every time.

At this point you will see a whole list of "warnings" in Eclipse. You can ignore these are they are regarding deprecated functions that will cause no harm, but are there to enable legacy support.

Clone this wiki locally