Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Has anyone successfully created and used an Android Module?

I'm trying to create a java module to call some native Android SDK functions, and I've followed http://developer.appcelerator.com/doc/mobile/android/module_sdk to the letter. I've created the module, got it building both in Eclipse and with ant, but can't get my mobile app to actually use the module.

The only deviation I've made from the documentation is to skip the @Kroll.method annotation on my module's methods, as there seems to be no such thing available in the 1.4 series APIs. I'm fairly certain this is actually my problem, but I haven't found any replacement.

I've tried placing the resulting .zip file in my app's root folder (as documented), in my Resources folder. I've made entries in my tiapp.xml file for the module. I'm using the require() method in my app.js as suggested, but in my console output I see java filenotfound exceptions for a "com.company.module.js" file.

My guess is that those annotations are used to generate a proxy javascript file, and since I can't apply the annotations the module's ant script can't generate that file.

Has anyone got this working on 1.4? Or is this a 1.5 only feature?

— asked November 17th 2010 by Nick Nystrom
  • android
  • kroll
  • mobile
  • module
  • proxy

2 Answers

  • Sorry, it's 1.5 only for Android.

    — answered November 19th 2010 by Don Thorp
    • I'm willing to try hand rolling whatever js proxy I need to to get this working. Can you point me to ANY example that might help?

      Or the alternate question is, is there a timeline on 1.5?

      — commented November 19th 2010 by Nick Nystrom
    • Okay, I'm praying that I ask this question the right way: Can't we build Titanium Android modules that extend TiModule, NOT the Kroll-based module system?

      — commented December 8th 2010 by Jeff Hampton
  • I am getting this exact same problem when integrating the example (hello world) module using SDK V1.5.1. Can anyone help?

    — answered January 24th 2011 by Bill Bostock
    1 Comment
    • I found the problem. I put the zip file in the root of my project as the documentation appeared to suggest, but it needed to go in Resources. Its now working.

      — commented January 25th 2011 by Bill Bostock
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.