Fedora 17 Development Setup

Install Eclipse

  • Download Eclipse Indigo for Java SE developers.
  • Unpack tar into ~/

    • Create shortcut on desktop that points at /home/myuser/eclipse/eclipse
  • Install Eclipse Software:

    • Git
    • Subclipse
    • ADT-Plugin (Android)

Download MRL source

Assumes workspace used is "~/workspace"

cd ~/workspace/ &&\
 git svn clone http://myrobotlab.googlecode.com/svn/trunk/ myrobotlab

Setup Git

  1. If you haven't set up your global Git email yet, do so by running this with your email address you want to use (best bet is to use whatever email address you plan to use with GitHub):

    git config\
     --global user.email "lowrider@myrobotlab.org"
    
  2. Add a .gitconfig file so that you don't have to worry about files you will never want to check in:

    echo ".gitignore
    android/.settings/
    android/bin/
    android/gen/
    mrlclient/bin/
    myrobotlab-tests/bin/
    myrobotlab/bin/
    " > ~/workspace/myrobotlab/.gitignore
    
  3. Set up your bash so that it includes the current working Git branch when you're in a folder containing a Git repo by adding this to ~/.bash_profile:

    parse_git_branch() {
    git branch 2> /dev/null\
     | sed -e '/^[^*]/d' -e 's/* \(.*\)/[ \1 ]/'
    }
    PS1="\\w \\[$(tput bold; tput setaf 3)\\]\$(parse_git_branch) \
    \\[$(tput sgr0)\\]\\$ \\[$(tput sgr0)\\]" 

    Gives you:Bash with Git branch

Import projects

  • Open Eclipse
  • Start importing:

    • File -> Import...
  • Select the Git method:

    • Git -> Projects from Git
  • Repository Source: local
  • Git Repository:

    • Click the Add... button to the upper-right
    • Browse to the location used above (~/workspace/myrobotlab in my case) and select that folder
    • Click the Finish button
  • Wizard for importing:

    • Use the default selected "Import existing projects". This will import all the projects checked out into the local Git repository.

Initial Hicups

  1. Error showing up in Eclipse:

    Failed to get the adb version:
     Cannot run program "/home/myuser/android-sdks/platform-tools/adb"
      : error=2,
     No such file or directory from
      '/home/myuser/android-sdks/platform-tools/adb' - exists=true
    

    Run the command in Terminal to test what is wrong:

    ~/android-sdks/platform-tools/adb
    

    Result:

    Error: /home/myuser/android-sdks/platform-tools/adb
      : /lib/ld-linux.so.2
      : bad ELF interpreter
      : No such file or directory
    

    Find a suggestion online and try it

    sudo yum install glibc.i686
    

    Try it again:

    ~/android-sdks/platform-tools/adb
     : error while loading shared libraries
     : libncurses.so.5
     : cannot open shared object file
     : No such file or directory
    ~/android-sdks/platform-tools/aapt
     : error while loading shared libraries
     : libz.so.1
     : cannot open shared object file
     : No such file or directory
    

    Seems like I'm missing some required 32-bit files

    sudo yum install\
     ncurses-libs.i686\
     libstdc++.i686\
     zlib.i686
    
  2. Error showing up in Eclipse:

    Android requires compiler compliance level
     5.0 or 6.0. Found '1.7' instead.
     Please use Android Tools > Fix Project Properties.
    
  3. android project compiler complaints (317 errors):

    Android cannot be resolved to a type
     AndroidActivity.java
     /android/src/org/myrobotlab/android
     line 30	Java Problem
    

    Possible issue:

    import org.myrobotlab.service.Android;
    

    Changed the following for the linked myrobotlab src folder in the android project. From:

    WORKSPACE_LOC/myrobotlab/src
    

    To:

    WORKSPACE_LOC/myrobotlab/myrobotlab/src
    
  4. mrclient project compiler complaints (139 errors):

    CMDLine cannot be resolved to a type
     MRLClient.java
     /mrlclient/src/org/myrobotlab/client
     line 156
     Java Problem
    

    Possible issue: mrclient src folder framework isn't linked properly. From:

    WORKSPACE_LOC/myrobotlab/src
    

    To:

    WORKSPACE_LOC/myrobotlab/myrobotlab/src
    
  5. android project compiler complaints (97 errors):

    R cannot be resolved to a variable
     AndroidActivity.java
     /android/src/org/myrobotlab/android
     line 34
     Java Problem
    

    This usually shows up if there are Android config issues. This might be related:

    The method onAccuracyChanged(Sensor, int)
      of type Android must override a superclass method
     Android.java
     /android/myrobotlab/org/myrobotlab/service
     line 101
     Java Problem
    

    Installed JDK 1.6 (simply download the RPM bin, chmod +x, and ./jdk.bin execute it) and restarted eclipse.

  6. android project compiler complaints (22 errors):

    The method onAccuracyChanged(Sensor, int)
      of type Android must override a superclass method
     Android.java
     /android/myrobotlab/org/myrobotlab/service
     line 101
     Java Problem
    

    GroG suggests this is because of Android compatibility issues.
    Fix: change project settings to use Java Compiler 1.6 instead of 1.5


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
admin's picture

Install a 1.6 JDK version -

Install a 1.6 JDK version - change the following

 

Windows -> Preferences -> Java -> Compiler -> Compiler Compliance Level -> 1.6
make sure the checkbox underneath is selected "Use default compliance settings" and all other versions should say 1.6 underneath in grey.
SwedaKonsult's picture

JDK 1.6

Changing to 1.6 fixed some of the issues. It's too bad that Android defaults to 1.5.

admin's picture

Holy crap,didn't know it was

Holy crap,

didn't know it was you till I saw the picture :)

I haven't compiled it on 1.7 dunno if there are any errors, flip it to 1.7 and see if anything glows red..

I don't know how to GitHub, I'm still old school....

Its just the Android project bitch'n... "myrobotlab" is the bigger kahuna

admin's picture

I'd have to learn something

I'd have to learn something new though ?!? sad jeeze didn't even know smiley's worked till now

SwedaKonsult's picture

Getting Runtime Running

  1. Right-click on the myrobotlab project: Run As -> Run Configurations...
  2. Double-click on the Java Application type in order to create a new run config
  3. Project: myrobotlab
  4. Main class: org.myrobotlab.service.Runtime
  5. Arguments -> Program arguments:

    -Djava.library.path="libraries/native/x86.32.linux;libraries/native/x86.64.linux"
     -cp "libraries/jar/*" org.myrobotlab.service.Runtime
     -service gui GUIService
     -logLevel INFO
     -logToConsole
    
SwedaKonsult's picture

Emulator SDL Problem

The following error shows up with I try to run the android project using a 2.3.3 device.

 

SDL init failure, reason is: No available video device
SwedaKonsult's picture

Tried YUM SDL-devel

Tried installing SDL-devel to see if that fixed it:

sudo yum install SDL-deve SDL-devel.i686

Did not fix it.

SwedaKonsult's picture

Fixed

Ran the following in order to figure out what was failing:

strace ~/android-sdks/tools/emulator\
 -avd "2.3.3" -verbose

This pointed me in the direction of libXrandr.so.2 so checked what provides that in YUM:

sudo yum provides libXrandr.so.2

which, in turn, points me to libXandr (go figure!)

sudo yum install libXrandr.i686

This fixed it so that I can now run the emulator.