/* 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
	}
}

/* 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:
		KrollModuleInfo moduleInfo;
		% endif
*/

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

		<% manifest = module['manifest'] %>
		KrollBindings.addExternalBinding("${manifest.moduleid}", ${module['class_name']}Prototype.class);
		${manifest.moduleid}.${manifest.name}GeneratedBindings.init();

/*
		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
	}
}

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