Giter Site home page Giter Site logo

jhybrid's Introduction

Starter kit for a new generation of hybrid applications

Description

If you follow the following steps, you will build gwt, javascript and Objective-C calculators. These calculators are built from a single java code base.

This demo illustrates what Ray Cromwell call a new generation of Hybrid applications :

Requirements

  • Java 6 (Java 7 syntax is not yet supported)
  • Maven
  • Android : The Android SDK
  • XCode and the command line compiler tools for the Mac OS part.

J2Objc installation

Example :

export J2OBJC_DISTRIBUTION=/Users/abdennebi/Dev/Tools/j2objc-0.8.8

##Testing

  • Run `mvn install' at the root directory. Then follow the next steps :

Testing GWT

  • Go to demo/calc-engine-gwt-demo directory
  • Run command mvn jetty:run-war
  • Open your internet browser and call the following URL : http://localhost:9999/
  • To stop jetty, run the command mvn jetty:stop

Testing Javascript

  • Go to demo/calc-engine-js-demo directory
  • Run command mvn jetty:run-war
  • Open your internet browser and call the following URL : http://localhost:9999/
  • Read and follow the displayed indications
  • To stop jetty, run the command mvn jetty:stop

Testing Chrome App

  • Go to demo/calc-engine-js-demo directory
  • Run command mvn package
  • Launch your Chrome Browser and bring up the extensions tab by taping chrome://extensions/ in the address bar.
  • Make sure the Developer mode checkbox has been checked.
  • Click the Load unpacked extension button, navigate to the demo/calc-engine-js-demo/target/calc-engine-js-demo-1.0-SNAPSHOT/ folder, then click OK.
  • The application is installed, you can now launch it by clicking on its icon in the Applications panel.

Testing Android

Setup

  • Download and install the Android SDK
  • Set the ANDROID_HOME environment variable that points to the installation directory of the Android SDK.
  • Add $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools to yourPATH.
  • Launch an Android Virtual Device or plug your Android phone (tutorial can be found here).

Testing

  • Go to demo/calc-engine-android-demo directory
  • Run command mvn clean package android:deploy

Testing Objective-C

Don't forget to define the J2OBJC_DISTRIBUTION environment variable!

  • Go to demo/calc-engine-objectivec-demo directory

  • Run make, it will create two executables : one called launcher and other called calc

    • the launcher executes any Java class containig a main function. In our case the class is CalcMain. The full command is ./launcher com.sfeir.calc.CalcMain expression. Example ./launcher com.sfeir.calc.CalcMain 36+69.
    • the calc executable corresponds to the native code that references the transcompiled Javacode. Please take a look to the main.m source file.
  • to clean objects run make clean, to remove executables run make mrclean

Improving the Calculator

  • Edit calc-engine-core/src/main/java/com/sfeir/calc/CalcEngineImpl.java
  • Rebuild, that's it

jhybrid's People

Contributors

dgirard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jhybrid's Issues

Gradle support

Thanks a lot for example!

I just wonder why you used maven but not gradle?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.