Custom Module Example?
[FIXED BY 1.1.2 PATCH] Sorry to ask this again, but this is extremely important. Does anyone have a simple example of a custom module for Titanium Mobile 1.0? The old example does not work, there's nothing in the Kitchen Sink for this, and there's no documentation for it.
A simple "Hello, world" example would be great.
14 Answers
-
I'm working on porting a full blown example right now and hope to have this done in the next day or so. If you take a look at this page it's still a decent getting started. All of our internal modules in Git use the same SDK so you could also look at the source. The Android Module SDK isn't yet ready but will follow a very similar pattern - except it's java and Eclipse.
-
Thanks Jeff. Excellent, fast response. This looks quite promising.
Will we be able to create and maintain custom modules across iPhone, Android, OSX, Windows, and Linux platforms? We'll have some custom code that we'll need to access on all the platforms, and any best-practices for maintaining these custom modules across platforms would be very welcomed.
If this can be accomplished without a huge hassle, it's a major selling point for Titanium.
-
I believe this just showed up in the developer documentation:
http://developer.appcelerator.com/doc/mobile/iphone/module_sdk
-
We saw that, but unfortunately, we can't get it to work. We're missing something, but don't know what yet.
-
The new documentation is vague at best, real world examples, even as the poster suggested "Hello World" would be nice, your platform is noce, it's easy but that comes at a price of substance, without the ability to extend the platform and better documentation there is little hope this will be worth the millions invested into it.
-
The new documentation is vague at best, real world examples, even as the poster suggested "Hello World" would be nice, your platform is noce, it's easy but that comes at a price of substance, without the ability to extend the platform and better documentation there is little hope this will be worth the millions invested into it.
-
We have followed the new documentation exactly (even copied and pasted one method and used the example as shown.) It does not work, but gives:
[ERROR] Script Error = Result of expression 'Titanium.MyFirst' [undefined] is not an object. at app.js (line 7).
Has ANYONE been able to create a working custom module for 1.x?
-
Same issue here, even returning a simple string throws an error that the function undefined is not an object, no hello world…odd
-
This has been fixed by a patch to 1.1.2. It was broken, but after installing the updated sdk (1.1.2+) (and reinstalling the development template) it works fine now.
-
Mark, where did you get the patch 1.1.2+ ? i'm still getting the error "result of expression 'Titanium.MyFirst' [undefined] is not an object. " with the 1.1.2 sdk. Thanks.
-
The patch was sent to me by the Appcelerator staff. The fix will be in their next release, or you can email them and ask for the patch.
-
Does anybody have an estimate for when the release that fixes this will be?
-
The patch can be found here:
http://github.com/appcelerator/titanium_mobile/commit/33d25f063d2c8b6383470515609b8c2aa899b507Changed the mentioned file and voila, everything works … finally. Next step, finding out how Android modules might work.
-
I am very interested in this too… one example for iPhone and one for Android too would be great!