I’m writing mobile apps with the help of Appcelerator’s Titanium Mobile.
I need to load javascript code (business logic) from our server and execute it on the device. So this is basically dynamically injecting code into Titanium Mobile app. Additional note: this code needs to call a few Titanium’s methods.
Can this be done?
Thanks, Peter
Yes this can be done. You can’t put this application in the App store as it’s against their Terms of Service to download code remotely and execute it.
There are examples in the Kitchen Sink on downloading a file remotely and saving it. That file can be a .js file, and can be included or referenced when your app loads. It can have JSON, functions, whatever in it.
I’m doing this in an app right now for moving JSON objects around, but should be able to run code too.