/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by 
 * Appcelerator. It should not be modified by hand.
 */
package ${config['appid']};

import org.appcelerator.titanium.TiApplication;
import org.appcelerator.kroll.runtime.rhino.KrollBindings;
import org.appcelerator.kroll.KrollModule;
import org.appcelerator.kroll.KrollModuleInfo;
import org.appcelerator.kroll.KrollRuntime;

% if runtime == "v8":
import org.appcelerator.kroll.runtime.v8.V8Runtime;
% else:
import org.appcelerator.kroll.runtime.rhino.RhinoRuntime;
% endif

import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;

import android.util.Log;

public final class ${config['classname']}Application extends TiApplication
{
	private static final String TAG = "${config['classname']}Application";

	@Override
	public void onCreate()
	{
		super.onCreate();

		appInfo = new ${config['classname']}AppInfo(this);
		postAppInfo();

		% if runtime == "v8":
		KrollRuntime.init(this, new V8Runtime());
		% else:
		KrollRuntime.init(this, new RhinoRuntime());
		% endif

		stylesheet = new ApplicationStylesheet();
		postOnCreate();

		<%def name="onAppCreate(module)" filter="trim">
			% if module['on_app_create'] != None:
			try {
				${module['class_name']}.${module['on_app_create']}(this);
			} catch (Exception e) {
				StringBuilder error = new StringBuilder();
				error.append("Error running onAppCreate method ")
					.append("\"${module['on_app_create']}\"")
					.append(" for module ")
					.append("${module.get('api_name') or module.get('manifest').moduleid}: ")
					.append(e.getMessage());
				Log.e(TAG, error.toString(), e);
			}
			% endif
		</%def>

		% for module in app_modules:
		${onAppCreate(module)} \
		% endfor

/*
		% if len(custom_modules) > 0:
		// Custom modules
		KrollModuleInfo moduleInfo;
		% endif
*/
		% for  module in custom_modules:
		${onAppCreate(module)} \

		KrollBindings.addExternalBinding("${module['class_name']}", ${module['class_name']}Prototype.class);
		<% module_id = module['manifest'].moduleid %>
		${module_id}.${module["manifest"].name}GeneratedBindings.init();
/*
		<% manifest = module['manifest'] %>
		moduleInfo = new KrollModuleInfo(
			"${manifest.name}", "${manifest.moduleid}", "${manifest.guid}", "${manifest.version}",
			"${manifest.description}", "${manifest.author}", "${manifest.license}",
			"${manifest.copyright}");

		% if manifest.has_property("licensekey"):
		moduleInfo.setLicenseKey("${manifest.licensekey}");
		% endif

		KrollModule.addModuleInfo(moduleInfo);
*/
		% endfor
	}
}

@@ -1789,28 +1789,8 @@
  0:%0A
-%09%09// Custom modules%0A
 %09%09Kr
@@ -1815,16 +1815,16 @@
 leInfo;%0A
+
 %09%09%25 endi
@@ -1824,24 +1824,25 @@
 %09%25 endif%0A*/%0A
+%0A
 %09%09%25 for  mod
@@ -1892,16 +1892,54 @@
 le)%7D %5C%0A%0A
+%09%09%3C%25 manifest = module%5B'manifest'%5D %25%3E%0A
 %09%09KrollB
@@ -1969,35 +1969,32 @@
 ing(%22$%7Bm
-odule%5B'class_name'%5D
+anifest.moduleid
 %7D%22, $%7Bmo
@@ -2036,39 +2036,18 @@
 ;%0A%09%09
-%3C%25 module_id = module%5B'
+$%7B
 manifest
 '%5D.m
@@ -2042,18 +2042,16 @@
 manifest
-'%5D
 .modulei
@@ -2055,45 +2055,20 @@
 leid
- %25%3E%0A%09%09$%7Bmodule_id%7D.$%7Bmodule%5B%22
+%7D.$%7B
 manifest
 %22%5D.n
@@ -2067,10 +2067,8 @@
 fest
-%22%5D
 .nam
@@ -2099,49 +2099,12 @@
 ();%0A
+%0A
 /*%0A
-%09%09%3C%25 manifest = module%5B'manifest'%5D %25%3E%0A
 %09%09mo
@@ -2483,16 +2483,17 @@
 fo);%0A*/%0A
+%0A
 %09%09%25 endf

fix to the App.java template for 3rd party module generation