Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
SRCPATH=/home/charles-chang/Release/AP/CommonEmbedded_mf10.4/
TGTPATH=${PWD}/out/target/product/CV/system/
APLIST=`grep \<N\> ../appIndexTable.xml | sed -e 's/<\/.*>//g' -e 's/<.*>//g'`
for apfile in $APLIST
do
case $apfile in
*.so)
cp $SRCPATH/$apfile $TGTPATH/lib/
package com.mkyong.android;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class WebViewActivity extends Activity {
case JS_CONFIRM:
if (mWebChromeClient != null) {
final JsResult res = (JsResult) msg.obj;
String message = msg.getData().getString("message");
String url = msg.getData().getString("url");
if (!mWebChromeClient.onJsConfirm(mWebView, url, message,
res)) {
new AlertDialog.Builder(mContext)
.setTitle(getJsDialogTitle(url))
.setMessage(message)
private String getJsDialogTitle(String url) {
String title = url;
if (URLUtil.isDataUrl(url)) {
// For data: urls, we just display 'JavaScript' similar to Safari.
title = mContext.getString(R.string.js_dialog_title_default);
} else {
try {
URL aUrl = new URL(url);
// For example: "The page at 'http://www.mit.edu' says:"
title = mContext.getString(R.string.js_dialog_title,
<string name="js_dialog_title" msgid="8143918455087008109">"「<xliff:g id="TITLE">%s</xliff:g>」的網頁指出:"</string>
@checko
checko / gist:2969967
Created June 22, 2012 03:14
get repo from google
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ./repo
@checko
checko / gist:2909197
Created June 11, 2012 09:08
mount and run script on external sd
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
int main(int argc,char **argv)
{
int fd;
struct stat s;
@checko
checko / gist:2908733
Created June 11, 2012 06:28
diff to buiild mke2fs static
diff --git a/e2fsck/Android.mk b/e2fsck/Android.mk
index e420740..6bcc87f 100644
--- a/e2fsck/Android.mk
+++ b/e2fsck/Android.mk
@@ -41,7 +41,7 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \
LOCAL_PRELINK_MODULE := false
-include $(BUILD_SHARED_LIBRARY)
+include $(BUILD_STATIC_LIBRARY)
@checko
checko / gist:2908714
Created June 11, 2012 06:18
Example : Android.mk -- build static & share library
# ========================================================
# libc.a
# ========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \
$(libc_static_common_src_files) \
bionic/dlmalloc.c \
bionic/malloc_debug_common.c \
@checko
checko / gist:2835466
Created May 30, 2012 10:50
confis.xml -- tetherable wifi interface name
<string-array translatable="false" name="config_tether_wifi_regexs">
<item>"wlap0"</item>
</string-array>