@@ -0,0 +1,1840 @@
+package com.pdi.hybridge;%0A%0Aimport java.util.Observable;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONObject;%0A%0Aimport com.pdi.hybridge.HybridgeConst.Event;%0A%0Aimport android.webkit.WebView;%0A%0Apublic class HybridgeBroadcaster extends Observable %7B%0A%09%0A%09private static HybridgeBroadcaster instance;%0A%09%0A%09private boolean isInitialized = false;%0A%09%0A%09public HybridgeBroadcaster () %7B%0A%09%7D%0A%0A    public static HybridgeBroadcaster getInstance () %7B%0A        if (instance == null) %7B%0A            instance = new HybridgeBroadcaster();%0A        %7D%0A        return instance;%0A    %7D%0A    %0A    public void initJs (WebView view, JSONArray actions, JSONArray events) %7B%0A    %09//if (!isInitialized) %7B%0A%09%09%09runJsInWebView(view, %22window.HybridgeGlobal%7C%7C(HybridgeGlobal = %7B%22 +%0A%09%09            %22  isReady : true%22 +%0A%09%09            %22, version : %22 + HybridgeConst.VERSION +%0A%09%09            %22, actions : %22 + actions.toString() +%0A%09%09            %22, events : %22 + events.toString() +%0A%09%09        %22%7D)%22 + %0A%09%09        %22;window.$&&$(%5C%22#hybridgeTrigger%5C%22).toggleClass(%5C%22switch%5C%22);%22);%0A%09%09%09isInitialized = true;%0A    %09//%7D%0A    %7D%0A%09%0A%09public void firePause (WebView view) %7B%0A%09%09HybridgeConst.Event event = HybridgeConst.Event.PAUSE;%0A%09%09notifyObservers(event);%0A%09%09fireJavascriptEvent(view, event, null);%0A%09%7D%0A%09%0A%09public void fireResume (WebView view) %7B%0A%09%09HybridgeConst.Event event = HybridgeConst.Event.RESUME;%0A%09%09notifyObservers(event);%0A%09%09fireJavascriptEvent(view, event, null);%0A%09%7D%0A%09%0A%09public void fireJavascriptEvent (WebView view, Event event, JSONObject data) %7B%0A%09%09String json = data != null ? data.toString() : %22%7B%7D%22;%0A%09%09StringBuffer js = new StringBuffer(%22HybridgeGlobal.fireEvent(%5C%22%22);%0A%09%09js.append(event.getJsName()).append(%22%5C%22,%22).append(json).append(%22);%22);%0A%09%09runJsInWebView(view, js.toString());%0A%09%7D%0A%09%0A%09public void runJsInWebView (WebView view, String js) %7B%0A%09%09view.loadUrl(%22javascript:(function()%7B%22 + js + %22%7D)()%22);%0A%09%7D%0A%7D%0A

EDIT add android hybrid observer (HybridgeBroadcaster.java)