1

I am looking for guidance on a mobile app project I am working on. Most of the app can be delivered using angular.js (and perhaps ionic) javascript technology. For one component though I need to integrate with an API, specifically google project tango API. This API is only available in java, C or unity (https://get.google.com/tango/developers/). Im aware I am a little out of my depth, but is it possible to use both technologies in the same mobile app, and if so can you provide some guidance on how to setup the dev environment?

Thanks in advance for any help.

Alan Power
  • 319
  • 1
  • 2
  • 12
  • Conceivably it could be just a JavaScript bridge to Java / JNI code but the number of hoops for data to go in and out of the different environments means you will take a hit on performance. – Morrison Chang Aug 03 '16 at 22:00

2 Answers2

1

There is nothing special about Ionic that prevents Android's excellent support of JavaScript ↔ Java binding:

https://developer.android.com/guide/webapps/webview.html#UsingJavaScript

How to call javascript from Android?

In the case of Ionic and Tango, you can interact with the Java Tango API from within Ionic controllers.

Community
  • 1
  • 1
Lightbeard
  • 4,011
  • 10
  • 49
  • 59
  • Thank you, that's great to know. It is early days for me in development and I am trying to fiend the ideal approach before heading down the wrong road. Would you recommend anything other than ionic that might facilitate integration with project tango api? – Alan Power Aug 04 '16 at 13:46
  • 1
    Well I recommend that you use Android Studio as your IDE. It appears you are android-centric at least for now and that will make it a lot more practical to write the Java Tango API portion of your app. You can build a stock Ionic/Cordova app and [import](https://www.youtube.com/watch?v=4jc6GqOaQl8) it into Android Studio – Lightbeard Aug 04 '16 at 15:01
  • Sorry Lightbeard, just 1 final query in relation to the development workflow here. If I import the Ionic/Cordova app into android studio but then wish to make some changes to the Ionic project, should I make the changes outside of Android studio and import again, or do I need to complete all future development within Android studio? – Alan Power Aug 04 '16 at 21:06
  • I think both approaches are possible, but I think editing your Ionic templates and controllers in Android Studio would be most practical because everything would be developed in one place. It is a perfectly capable IDE for HTML/JavaScript/CSS in addition to Java – Lightbeard Aug 04 '16 at 21:35
0

Should your application be crossplatform? If it is mobile only and you want to write it in JS, you may try NativeScript. As far as I know NativeScript have access to C libraries https://github.com/NativeScript/sample-native-module and at the same time it has version for AngularJS (only second version). It also uses native widgets so it should be faster than Ionic. But such application won't work in browser - at least view layer will be different for mobile and web version.

  • Thanks Darth, I will have a look at this option. Is there a reason why you are recommending nativescript above others? – Alan Power Aug 04 '16 at 13:47