[android-developers] Re: WebView / JavaScriptInterface / String []

2012-07-17 Thread Pent
Oddly enough, String [] is accepted as a parameter without problem,
just not a return value.
Feels a bit buggy or forgotten.

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: WebView / JavaScriptInterface / String []

2012-07-17 Thread Martin
The WebView has it's own built-in JSON processing functions so no real need 
for an external javascript library.

var jsonObject=JSON.parse(jsonString);

Martin.


On Tuesday, July 17, 2012 6:57:26 AM UTC+1, Doug wrote:

 If you need to return something more complex, you could always generate a 
 serialized JSON data structure from JS using your favorite library, return 
 it as a string, and then parse the results using Android's JSONObject.

 Doug

 On Friday, July 13, 2012 6:46:57 AM UTC-7, Pent wrote:

 I thought that might turn out to be necessary, thanks for confirming. 

 Pent



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: WebView / JavaScriptInterface / String []

2012-07-16 Thread Doug
If you need to return something more complex, you could always generate a 
serialized JSON data structure from JS using your favorite library, return 
it as a string, and then parse the results using Android's JSONObject.

Doug

On Friday, July 13, 2012 6:46:57 AM UTC-7, Pent wrote:

 I thought that might turn out to be necessary, thanks for confirming. 

 Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: WebView / JavaScriptInterface / String []

2012-07-14 Thread kemal
in webview you can try this code

webView.getSettings().setJavaScriptEnabled(true);

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: WebView / JavaScriptInterface / String []

2012-07-13 Thread Streets Of Boston
I don't think it is supported.
In our code, we communicate arrays of data by plain Strings, calling 
'join()' on the JavaScript array and then parsing out the String into an 
array again on the Java side.

On Friday, July 13, 2012 8:21:06 AM UTC-4, Pent wrote:

 I'm trying to return a String [] from a function call in my 
 JavaScriptInterface object: 

 public String [] test() { 
   return new String [] { 'flowers' }; 
 } 

 When I call this in the WebView javascript, it just stops at that 
 point. 

 Is this just not supported ? Has anyone managed to get it working ? 

 Thanks, 

 Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: WebView / JavaScriptInterface / String []

2012-07-13 Thread Pent
I thought that might turn out to be necessary, thanks for confirming.

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en