Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble install ohNet-Master
09-09-2013, 01:51 PM
Post: #1
Trouble install ohNet-Master
Hello, when i go to cmd in admin mode.
i execute make install

but in bat file the line is: nmake
at windows we dont have it.

Im working with win7 atm. Gonna make an application for android to make connection with TV box's.

Gonna program in Java probably cause all the project its in Java.

what should i do to install ohNnet-Master, and how to import this to Eclipse android developer.

Find all posts by this user
12-09-2013, 10:07 AM
Post: #2
RE: Trouble install ohNet-Master
nmake is installed as part of Visual Studio. What version of Visual Studio do you have installed? If you don't have Visual Studio installed, you can download the free Express version.

To build ohNet, you'll need to have nmake and the other Visual Studio programs available on your path. The easiest way to ensure this is to start the "Visual Studio Command Prompt" from the Start menu and use it to build ohNet. Alternatively, you can start cmd.exe and then run the batch file "vsvars32.bat" before building ohNet.

I'm afraid I don't have experience with using the Java bindings, and simonc is away for a couple of weeks. I'll see if I can find someone who's more familiar with Java and Android development to give you advice.
Visit this user's website Find all posts by this user
16-09-2013, 01:30 PM
Post: #3
RE: Trouble install ohNet-Master
As a follow-up to Andrew's response, I agree that the most straightforward way to get into an environment suitable for building ohNet on Windows is by downloading the Express edition of Visual Studio and launching the "Visual Studio Command Prompt".

Building the Android bindings

As ohNet is written in C++, the Java bindings work via the Java Native Interface (JNI), so you will have to get the Android Native Development Kit (NDK) and install it, following the instructions on this page of the Android Developers site: Android NDK

A couple of environment variables need to be defined in order to build for Android, and these are:


(If you don't know how to set these under Windows, go to Control Panel, select "Advanced system settings" from the left-hand side, choose the "Advanced" tab, and click "Environment Variables". Within the new Window that should appear, add the new environment variables listed above if they don't already exist. JAVA_HOME should point towards your Java JDK, e.g., something like: "C:\Program Files (x86)\Java\jdk1.7.0_40", and ANDROID_NDK_ROOT should point to where you extracted the downloaded NDK to.)
Note: the ANDROID_NDK_ROOT var must be enclosed in double quotes.

Now that the environment is fully set up, it is time to build the ohNet bindings for Android. There are many different strands of ohNet, so we need to build the Android strand ("make install" alone will not work). Run the following command from your Visual Studio command prompt:

"nmake -f OhNet.mak ohNetAndroidNative"

If all goes well, you should now have the following (among other things) in the ohnet/Build/Obj/Windows/Release/ folder:
  • armeabi/
  • armeabi/
  • armeabi-v7a/
  • armeabi-v7a/
  • x86/
  • x86/
  • ohnet.jar
  • ohNet.lib
  • ohNetJni.lib

Using the Android bindings in Eclipse

We are now ready to use the ohNet Android bindings in Eclipse. In Eclipse, create a new Android Project as you normally would (File->New->Project, select Android Application Project, and set up your project).

With your project set up, you will want to include ohNet on the Java build path. To do this, right-click on your project and select "Build Path->Configure Build Path..." In the Properties window that appears, click on the Libraries tab and select "Add External JARs..." and navigate to ohnet/Build/Obj/Windows/Release and select ohnet.jar. You will now be able to start writing Java code using the ohNet bindings.

You will also need to include the native ohNet library and JNI wrappers on the build path so that the emulator (or your test device) can run whatever you build. Do this from the same Java Build Path window as above, but select the "Source" tab. Under the source tab, your project should be listed. Expand "<your_project>/src" and select where it says "Native library location: (None)". Then click the "Edit..." button on the right hand side, select "External Folder..." in the new Window and navigate to ohnet/Build/Obj/Windows/Release/armeabi (or whatever device architecture you're building for).

You should now be able to write and run Android applications using ohNet.

Hope this helps,
Find all posts by this user

Forum Jump: