Skip to content

Greta on smartphone project

Brice Donval edited this page Jan 7, 2020 · 5 revisions

Table of Contents

Greta On Smartphone

Welcome on the wiki of the Greta On Smart Phone project. It is a part of the Greta project, which consists on a portage of Greta on smartphone operating systems(iPhone OS, Android). For this, we have to organize ourselves around this working themes :

Greta on Android : how to adapt the Javaplayer for Android ?

Greta Java : how to translate the Ogreplayer(C++) into Java language ?

Greta Web : how to create a webpage with Greta embedded ?

Greta on iPhone : how to adapt the Javaplayer for iPhone ?

About smartphones

Into the great panel of Smartphone OS, we decided to focus our attention on two of them : iPhone OS, the mobile operating system designed by Apple for their eponymous Smartphone, and Android, the open-source system built by Google. We choose to work on a Java Applet for our project because it allows us to separate from several problems : first, we don't have to ask ourselves if there's an adaptation of Ogre on the target mobile. In fact, the informations which passes by the phone are only pictures and video flow. In fact, we don't have to built an entire player on Objective C for iPhone OS.

About Ogre3D

One of the main problems of the project consists on finding an adaptaption of the 3D rendering machine of Greta (Ogre3D) on the host operating system, for the chosen language. Indeed, Ogre3D is natively built in C++, so the first problem is to find a built of Ogre in Java. There is a project for that : Ogre4J

Greta on Android

What is Android ?

Android is an operating system developed by Google for their mobile devices. It's one of the main competitors of iPhone OS on the smartphone market. Contrary to it, Android is an open-source project, where application development is not controlled or limited.

Setup Ogre on an Android device

Requirements

To easily get and compile .so libraries, it is recommended to work on a linux distribution (for example Ubuntu or Fedora). For our project, we choose to work with the following tools :

  • Ubuntu Linux 10.4 / Windows 7 professional
  • Eclipse IDE for Java Developers
  • The Android Standard Development Kit
  • ADT plugin for Eclipse
  • Android NDK
  • Ogre4J and the selected dll from Ogre3D : libOgreMain.so
The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.

Step by step

1. First, you need to install the latest version of Eclipse(3.2 or higher). You can find it on linux repositories or here. You can choose anyone, but "Eclipse IDE for Java Developers" appears to be pre-configured for our type of projects.

2. Download the android SDK here. Select the appropriate platform. At the end of the download, unpack it wherever you want on your computer, and memorize the folder you unpack it into. We are going to call this folder $SDK.

3. As for the SDK, you need now to download the android NDK. It is a set of tools that allows Android application developersto embed native machine code compiled from C and/or C++ source files into their application packages. You can get it here. Unpack it wherever you want, the folder you choose is going to be called $NDK.

4. Open Eclipse, and select your workspace. We're gonna call it $WORKSPACE.

5. Select Help -> Install new software... -> Add -> ADT Plugin/https://dl-ssl.google.com/android/eclipse/

6. Select the ADT plugin for Eclipse, and accept the licence requirements. OK, allright : now you've got all the needed tools to implement native libraries on Android.

Greta on Java

The first objective of the project was to build a secondary Greta player, in Java in spite of C++. It allowed to prepare the definitive migration of Greta to Java, and also to make a program which could run on an Applet(used for Smart phones). So we choose Java, and then studied the structure of Greta player to translate it.

Greta C++ player : structure

[Fichier:greta/smartphone/gretajava:gos2.png]

Step by step

Greta Web

The objective is to display Greta's animation on a web browser. The source is based on the Java Player, developed for the smartphone project, but the Greta Web project can be used for other applications.

Greta web : structure

The project is articulated around a specific structure, which is described on the present schema.

Image(greta/smartphone/gretaweb:gos.png, 300, border=1)

Green parts : C++

Orange parts : Java

The Java Ogre Player is built around two blocks :

The Coreplayer, which receives FAP/BAP and analyses .mesh files to construct the animation and renders the frames. It is placed beetween the 3D machine(Ogre) and the Applet. In the case of Ogre, because it's written natively in C++, we need to adapt it with using the Java specification for Ogre. Some libraries had been developed for this.

The second part of the Java Ogre Player is the Activeplayer : his role is to connect itself to the whiteboards(controlled by a activemq-apache system) and to assure the connexion beetween the Applet and Semaine. It takes user commmands like "make Greta laugh" as input, and gets FAP/BAP datas from Greta as outputs. The player's structure is the same as the local C++ player until the output of the Coreplayer. Indeed, the animation is transferred to a Java Applet, which could be launched by a web browser. Contrary to the C++ player, Ogre and the video output are not on the same machine.

Requirements

  • Ogre dll libraries
  • Ogre Java .jars
  • Java jdk 1.6

Step by Step

First, create your applet, using your IDE(NetBeans, Eclipse, ...). Then, crate a .jar with all the .class. jar.exe cf ogre.jar <my_class_folder> For the applet source, you can go [wiki:greta:smartphone:source:main].

Then, you need to sign all the .jar you are going to use. It includes : The external libraries, like swt.jar

The .jar which contains all the dll, native.jar

The archive of the project, ogre.jar

To sign it, create a keystore. keytool -genkey -keystore myKeystore -alias myself(keytool.exe is on the jdk setup folder, as the jarsigner).

keytool -selfcert -alias myself -keystore myKeystore

Then, for each jar : jarsigner.exe -keystore myKeystore -storepass password <jarfile.jar> myself

Getting started with Greta

Greta Architecture

Quick start

Advanced

Functionalities

Core functionality

Auxiliary functionalities

Preview functionality

Nothing to show here

Previous functionality (possibly it still works, but not supported anymore)

Clone this wiki locally