我在这里有点迷路......我一直在网上寻找,但我没有找到任何像我正在寻找的东西。这就是我在java中所做的
ClsAccessor accessors = new ClsAccessor();
class ClsAccessor{
public String WorkingWithJason(String Json){
String JsonVar;
JsonVar ="";
if (Json != ""){
generateNoteOnSD("JsonFile.txt", Json);
}
JsonVar = getfileFromSDCard("JsonFile.txt");
return JsonVar;
}
public void generateNoteOnSD(String Name, String data){
//....
}
public String getfileFromSDCard(String Name){
//....
String data;
//data = ".....";
return data;
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.addJavascriptInterface(accessors, "accessor");
mWebView.loadUrl("file:///android_asset/Main.html");
mWebView.setWebViewClient(new HelloWebViewClient());
}
更何况这是我在 javascript 上所需要的
var text = "";
function SendData(RecievedTextVariable){
var text = accessor.WorkingWithJason(RecievedTextVariablejsn);
document//accessor.outWorkingWithJason(textjsn);
$("#main_div").html("bbbbbb bbbbbbbb"+text);
}
任何想法或任何例子?