Difference between revisions of "Onelab/Mobile"

From ONELAB
Jump to: navigation, search
(Mobile - Build for iOS)
Line 1: Line 1:
= Mobile - Test the Beta =
+
 
'''You can report any bug/suggestions/... by sending us an email: mobile @ onelab . info (without spaces)'''
+
Please report bugs and suggestions for the mobile version of Onelab to mobile @ onelab . info (without spaces).
 +
 
 +
= Short user guide =
 +
 
 +
Onelab/Mobile is available for iOS 7 (iPhone and iPad) and Android 4. It currently contains Gmsh and GetDP and runs all computations locally on your mobile device. Future versions will add support for remote calculations in the cloud.
 +
 
 +
== Running a pre-packaged model ==
 +
 
 +
== Installing new models ==
 +
 
 +
 
 +
= Installing unpublished/beta versions of Onelab/Mobile =
 +
 
 +
Follow the instructions below if you want to install a version of Onelab/Mobile that is not published officially on the App Store (for iOS) or the Google Play store (for Android).
 +
 
 +
== iOS ==
 +
 
 +
# Download '''Onelab.ipa'''
 +
# Send us your [https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html##//apple_ref/doc/uid/TP40012582-CH30-SW46 device ID]] by email at mobile @ onelab . info ; we will add your device to the list of the devices allowed for Onelab/Mobile beta development.
 +
# Install the Onelab/Mobile application through iTunes by [https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW6 double-cliking on '''Onelab.ipa'''].
 +
 
 +
== Android ==
 +
 
 +
# [https://developer.android.com/tools/publishing/publishing_overview.html#unknown-sources Allow the installation of non-Market apps] on your Android device (> Settings > Security > Unknown sources)
 +
# Install the application:
 +
## either download '''Onelab.apk''', upload it on your SD card and use a [https://play.google.com/store/search?q=file%20explorer&c=apps file explorer] to open it
 +
## or use the Android SDK tool '''adb''' and install the file: <source lang="bash">adb install Onelab.apk</source>
 +
## or use your web browser and directly download '''Onelab.apk''' on your device and install it
 +
 
 +
 
 +
= Compiling Onelab/Mobile =
 +
 
 +
 
 
== Android ==
 
== Android ==
Requirements:
 
* ''You need an Android device running Android >= 4.0''
 
<br />
 
Here are the steps to install Onelab on your device:
 
# Download the file ([http://onelab.info/files/.Mobile/Onelab.apk Onelab.apk])
 
# You have to [https://developer.android.com/tools/publishing/publishing_overview.html#unknown-sources allow installation of non-Market apps] on your Android device <br /> > Settings > Security > Unknown sources
 
# Then you can install the application <br />To do that, you can upload the file on your SD card and then use a [https://play.google.com/store/search?q=file%20explorer&c=apps file explorer] to open the file. <br />Or you can simply use your web browser and directly download the file (Onelab.apk) on your device and then install it. <br />Or you can use Android SDK's tool named adb and install the file: <source lang="bash">adb install Onelab.apk</source>
 
  
== iOS (iPad, iPhone, ...)==
 
Requirements:
 
* ''You need an iOS device running iOS >= 7.0''
 
<br />
 
To install the application on your device, you need to send us your device ID by email (mobile @ onelab . info). <br />
 
To know how to locate this ID you can check [https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html##//apple_ref/doc/uid/TP40012582-CH30-SW46 Apple's website]. <br />
 
We will then add your device to the list of the devices allowed for Onelab beta, and you will be able to [https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW6 install Onelab]. <br />
 
  
 
= How to add a model =
 
= How to add a model =

Revision as of 15:23, 28 March 2014

Please report bugs and suggestions for the mobile version of Onelab to mobile @ onelab . info (without spaces).

Short user guide

Onelab/Mobile is available for iOS 7 (iPhone and iPad) and Android 4. It currently contains Gmsh and GetDP and runs all computations locally on your mobile device. Future versions will add support for remote calculations in the cloud.

Running a pre-packaged model

Installing new models

Installing unpublished/beta versions of Onelab/Mobile

Follow the instructions below if you want to install a version of Onelab/Mobile that is not published officially on the App Store (for iOS) or the Google Play store (for Android).

iOS

  1. Download Onelab.ipa
  2. Send us your device ID] by email at mobile @ onelab . info ; we will add your device to the list of the devices allowed for Onelab/Mobile beta development.
  3. Install the Onelab/Mobile application through iTunes by double-cliking on Onelab.ipa.

