Question

I am developing a mobile application using Titanium SDK. This is my first mobile app. Most of the app is done successfully. The only module that remains is Video conference support. The company I am working in has chosen to use Opentok SDK. I finished the web application and it works fine. Now I've hit a wall in mobile app and can't move further. The problem is Opentok provides a module to use for Titanium, But it only supports build to IOS not Android. The reason we chose Titanium is for cross platform support.

Is there any module available to use or any other way to implement Opentok with Titanium that builds into both Android and IOS.

I have already tried using a WebView to open the conference module of web application. But bad luck, Opentok only works with chrome browser in mobile. But WebView utilizes native stock browser which does not support WEBRTC. So, opentok doesn't work with webview too.

Please help me. This is my first app and I am stuck at this point.

Was it helpful?

Solution

To Create a Module for OpenTok Android:

These are the steps I would follow.

  1. Create a new Android module: titanium.py create --type=module --id=com.tokbox.ti.opentok --platform=android --name=opentok-titanium
  2. Follow the installation instructions from OpenTok for Android. (Hint: I added a separate section down below to help you get through their instructions.)
  3. Make sure the module runs: ant run.emulator or ant install.
  4. Try running their sample, fully in JAVA, completely separate from Titanium. Make sure it works, and you know what it should look like. Then, figure out what exactly you need from their API. Or, if you're feeling ambitious, decide you want everything. Work to strip down the example to just the surface area that you need. Simplify it down to the least number of files you feel makes sense.
  5. Write an example/app.js that demonstrates how you want the module to be used. For example, maybe you'd start off by requiring the module, then setting some API + Session keys, then calling some API, etc.
  6. Based on the documentation, port what you need in to your module. Reference the Appcelerator Android module dev guide and open source Android modules for inspiration.
  7. Write documentation for the module to specify what the various properties, methods, etc are, so that other developers can figure out how to use the module.
  8. When you're done, submit a PR to OpenTok and revel in your creation and contribution.

Some Hints for Step 2:

  1. .jar files go in lib/.
  2. .so files go in platform/android/libs/armeabi/
  3. Permissions go in timodule.xml, and you can see an example in the open source PayPal module for Android

OTHER TIPS

OpenTok does not work with WebView. OpenTok support for Titanium Android does not currently exist because it is currently in beta and we don't currently have engineering bandwidth to build a Titanium Android integration. However, if you are familiar with Titanium, you are more than welcome to add the integration yourself and send a pull request. You can get the Android beta here and you can get titanium source code here

If you are in a hurry and open to trying other frameworks, our PhoneGap Plugin currently supports both android and ios.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top