{"id":21083894,"url":"https://github.com/spongebobsun/jswebview","last_synced_at":"2025-08-24T14:14:16.724Z","repository":{"id":84564431,"uuid":"39815479","full_name":"SpongeBobSun/JSWebView","owner":"SpongeBobSun","description":"JSWebView is a webview utility which support interaction between Javascript code \u0026 Java code.","archived":false,"fork":false,"pushed_at":"2015-08-14T05:08:21.000Z","size":268,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-10T14:23:45.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpongeBobSun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T05:46:47.000Z","updated_at":"2016-03-20T21:47:46.000Z","dependencies_parsed_at":"2023-03-02T06:16:04.349Z","dependency_job_id":null,"html_url":"https://github.com/SpongeBobSun/JSWebView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SpongeBobSun/JSWebView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpongeBobSun%2FJSWebView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpongeBobSun%2FJSWebView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpongeBobSun%2FJSWebView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpongeBobSun%2FJSWebView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpongeBobSun","download_url":"https://codeload.github.com/SpongeBobSun/JSWebView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpongeBobSun%2FJSWebView/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271884443,"owners_count":24838491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T20:20:30.648Z","updated_at":"2025-08-24T14:14:16.693Z","avatar_url":"https://github.com/SpongeBobSun.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"#JSWebView\nJSWebView is a webview which support interaction between Javascript code \u0026 Java code.\n\n##Project Status\nUnder developing. \n\nFollowing features are avaliable currently.\n\n* Choose images from webpage\n* Open a new window to preview image from webpage\n* Change actionbar title from webpage\n* Close webpage window\n\n##Project Structure\nThe whole project is a test project. \n\nJSWebView Library located in `jswebview` folder.\n\nFolder `dummypicloader` is my own image loading library.\n\n**JS-SDK is located in /app/src/main/assets/jswebview.js**\n\n##Components\nThis list will be updated when new components are added to this lib.\n\n* JSWebViewActivity\n\t\n\tJSWebViewActivity is the main Activity which contains the webview. All activities which use jswebview lib should extends this activity. It will initialize webview and add built in functions \u0026 interfaces into it.\n\t\n* ImageChooseActivity\n\n\tBrowse \u0026 choose images in your device. This activity is based on my own image load library - DummyPicLoader.\n\t\n* ImaePreviewActivity\n\n\tPreview images in a new Activity. Provide slide to next/prev page when you passing multipule images to it.\n* JSWebView\n\n\tMain widget of this lib. You can add your own js calling handler to it by using `addBaseHandler(...)`.\n\t\n* JS-sdk\n\n\tJavaScript sdk for this lib.\n\t\n##Usage\nFirst of all, import this lib to your IDE and add it to build path or gradle dependence.\n\nThen, create an Activity extends JSWebViewActivity, or add JSWebView widget to your own layout xml file. \n\n\tWARNNING: When using JSWebView directly in your custom Activity, you will NOT get any result which library build-in activity returns. You should write your won response code in onActivityResult(). You can find return type and format in JSWebViewActivity's source code.\n\nUse loadUrl function in activity or JSWebView\nto load your web app.\n\nWrite js code to call native code.\n\nHave fun.\n\n##APIs\n\n###JSWebViewActivity\n* addBaseHandler(String, CallBackFunction)\n\t\t\n\t\tAdd a native handler with name and action. When JavaScript code call this handler by name, native code will trigger CallBackFunction to perform the action.\n\n* loadUrl(String)\n\n\t\tLoad url, generally is your web app address or local webpage file.\n\t\t\n###JSWebView\n\n\tSame interface as JSWebViewActivity. When using JSWebView directly rather than inherit JSWebViewActivity, you should write your own 'onActivityResult' function to handle the results returned from library build in activity such as 'ImageChooseActivity'.\n\t\n###JS-SDK\n\n* jswebview.callNative(functionName, jsonArg)\n\n\t\tCall native code with specified function name and arguments. Arguments are in JSON format. Function names are defined in Java code using 'addBaseHandler'\n\t\t\n\t\tThis is the ONLY interface which JavaScript code can invoke native Java code.\n\t\t\n* jswebview.addEvent(eventName, callback)\n\n\t\tAdd a custom function which defined in native code. First parameter is the function name, and second parameter is a callback function which will be triggerd after native code is done processing.\n\t\t\n* jswebview.nativeCallBack(eventName, jsonArgs)\n\n\t\tInterface for native Java code to call JavaScript code. I've centerialized interfaces between native Java code and JavaScript code. So you can call this function to passing parameters from native code to JavaScript code.\n\t\t","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspongebobsun%2Fjswebview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspongebobsun%2Fjswebview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspongebobsun%2Fjswebview/lists"}