Android

  1. Allow the installation of non-Market apps on your Android device (> Settings > Security > Unknown sources)
  2. Install the application:
    1. either download Onelab.apk, upload it on your SD card and use a file explorer to open it
    2. or use the Android SDK tool adb and install the file:
      adb install Onelab.apk
    3. or use your web browser and directly download Onelab.apk on your device and install it


Compiling Onelab/Mobile

Android

How to add a model

Android

On Android, you can open .geo, .pro files from a file explorer.

iOS

To add a model on iOS you can use File Sharing.
The model has to be in a directory with extension ".onelab".
Example for magnet:

magnet.onelab/
   magnet.geo
   magnet.pro
   magnet_data.pro
   Magnetostatics.pro
   infos.xml

and the file "infos.xml" looks like:

<?xml version="1.0" encoding="utf-8"?>

<models>
        <model>
                <title>Magnet</title>
                <summary>Simple magnet example.</summary>
                <file type="pro">magnet.pro</file>
        </model>
</models>

Mobile - Build for iOS

Requirement:

  • You need to be on a Mac
  • You need to have xcode >= 4
  • You need to have the iOS SDK >= 7.0

Compile the framework for iOS simulator

To compile for the simulator, the frameworks have to be for i386 architecture. Example for Gmsh:

mkdir buildIOSSimulator
cd buildIOSSimulator
cmake -DENABLE_LIB=1 -DDEFAULT=0 -DENABLE_BLAS_LAPACK=1 -DENABLE_MESH=1 -DENABLE_ONELAB=1 -DENABLE_POST=1 -DCMAKE_CXX_FLAGS='-m32' ../
make framework

Compile the frameworks for iOS device

To compile for an iOS device you need a toolchain (e.g. ios-cmake).

mkdir buildIOS
cd buildIOS
cmake -DDEFAULT=0 -DENABLE_LIB=1 -DENABLE_BLAS_LAPACK=1 -DENABLE_MESH=1 -DENABLE_ONELAB=1 -DENABLE_POST=1 -DCMAKE_TOOLCHAIN_FILE=/path/to/iOS.cmake -Gxcode ../
xcodebuild -target lib -configuration Release

Create the project

To create the project you have to create a new directory and then, create the project with cmake

mkdir iOSProject
cd iOSProject
cmake ../contrib/mobile/
make xcodeProject

Then you can use "open" command to open the project with xcode.

open Onelab/Onelab.xcodeproj

Mobile - Build for Android

This procedure has been tested only on a Linux distribution
Requirement:

  • You need to have Android SDK with a level >= 14
  • You also need Android NDK to compile libraries

Compile the libraries

Most of the Android powered device run on an ARMv7 architecture.
Here is the way to compile Gmsh library for this architecture.
To do this, you need a toolchain (e.g android-cmake)

mkdir buildAndroid
cd buildAndroid
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/android.toolchain.cmake -DDEFAULT=0 -DENABLE_LIB=1 -DENABLE_BLAS_LAPACK=1 -DENABLE_MESH=1 -DENABLE_ONELAB=1 -DENABLE_POST=1 ../
make androidGmsh

Create the project

The project need multiples libraries:

  • Gmsh
  • GetDP
  • ONELAB (see below)
  • PETSc
  • BLAS & LAPACK

The ONELAB library is a small library to interface the application (Java) with Gmsh (Native library). You can build it from gmsh-svn (it's in /contrib/mobile/)

To use the automated cmake procedure you have to create a directory (e.g. Gmsh) with:

  • The library with directory name and without any extension (e.g. Gmsh)
  • The headers (they can be obtain with "make getHeaders")

The final directory for Gmsh looks like

Gmsh/
   Gmsh
   Headers/
       *.h

Then you can create the project:

make androidProject

Then you can open the project with Eclipse or with Android Studio You can also compile using the command line:

android update project --name Onelab --path . --target targetID
ant release