[android-developers] Re: WebView for HTML5 video and overriding onHideCustomView/onBackPressed in fragments

2016-08-21 Thread AndroidUser253
Mb there is no need to override onBackPressed in fragment 
because onHideCustomView is being called when I press back button anyway, 
but I as said the app crashes and I don't really understand why

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f4741a4a-de98-4e9d-8414-eb1ad7615e19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView for HTML5 video and overriding onHideCustomView/onBackPressed in fragments

2016-08-21 Thread AndroidUser253
Mb there is no need to override onBackPressed in fragment 
because onHideCustomView is being called when I press back button anyway, 
but I as said the crashes and I don't really understand why

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/3473f344-27ab-477b-9cf8-677cb2c12bdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView for HTML5 video and overriding onHideCustomView/onBackPressed in fragments

2016-08-21 Thread AndroidUser253


On Sunday, August 21, 2016 at 10:02:11 PM UTC+3, AndroidUser253 wrote:
>
> I have an example code that creates WebView for HTML5 video and it allows 
> to enable fullscreen (actually there is also a problem with hiding status 
> bar, but it's not the main problem now).
>
> public class MainActivity extends AppCompatActivity {
>
> private MyWebChromeClient mWebChromeClient = null;
> private View mCustomView;
> private LinearLayout mContentView;
> private FrameLayout mCustomViewContainer;
> private WebChromeClient.CustomViewCallback mCustomViewCallback;
> private Bundle webViewBundle;
> private WebView mWebView;
> private int viewWidth;
> private int viewHeight;
> private LinearLayout.LayoutParams layoutParams;
> private View decorView;
>
> @Override
> protected void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.activity_main);
> decorView = getWindow().getDecorView();
>
> mWebView = (WebView) findViewById(R.id.webView);
> mWebChromeClient = new MyWebChromeClient();
> mWebView.setWebChromeClient(mWebChromeClient);
> mWebView.setWebViewClient(new WebViewClient(){
> @Override
> public boolean shouldOverrideUrlLoading(WebView view, String url) 
> {
> return false;
> }
> });
> WebSettings webSettings = mWebView.getSettings();
> webSettings.setJavaScriptEnabled(true);
>
> viewWidth = 480;
> viewHeight = (int) (((double) viewWidth) * 0.5625); // video aspect 
> 16:9
> layoutParams = new LinearLayout.LayoutParams(viewWidth, viewHeight);
> mWebView.setLayoutParams(layoutParams);
>
> if (webViewBundle != null) {
> mWebView.restoreState(webViewBundle);
> } else {
> mWebView.loadUrl(%VIDEO_URL%); // e.g, page with iframe video
> }
>
> }
>
> @Override
> public void onPause() {
> super.onPause();
> webViewBundle = new Bundle();
> mWebView.saveState(webViewBundle);
> mWebView.onPause();
> }
>
> @Override
> public void onResume() {
> super.onResume();
> mWebView.onResume();
> }
>
> @Override
> public void onDestroy() {
> super.onDestroy();
> mWebView.destroy();
> }
>
> public class MyWebChromeClient extends WebChromeClient {
>
> FrameLayout.LayoutParams LayoutParameters = new 
> FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, 
> FrameLayout.LayoutParams.MATCH_PARENT);
>
> @Override
> public void onShowCustomView(View view, CustomViewCallback callback) {
> // if a view already exists then immediately terminate the new one
> if (mCustomView != null) {
> callback.onCustomViewHidden();
> return;
> }
> mContentView = (LinearLayout) findViewById(R.id.activity_main);
> mContentView.setVisibility(View.GONE);
> mCustomViewContainer = new FrameLayout(MainActivity.this);
> mCustomViewContainer.setLayoutParams(LayoutParameters);
> mCustomViewContainer.setBackgroundResource(android.R.color.black);
> view.setLayoutParams(LayoutParameters);
> mCustomViewContainer.addView(view);
> mCustomView = view;
> mCustomViewCallback = callback;
> getSupportActionBar().hide();
> int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
> decorView.setSystemUiVisibility(uiOptions);
> mCustomViewContainer.setVisibility(View.VISIBLE);
> setContentView(mCustomViewContainer);
> }
>
> @Override
> public void onHideCustomView() {
> if (mCustomView == null) {
> return;
> } else {
> // Hide the custom view.
> mCustomView.setVisibility(View.GONE);
> // Remove the custom view from its container.
> mCustomViewContainer.removeView(mCustomView);
> mCustomView = null;
> mCustomViewContainer.setVisibility(View.GONE);
> mCustomViewCallback.onCustomViewHidden();
> // Show the content view.
> int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
> decorView.setSystemUiVisibility(uiOptions);
> getSupportActionBar().show();
> mContentView.setVisibility(View.VISIBLE);
> setContentView(mContentView);
> }
> }
> }
> @Override
> public void onBackPressed() {
> if (mCustomViewContainer != null)
> mWebChromeClient.onHideCustomView();
> else if (mWebView.canGoBack())
> mWebView.goBack();
> else
> super.onBackPressed();
> }}
>
> This code for th

[android-developers] Re: webview shouldInterceptRequest does not work on Android 5.0

2016-05-21 Thread Carlos Farrington
I found my problem.  Apparently in Android 5.0 shouldInterceptRequest will 
not be run if their is a problem with the url being loaded.   I was 
using loadDataWithBaseURL("foobar://, data, encoding, null) to load first 
page.  Since foobar:// is not a known prefix to a url or file the request 
was just being dropped.   I changed foobar to http:// or file:/// and 
everything started working as it did on Android 4.1.  I guess a check was 
introduced on 5.0 that was not being done before.

 

On Friday, May 20, 2016 at 5:57:50 PM UTC-6, Carlos Farrington wrote:
>
> Hi 
>
> I am developing an App that intercepts the request and process them and 
> then updates send the WebResourcesResponse.   The code works with no issues 
> on 4.2 but when I try it in 5.0 the function shouldInterceptRequest never 
> sees the request.  I know that there was an update on the library and I 
> have made the modifications but I do not see any requests being processed. 
>  As you can see I have added a toast message to tell me if we enter the 
> shouldInterceptRequest function but I never see the message.   The requests 
> that are being processes are simple gets of a html page with frames. On 4.2 
> works with no problem but on 5.0 it does not work.   Any ideas?
>
> Thank you,
>
> fc8282
>
>
>
> private class WebViewClientImpl extends WebViewClient
> {
> @Override
> public boolean shouldOverrideUrlLoading(WebView view, String url)
> {
> return false;
> }
> 
> @Override
> public void onPageFinished(WebView view, String url)
> {
> 
> }
> 
> @SuppressWarnings("deprecation") // From API 21 we should use another 
> overload
> @Override
> public WebResourceResponse shouldInterceptRequest ( final WebView 
> view, String msg)
> {
> return processRequest ( view, msg );
> }
> 
> //@TargetApi(Build.VERSION_CODES.LOLLIPOP)
> @TargetApi(android.os.Build.VERSION_CODES.LOLLIPOP)
> @Override
> public WebResourceResponse shouldInterceptRequest( WebView view, 
> WebResourceRequest request)
> {
> Toast.makeText(getBaseContext(), "We are in the 
> shouldInterceptRequest 5.0: ",
> Toast.LENGTH_LONG).show();
> 
> 
> String msg = request.getUrl().toString();
> 
> return shouldInterceptRequest(view, request.getUrl().toString());
>
> // Have also tried just simply doing the return.
> //return processRequest ( view, msg );
> }
>
>
> public WebResourceResponse processRequest ( final WebView view, 
> String msg )
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/6799a4db-324e-42e5-a1b7-58537cf114cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView behaves weird when setting pivot point to rotate WebView

2016-05-18 Thread Pavel Vasilyev
Here is the code I use:


private class RotationGestureDetector {
private static final int INVALID_POINTER_ID = -1;
private float fX, fY, sX, sY;
private int ptrID1, ptrID2;
private float mCurrentAngle = 0f;

private View mView;

public RotationGestureDetector(View view) {
mView = view;

ptrID1 = INVALID_POINTER_ID;
ptrID2 = INVALID_POINTER_ID;
}

public void resetAngle() {
mCurrentAngle = 0f;
}

public boolean onTouchEvent(MotionEvent event){
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
ptrID1 = event.getPointerId(event.getActionIndex());
break;
case MotionEvent.ACTION_POINTER_DOWN:
if(ptrID1 != INVALID_POINTER_ID) {
ptrID2 = event.getPointerId(event.getActionIndex());
try  {
  sX = event.getX(event.findPointerIndex(ptrID1));
  sY = event.getY(event.findPointerIndex(ptrID1));
  fX = event.getX(event.findPointerIndex(ptrID2));
  fY = event.getY(event.findPointerIndex(ptrID2));
}
catch (IllegalArgumentException e)
{
ptrID1 = event.getPointerId(event.getActionIndex());
sX = event.getX(event.findPointerIndex(ptrID1));
sY = event.getY(event.findPointerIndex(ptrID1));
fX = event.getX(event.findPointerIndex(ptrID2));
fY = event.getY(event.findPointerIndex(ptrID2));
}

float pivotX = (fX + sX) / 2;
float pivotY = (fY + sY) / 2;

Log.d(TAG, "fX: " + fX + " fX: " + fY + " sX: " + sX + " 
sY: " + sY);
Log.d(TAG, "Pivot X: " + pivotX + " Pivot Y: " + pivotY);

mView.setPivotX(pivotX); //  Here WebView changes its 
position in layout
mView.setPivotY(pivotY); 
break;
}
case MotionEvent.ACTION_MOVE:
if(ptrID1 != INVALID_POINTER_ID && ptrID2 != 
INVALID_POINTER_ID){
float nfX, nfY, nsX, nsY;

nsX = event.getX(event.findPointerIndex(ptrID1));
nsY = event.getY(event.findPointerIndex(ptrID1));
nfX = event.getX(event.findPointerIndex(ptrID2));
nfY = event.getY(event.findPointerIndex(ptrID2));

float angle = angleBetweenLines(fX, fY, sX, sY, nfX, nfY, 
nsX, nsY);

mCurrentAngle += angle;


mView.animate().rotation(-mCurrentAngle).setDuration(0).start();
}
break;
case MotionEvent.ACTION_UP:
ptrID1 = INVALID_POINTER_ID;
break;
case MotionEvent.ACTION_POINTER_UP:
ptrID2 = INVALID_POINTER_ID;
break;
case MotionEvent.ACTION_CANCEL:
ptrID1 = INVALID_POINTER_ID;
ptrID2 = INVALID_POINTER_ID;
break;
}
return true;
}

private float angleBetweenLines (float fX, float fY, float sX, float sY, 
float nfX, float nfY, float nsX, float nsY)
{
float angle1 = (float) Math.atan2( (fY - sY), (fX - sX) );
float angle2 = (float) Math.atan2( (nfY - nsY), (nfX - nsX) );

float angle = ((float)Math.toDegrees(angle1 - angle2)) % 360;
if (angle < -180.f) angle += 360.0f;
if (angle > 180.f) angle -= 360.0f;
return angle;
}
}




вторник, 17 мая 2016 г., 20:20:03 UTC+3 пользователь Pavel Vasilyev написал:
>
> Hi all,
>
> I'm trying to rotate WebView (actually don't think there is a difference 
> with any Views) by rotation gesture with two fingers.
> I use the following code:
> mView.animate().rotation(-mCurrentAngle).setDuration(0).start();
>
> I get fingers' relative coordinates by MotionEvent.getX(pointerIndex);
>
> The problem appears if I'm trying to change pivot point. WebView suddenly 
> starts changing its view in layout after I set pivot point.
>
> I had the same problem with scaling and tried solutions from this topic: 
> http://stackoverflow.com/questions/14415035/setpivotx-works-strange-on-scaled-view
> And it helped. But not for rotation.
>
> Does any body know is it possible to rotate view with changed pivot button?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://

[android-developers] Re: WebView

2016-04-14 Thread TwoPlayers
ok tanks!!

Em quinta-feira, 14 de abril de 2016 05:52:02 UTC-3, Matthew Delong 
escreveu:
>
> i used this page to assist on making a site within webview and worked 
> really well. Hope it helps
>
> https://developer.chrome.com/multidevice/webview/gettingstarted
>
> On Thursday, April 14, 2016 at 3:29:37 AM UTC+1, TwoPlayers wrote:
>>
>> I'm using webview to make an app for my website, this app enters the URL, 
>> plus the upload system does not work I click anything happens I need help 
>> please! I'll leave the code I used below, thanks!
>>
>> String url ="http://www.SiteHere.cf";;
>> WebView view=(WebView) this.findViewById(R.id.webView);
>> view.getSettings().setJavaScriptEnabled(true);
>> view.loadUrl(url);
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cc9abce5-7c79-4a20-9045-983d3fc71603%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: webview adds extra horizontal space in the screen

2016-04-14 Thread Tasneem Bohra
Hello Wendel, 
I am still facing this issue for device lower than L. 

On Saturday, 16 October 2010 02:59:15 UTC+5:30, Wendel Assis wrote:
>
> Hi all,
>
> I'm using webview to display local html content. The text fits the 
> screen width, but the user is able to navigate horizontally where there is 
> only blank space left. However, there is no content to be shown as 
> everything fits the screen size. Does anyone know how can I avoid this 
> behavior? I mean, if all content is being show, how can I disable 
> horizontal navigation.
>
> Regards,
> Wendel
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/2223cb1b-b9ac-47d5-ad39-c7bab5fb8713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView

2016-04-14 Thread Matthew Delong
i used this page to assist on making a site within webview and worked 
really well. Hope it helps

https://developer.chrome.com/multidevice/webview/gettingstarted

On Thursday, April 14, 2016 at 3:29:37 AM UTC+1, TwoPlayers wrote:
>
> I'm using webview to make an app for my website, this app enters the URL, 
> plus the upload system does not work I click anything happens I need help 
> please! I'll leave the code I used below, thanks!
>
> String url ="http://www.SiteHere.cf";;
> WebView view=(WebView) this.findViewById(R.id.webView);
> view.getSettings().setJavaScriptEnabled(true);
> view.loadUrl(url);
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/48795fe1-7a03-48b3-b11d-bdb6c2a0660c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView Slow Page Load

2015-12-29 Thread Brahmam Yamani
Hi,

 use the Chrome Custom Tabs,it is very faster then webview,Custom Tabs Are 
customizable

For More Information :
http://android-developers.blogspot.in/2015/09/chrome-custom-tabs-smooth-transition.html

https://developer.chrome.com/multidevice/android/customtabs  


On Monday, 21 December 2015 12:39:28 UTC+5:30, Parimal Muli wrote:
>
> Hi, 
> I am using a webview in my app. The problem is that it takes a lot of time 
> (10-25 
> secs) for the sites to render in the webview. Can you please suggest some 
> methods to improve the webview page load time?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/a94eaa94-32d3-4b11-a748-9796f3df59f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView Slow Page Load

2015-12-21 Thread VISHAL TIKKU
Hi Parimal
Please try this

webview.getSettings().setRenderPriority(RenderPriority.HIGH);


On Monday, December 21, 2015 at 12:39:28 PM UTC+5:30, Parimal Muli wrote:
>
> Hi, 
> I am using a webview in my app. The problem is that it takes a lot of time 
> (10-25 
> secs) for the sites to render in the webview. Can you please suggest some 
> methods to improve the webview page load time?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/4ce1126c-cc8f-4156-9161-a81ea440f0a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: WebView Slow Page Load

2015-12-21 Thread Parimal Muli
Hi,
No, I am not modifying the page content. I am simply loading a site eg.
news article in my app in a webview.
THanks,
Parimal.

On 22 December 2015 at 01:18, Jonathan S  wrote:

> Are you going to just view web page or modified a page content?
>
> On Monday, December 21, 2015 at 2:09:28 AM UTC-5, Parimal Muli wrote:
>>
>> Hi,
>> I am using a webview in my app. The problem is that it takes a lot of
>> time (10-25 secs) for the sites to render in the webview. Can you please
>> suggest some methods to improve the webview page load time?
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/rGaF9IxX8Oo/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/6754ab78-1ddf-4c4d-bdc3-6367e12e1bd1%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Warm Wishes,
Parimal

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CAGLPELssKm_dRHWDNKgezH%2BRSxzyjiNQ7Hkpu%2BykaDnMOEH8mg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView Slow Page Load

2015-12-21 Thread Jonathan S
Are you going to just view web page or modified a page content?

On Monday, December 21, 2015 at 2:09:28 AM UTC-5, Parimal Muli wrote:
>
> Hi, 
> I am using a webview in my app. The problem is that it takes a lot of time 
> (10-25 
> secs) for the sites to render in the webview. Can you please suggest some 
> methods to improve the webview page load time?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/6754ab78-1ddf-4c4d-bdc3-6367e12e1bd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
OK, that's very different than what you first asked.

You will have to write shim to connect your app and the webview.  The page 
hosting the webview will have to provide a function to call that makes the 
necessary adjustments.  Then on the app side you call loadUrl with a 
javascript url to call that function with whatever parameters it needs.

Google "android webview inject javascript" for more details.  (Google 
answers most of your questions if you just ask it.)

Doug

On Sunday, December 14, 2014 1:45:46 PM UTC-8, Krystian Lewandowski wrote:
>
> Hi,
> the problem is that it is possible to get HTML skeleton (or whatever it 
> is, because we do not control remote side) via specific route with 
> additional implementation in shouldInterceptRequest. It is possible to 
> inject loaded the content via WebView.loadDataWithBaseURL, but that's it. 
> The question is how to inject additional resources to WebView?
>
> Thank you,
> Krystian
>
> W dniu niedziela, 14 grudnia 2014 22:33:36 UTC+1 użytkownik Doug napisał:
>>
>> Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
>> through old code of mine that suggests it will work.  Also, you should try 
>> searching for "WebViewClient shouldInterceptRequest" to see what places 
>> like StackOverflow say.
>>
>> Doug
>>
>> On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski 
>> wrote:
>>>
>>> Hi Doug,
>>> I mean, I can get the page and there is onLoadResource I missed last 
>>> time, but another question is - even if I get a resource, how to inject it? 
>>> Callbacks, in this case, serve kind of notification purpose there is no way 
>>> to replace loaded resource (whatever it actually is) or inject custom 
>>> "loader" instead. At least at the moment I don't see a solution.
>>>
>>> Thank you for ideas,
>>> Krystian
>>>
>>> W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you 
 can intercept everything that passes through a url, both what would be 
 loaded by navigation, image, and ajax.  Give it a try and implement all 
 the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:
>
> Thank you for the idea. Though, I don't think it will work. What about 
> AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
> called for these.
>
> Krystian
>
> W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:
>>
>> You could use a WebViewClient to intercept everything a WebView is 
>> trying to fetch and fetch it yourself using whatever API suits your 
>> needs.
>>
>> Doug
>>
>> On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
>> wrote:
>>>
>>> Hi,
>>> I'm trying to update ConnectivityManager.requestRouteToHost 
>>> implementation from deprecated one to 
>>> ConnectivityManager.requestNetwork 
>>> introduced in Lollipop. It supports Sockets, SocketFactories, 
>>> URLConnections - this is fine. The only thing missing at the moment is 
>>> WebView support. Application's requirement is to route WebView.loadUrl 
>>> requests via specific interface, but I can't see how it could be done 
>>> with 
>>> the new API (I can't use setProcessDefaultNetwork).
>>>
>>> I looked at WebView API but couldn't find anything new that would 
>>> support changed routing API. Is it supported, am I missing something?
>>>
>>> Thank you,
>>> Krystian
>>>
>>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Krystian Lewandowski
Hi,
the problem is that it is possible to get HTML skeleton (or whatever it is, 
because we do not control remote side) via specific route with additional 
implementation in shouldInterceptRequest. It is possible to inject loaded 
the content via WebView.loadDataWithBaseURL, but that's it. The question is 
how to inject additional resources to WebView?

Thank you,
Krystian

W dniu niedziela, 14 grudnia 2014 22:33:36 UTC+1 użytkownik Doug napisał:
>
> Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
> through old code of mine that suggests it will work.  Also, you should try 
> searching for "WebViewClient shouldInterceptRequest" to see what places 
> like StackOverflow say.
>
> Doug
>
> On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski wrote:
>>
>> Hi Doug,
>> I mean, I can get the page and there is onLoadResource I missed last 
>> time, but another question is - even if I get a resource, how to inject it? 
>> Callbacks, in this case, serve kind of notification purpose there is no way 
>> to replace loaded resource (whatever it actually is) or inject custom 
>> "loader" instead. At least at the moment I don't see a solution.
>>
>> Thank you for ideas,
>> Krystian
>>
>> W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:
>>>
>>> It's been a long time since I've been active on it, but I believe you 
>>> can intercept everything that passes through a url, both what would be 
>>> loaded by navigation, image, and ajax.  Give it a try and implement all the 
>>> callbacks exposed by webview, log a simple message, and see how it goes.
>>>
>>> Doug
>>>
>>> On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
>>> wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:
>
> You could use a WebViewClient to intercept everything a WebView is 
> trying to fetch and fetch it yourself using whatever API suits your needs.
>
> Doug
>
> On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
> wrote:
>>
>> Hi,
>> I'm trying to update ConnectivityManager.requestRouteToHost 
>> implementation from deprecated one to ConnectivityManager.requestNetwork 
>> introduced in Lollipop. It supports Sockets, SocketFactories, 
>> URLConnections - this is fine. The only thing missing at the moment is 
>> WebView support. Application's requirement is to route WebView.loadUrl 
>> requests via specific interface, but I can't see how it could be done 
>> with 
>> the new API (I can't use setProcessDefaultNetwork).
>>
>> I looked at WebView API but couldn't find anything new that would 
>> support changed routing API. Is it supported, am I missing something?
>>
>> Thank you,
>> Krystian
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
through old code of mine that suggests it will work.  Also, you should try 
searching for "WebViewClient shouldInterceptRequest" to see what places 
like StackOverflow say.

Doug

On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski wrote:
>
> Hi Doug,
> I mean, I can get the page and there is onLoadResource I missed last time, 
> but another question is - even if I get a resource, how to inject it? 
> Callbacks, in this case, serve kind of notification purpose there is no way 
> to replace loaded resource (whatever it actually is) or inject custom 
> "loader" instead. At least at the moment I don't see a solution.
>
> Thank you for ideas,
> Krystian
>
> W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:
>>
>> It's been a long time since I've been active on it, but I believe you can 
>> intercept everything that passes through a url, both what would be loaded 
>> by navigation, image, and ajax.  Give it a try and implement all the 
>> callbacks exposed by webview, log a simple message, and see how it goes.
>>
>> Doug
>>
>> On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
>> wrote:
>>>
>>> Thank you for the idea. Though, I don't think it will work. What about 
>>> AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
>>> called for these.
>>>
>>> Krystian
>>>
>>> W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:
>
> Hi,
> I'm trying to update ConnectivityManager.requestRouteToHost 
> implementation from deprecated one to ConnectivityManager.requestNetwork 
> introduced in Lollipop. It supports Sockets, SocketFactories, 
> URLConnections - this is fine. The only thing missing at the moment is 
> WebView support. Application's requirement is to route WebView.loadUrl 
> requests via specific interface, but I can't see how it could be done 
> with 
> the new API (I can't use setProcessDefaultNetwork).
>
> I looked at WebView API but couldn't find anything new that would 
> support changed routing API. Is it supported, am I missing something?
>
> Thank you,
> Krystian
>


-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Krystian Lewandowski
Hi Doug,
I mean, I can get the page and there is onLoadResource I missed last time, 
but another question is - even if I get a resource, how to inject it? 
Callbacks, in this case, serve kind of notification purpose there is no way 
to replace loaded resource (whatever it actually is) or inject custom 
"loader" instead. At least at the moment I don't see a solution.

Thank you for ideas,
Krystian

W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:
>
> It's been a long time since I've been active on it, but I believe you can 
> intercept everything that passes through a url, both what would be loaded 
> by navigation, image, and ajax.  Give it a try and implement all the 
> callbacks exposed by webview, log a simple message, and see how it goes.
>
> Doug
>
> On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
> wrote:
>>
>> Thank you for the idea. Though, I don't think it will work. What about 
>> AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
>> called for these.
>>
>> Krystian
>>
>> W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:
>>>
>>> You could use a WebViewClient to intercept everything a WebView is 
>>> trying to fetch and fetch it yourself using whatever API suits your needs.
>>>
>>> Doug
>>>
>>> On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
>>> wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian

>>>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
It's been a long time since I've been active on it, but I believe you can 
intercept everything that passes through a url, both what would be loaded 
by navigation, image, and ajax.  Give it a try and implement all the 
callbacks exposed by webview, log a simple message, and see how it goes.

Doug

On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski wrote:
>
> Thank you for the idea. Though, I don't think it will work. What about 
> AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
> called for these.
>
> Krystian
>
> W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:
>>
>> You could use a WebViewClient to intercept everything a WebView is trying 
>> to fetch and fetch it yourself using whatever API suits your needs.
>>
>> Doug
>>
>> On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
>> wrote:
>>>
>>> Hi,
>>> I'm trying to update ConnectivityManager.requestRouteToHost 
>>> implementation from deprecated one to ConnectivityManager.requestNetwork 
>>> introduced in Lollipop. It supports Sockets, SocketFactories, 
>>> URLConnections - this is fine. The only thing missing at the moment is 
>>> WebView support. Application's requirement is to route WebView.loadUrl 
>>> requests via specific interface, but I can't see how it could be done with 
>>> the new API (I can't use setProcessDefaultNetwork).
>>>
>>> I looked at WebView API but couldn't find anything new that would 
>>> support changed routing API. Is it supported, am I missing something?
>>>
>>> Thank you,
>>> Krystian
>>>
>>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-13 Thread Krystian Lewandowski
Thank you for the idea. Though, I don't think it will work. What about 
AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
called for these.

Krystian

W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:
>
> You could use a WebViewClient to intercept everything a WebView is trying 
> to fetch and fetch it yourself using whatever API suits your needs.
>
> Doug
>
> On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski wrote:
>>
>> Hi,
>> I'm trying to update ConnectivityManager.requestRouteToHost 
>> implementation from deprecated one to ConnectivityManager.requestNetwork 
>> introduced in Lollipop. It supports Sockets, SocketFactories, 
>> URLConnections - this is fine. The only thing missing at the moment is 
>> WebView support. Application's requirement is to route WebView.loadUrl 
>> requests via specific interface, but I can't see how it could be done with 
>> the new API (I can't use setProcessDefaultNetwork).
>>
>> I looked at WebView API but couldn't find anything new that would support 
>> changed routing API. Is it supported, am I missing something?
>>
>> Thank you,
>> Krystian
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-13 Thread Doug
You could use a WebViewClient to intercept everything a WebView is trying 
to fetch and fetch it yourself using whatever API suits your needs.

Doug

On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski wrote:
>
> Hi,
> I'm trying to update ConnectivityManager.requestRouteToHost implementation 
> from deprecated one to ConnectivityManager.requestNetwork introduced in 
> Lollipop. It supports Sockets, SocketFactories, URLConnections - this is 
> fine. The only thing missing at the moment is WebView support. 
> Application's requirement is to route WebView.loadUrl requests via specific 
> interface, but I can't see how it could be done with the new API (I can't 
> use setProcessDefaultNetwork).
>
> I looked at WebView API but couldn't find anything new that would support 
> changed routing API. Is it supported, am I missing something?
>
> Thank you,
> Krystian
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: WebView numeric keyboard from HTML

2013-08-19 Thread user123
Yes, thanks, no idea, I think it's working now, probably there was a period 
of time where the HTML (written by someone else) was incorrect.

Am Mittwoch, 5. Juni 2013 18:22:00 UTC+2 schrieb MagouyaWare:
>
> I don't know if this will help in your case or not, but I found this after 
> doing some searching on google:
>
> http://stackoverflow.com/questions/8333117/is-there-a-way-to-have-a-masked-numeric-input-field
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Wed, May 22, 2013 at 3:09 AM, user123 
> > wrote:
>
>> Any update on this? I have input fields in webview with type="number" 
>> but still get "normal" soft keyboard - showing letters first.
>>
>> Am Freitag, 14. Januar 2011 15:14:39 UTC+1 schrieb linhadiretalipe:
>>>
>>> Hi, 
>>>  I have a input in a WebView and I would like to know how 
>>> can I call keyboard with only numeric buttons? 
>>>
>>> tks,
>>> -- 
>>> Filipe B. da S. Ferreira
>>>
>>>  -- 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to 
>> android-d...@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
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-developers+unsubscr...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] Re: WebView Problem showing Google Maps

2013-08-03 Thread Gary Blakely
No, I had not enabled javascript.  So, I tried that and it now works.
Thanks, so much.
Gary

On Saturday, August 3, 2013 2:52:19 PM UTC-7, Nobu Games wrote:
>
> Just a guess, maybe Google Maps is trying to (incorrectly) redirect to the 
> mobile version of the page and cannot find the correct link. Did you also 
> enable JavaScript in your WebView?
>
> On Saturday, August 3, 2013 4:40:52 PM UTC-5, Gary Blakely wrote:
>>
>> Consider the following code...
>>
>> LocateBrowser = (WebView)findViewById(R.id.locatebrowser);
>> LocateBrowser.setWebViewClient(new WebViewClient());
>> LocateBrowser.loadUrl("
>> http://maps.google.com/maps?z=17&t=h&q=loc:31.8526,-110.9959";);
>>
>> The Google maps page shows in the WebView with a "Loading . . ." activity 
>> logo for about a second.  The Google's 404 page then shows saying it can't 
>> find /Search.  I don't know where it gets "/Search".
>>
>> I don't know why it is doing this.  If I substitute other URLs such as
>>
>> http://www.deanblakely.com/AndroidNews.aspx
>> or
>> http://www.amazon.com
>>
>> It works fine.
>>
>> Also, if I put the above google maps URL into a browser on my PC it works 
>> fine.
>> Also, if I don't implement the WebViewClient (second line) it shows 
>> perfectly but in a separate browser window.(I don't want that).
>>
>> What am I doing wrong or what am I forgetting to do?
>> Thanks,
>> Gary
>>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView Problem showing Google Maps

2013-08-03 Thread Nobu Games
Just a guess, maybe Google Maps is trying to (incorrectly) redirect to the 
mobile version of the page and cannot find the correct link. Did you also 
enable JavaScript in your WebView?

On Saturday, August 3, 2013 4:40:52 PM UTC-5, Gary Blakely wrote:
>
> Consider the following code...
>
> LocateBrowser = (WebView)findViewById(R.id.locatebrowser);
> LocateBrowser.setWebViewClient(new WebViewClient());
> LocateBrowser.loadUrl("
> http://maps.google.com/maps?z=17&t=h&q=loc:31.8526,-110.9959";);
>
> The Google maps page shows in the WebView with a "Loading . . ." activity 
> logo for about a second.  The Google's 404 page then shows saying it can't 
> find /Search.  I don't know where it gets "/Search".
>
> I don't know why it is doing this.  If I substitute other URLs such as
>
> http://www.deanblakely.com/AndroidNews.aspx
> or
> http://www.amazon.com
>
> It works fine.
>
> Also, if I put the above google maps URL into a browser on my PC it works 
> fine.
> Also, if I don't implement the WebViewClient (second line) it shows 
> perfectly but in a separate browser window.(I don't want that).
>
> What am I doing wrong or what am I forgetting to do?
> Thanks,
> Gary
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView - can't set its position..

2013-07-07 Thread AmitNHB
OK, got it:

*webView = new WebView(this);
webView.setWebViewClient(new WebViewClient());RelativeLayout.LayoutParams 
webViewParams= new RelativeLayout.LayoutParams(800, 240);
webViewParams.addRule(RelativeLayout.CENTER_IN_PARENT);*



On Monday, July 8, 2013 3:59:37 AM UTC+3, AmitNHB wrote:
>
> Hello, I feel this should be very basic but I can't seem to be able to set 
> the position of a WebView. I have a my surface (which extends SurfaceView) 
> and an AdView at the bottom and now I want to add a WebView and position it 
> at a certain height on the screen. I do this, trying to position my web 
> view at the center:
>
> webView = new WebView(this);
> webView.setWebViewClient(new WebViewClient());
> webView.setVisibility(View.GONE);LayoutParams webViewParams = new 
> LayoutParams(800,240);
> webViewParams.setMargins(0, 120, 800, 360); 
>
>
> And the last line doesn't seem to have any effect as the view starts at the 
> very top.
>
> I also tried using the gravity field and setting it to GRAVITY.CENTER and it 
> did not matter.
>
> Here's the full code: 
> (I'm using a device with a 800X480 resolution and I'm in landscape more, and 
> for now 
> I'm just trying to position my webview at the center taking up half the 
> display' space.)
>
> *
> **private MySurface surface;private AdView adView;private WebView
> ...
> // create the ad view
> adView = new AdView(this, AdSize.SMART_BANNER, AD_MOB_ID);
> adView.setAdListener(new MyAdListener());
> // create the surface
> surface = MySurface.getRef(this);
> // set a listener for touch event
> surface.setOnTouchListener(this);
> // create the web view
> webView = new WebView(this);
> webView.setWebViewClient(new WebViewClient());LayoutParams webViewParams = 
> new LayoutParams(800,240); // this works
> webViewParams.setMargins(0, 120, 800, 360); // this does 
> nothing...
> // create a relative layoutRelativeLayout l = new RelativeLayout(this);
> // add the surface
> l.addView(surface);
> // add the ad view at the bottomAdView.LayoutParams adViewParams = new 
> AdView.LayoutParams(AdView.LayoutParams.WRAP_CONTENT,AdView.LayoutParams.WRAP_CONTENT);
>
> adViewParams.addRule(AdView.ALIGN_PARENT_BOTTOM);
>
> l.addView(adView, adViewParams);
>
> l.addView(webView, webViewParams);
>
> setContentView(l);  
> // load an ad//loadAdMob(); *
>
> *  *

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView - can't set its position..

2013-07-07 Thread AmitNHB
Please ignore this line: 


*webView**.setVisibility(View.GONE**);*

I'm setting it back to visible later on and like I said, the view starts at the 
very top instead of at 120.


On Monday, July 8, 2013 3:59:37 AM UTC+3, AmitNHB wrote:
>
> Hello, I feel this should be very basic but I can't seem to be able to set 
> the position of a WebView. I have a my surface (which extends SurfaceView) 
> and an AdView at the bottom and now I want to add a WebView and position it 
> at a certain height on the screen. I do this, trying to position my web 
> view at the center:
>
> webView = new WebView(this);
> webView.setWebViewClient(new WebViewClient());
> webView.setVisibility(View.GONE);LayoutParams webViewParams = new 
> LayoutParams(800,240);
> webViewParams.setMargins(0, 120, 800, 360); 
>
>
> And the last line doesn't seem to have any effect as the view starts at the 
> very top.
>
> I also tried using the gravity field and setting it to GRAVITY.CENTER and it 
> did not matter.
>
> Here's the full code: 
> (I'm using a device with a 800X480 resolution and I'm in landscape more, and 
> for now 
> I'm just trying to position my webview at the center taking up half the 
> display' space.)
>
> *
> **private MySurface surface;private AdView adView;private WebView
> ...
> // create the ad view
> adView = new AdView(this, AdSize.SMART_BANNER, AD_MOB_ID);
> adView.setAdListener(new MyAdListener());
> // create the surface
> surface = MySurface.getRef(this);
> // set a listener for touch event
> surface.setOnTouchListener(this);
> // create the web view
> webView = new WebView(this);
> webView.setWebViewClient(new WebViewClient());LayoutParams webViewParams = 
> new LayoutParams(800,240); // this works
> webViewParams.setMargins(0, 120, 800, 360); // this does 
> nothing...
> // create a relative layoutRelativeLayout l = new RelativeLayout(this);
> // add the surface
> l.addView(surface);
> // add the ad view at the bottomAdView.LayoutParams adViewParams = new 
> AdView.LayoutParams(AdView.LayoutParams.WRAP_CONTENT,AdView.LayoutParams.WRAP_CONTENT);
>
> adViewParams.addRule(AdView.ALIGN_PARENT_BOTTOM);
>
> l.addView(adView, adViewParams);
>
> l.addView(webView, webViewParams);
>
> setContentView(l);  
> // load an ad//loadAdMob(); *
>
> *  *

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: WebView numeric keyboard from HTML

2013-06-05 Thread Justin Anderson
I don't know if this will help in your case or not, but I found this after
doing some searching on google:
http://stackoverflow.com/questions/8333117/is-there-a-way-to-have-a-masked-numeric-input-field

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, May 22, 2013 at 3:09 AM, user123  wrote:

> Any update on this? I have input fields in webview with type="number" but
> still get "normal" soft keyboard - showing letters first.
>
> Am Freitag, 14. Januar 2011 15:14:39 UTC+1 schrieb linhadiretalipe:
>>
>> Hi,
>>  I have a input in a WebView and I would like to know how can
>> I call keyboard with only numeric buttons?
>>
>> tks,
>> --
>> Filipe B. da S. Ferreira
>>
>>  --
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView Download

2013-05-30 Thread Rahul Kaushik
Hi,

Solution is passing cookie to the webview
For Brief See:

http://call-me-early.blogspot.in/2013/03/android-passing-webview-cookie-to.html
http://call-me-early.blogspot.in/2013/03/android-webview-download-pdf-generated.html


Thanks

RK



On Mon, May 27, 2013 at 6:23 PM, Rahul Kaushik wrote:

> i have an webview app ,when i click on attachments  in my webview it opens
> an browser saying you are not login please login first
> Now
> 1)if i login in browser and go back to my app,and click on any attachment
> it starts download without opening browser instance
> 2)if don't login in browser and close my browser download does not start
>
>  to be brief ,i have to stay logged in my browser first to start my
> download From WebView
>
>  Please suggest
>
>  Thanks
>  RK
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView numeric keyboard from HTML

2013-05-22 Thread user123
Any update on this? I have input fields in webview with type="number" but 
still get "normal" soft keyboard - showing letters first.

Am Freitag, 14. Januar 2011 15:14:39 UTC+1 schrieb linhadiretalipe:
>
> Hi, 
>  I have a input in a WebView and I would like to know how can 
> I call keyboard with only numeric buttons? 
>
> tks,
> -- 
> Filipe B. da S. Ferreira
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView FileUploader

2013-05-03 Thread lbendlin
The website is expecting a Windows or OSX computer at the other end, and 
has no idea how to handle an "Android" file system. (Well, Linux, but same 
difference)

On Friday, May 3, 2013 4:11:10 AM UTC-4, rahul kaushik wrote:
>
> AnyOne???
>
>
>
> On Thu, May 2, 2013 at 3:17 PM, Rahul Kaushik 
> 
> > wrote:
>
>> Hi,
>>
>> I am using Webview as container for a website,Web site  have an option 
>> Upload File ,this button is not working for me am using Android 
>> Version(3.0.1)
>>
>> Any Suggestions??
>>
>> Thanks
>> RK
>>
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView FileUploader

2013-05-03 Thread Rahul Kaushik
AnyOne???



On Thu, May 2, 2013 at 3:17 PM, Rahul Kaushik wrote:

> Hi,
>
> I am using Webview as container for a website,Web site  have an option
> Upload File ,this button is not working for me am using Android
> Version(3.0.1)
>
> Any Suggestions??
>
> Thanks
> RK
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: WebView takes up entire screen, I need it to fit in the remaining space of the layout.

2013-03-28 Thread Mahmoud Hadad
useless replies tbh

On Tuesday, September 13, 2011 4:34:41 PM UTC+3, Conny wrote:
>
> Hello All,
>
> I am trying to use Webview in a relative layout with a progress bar
> and some buttons. But as soon as I run webview.loadUrl("my path"), the
> webview takes over the entire space. I need the webview to fit in the
> remaining space of my layout. Please help.
>
> 
> 
> http://schemas.android.com/apk/res/android";
> android:layout_width="fill_parent" 
> android:layout_height="fill_parent">
>  android:layout_alignParentTop="true" 
> android:layout_height="wrap_content"
> android:id="@+id/progressBar"
> style="@android:style/Widget.ProgressBar.Horizontal" />
>  android:layout_below="@id/progressBarText" 
> android:layout_width="fill_parent"
> android:layout_height="wrap_content" 
> android:orientation="horizontal">
>  android:id="@+id/search"
> android:layout_height="wrap_content" 
> android:text="Search"
> android:layout_weight="1" 
> android:layout_gravity="center_vertical" />
>  android:id="@+id/cancel"
> android:layout_height="wrap_content" 
> android:text="Cancel"
> android:layout_weight="1" 
> android:layout_gravity="center_vertical" />
> 
>  android:background="@android:color/transparent"
> android:layout_centerInParent="true" 
> android:src="@drawable/left"
> android:layout_height="wrap_content" 
> android:layout_width="wrap_content"
> android:id="@+id/previous">
>  android:background="@android:color/transparent"
> android:layout_height="wrap_content"
> android:layout_alignParentRight="true" 
> android:layout_centerInParent="true"
> android:src="@drawable/right" 
> android:id="@+id/next">
>  android:layout_below="@id/searchResultPages"
> android:layout_alignParentBottom="true" 
> android:layout_width="fill_parent"
> android:layout_height="wrap_content" />
> 
> 
>
> The AndroidManifest.xml has
> 
>  android:screenOrientation="portrait"
> android:configChanges="orientation|keyboardHidden"
> android:windowSoftInputMode="stateHidden">
> 
> 
>
> Regards
> Conny
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: webview No cache file for url

2013-01-07 Thread allen23777
I also encountered this issue.
I'd like to know if you have find the root cause and a walk around solution 
for this issue.
 
Can you please share your solution on this? 
Thanks.

On Thursday, April 7, 2011 3:57:06 AM UTC+8, Stephan Wiesner wrote:

> Hi, 
> I have a webview and use caching. This worked fine until now. On my 
> Motorola Defy (Android 2.1) I can not open webpages anymore. I have not 
> changed anything on the code of the webview activity.
> Under preferences/applications I can see that the cache size is 0.
>
>  04-06 21:50:35.452: DEBUG/Alpenkalb(19966): Start webview:
> http://gipfelbuch.ch/tourenfuehrer/uebersicht/region/1
> 04-06 21:50:35.452: DEBUG/Alpenkalb(19966): [ 04-06 21:50:35.499 
> 19966:0x4e13 D/No cache file for url 
> http://gipfelbuch.ch/tourenfuehrer/uebersicht/region/1
>
>  Here is how I enable caching:
>
>  webView.getSettings().setDomStorageEnabled(true);
>
> // Set cache size to 8 mb by default. should be more than enough
> webView.getSettings().setAppCacheMaxSize(1024 * 1024 * 8);
>
> // didn't work for me without this line
> webView.getSettings().setAppCachePath("/data/data/ch.gipfelbuch/cache");
> webView.getSettings().setAllowFileAccess(true);
> webView.getSettings().setAppCacheEnabled(true);
>
>
>
> Any ideas?
> Thanks, 
> Stephan
>
>
>
>
>

-- 
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 in android

2013-01-07 Thread bob
Maybe

webview.clearView()

?

On Monday, January 7, 2013 3:17:07 AM UTC-6, laxman k wrote:
>
> how to clear previously loaded content of webview in android
>

-- 
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 can not display twitter page

2012-11-18 Thread Piren
Webviews support redirecting without an issue. 
other than the suggestions on StackOverflow, i'd also check SSL certificate 
exception (i recall getting one on android versions below 2.3.3)

To verify you could either use the proper handler to catch those or just 
open the link in your native browser and see if it asks you to authorize 
the certificate (if it does, it means it will cause the failure in the 
webview). 

On Friday, July 29, 2011 1:05:10 PM UTC+3, Ethan Gao wrote:
>
>I am developing an app with twitter sharing feature. User can 
> share information via twitter. After user click the twitter image in 
> app view, a webView is brought up with a twitter share url. But the 
> webview is always a blank page. 
> Only twitter url does not work, facebook url works very well. It 
> looks like webview does not support redirecting, right? 
>
> PS: I've set the javascript enable of webview, still do not work 
> for twitter share url.

-- 
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 can not display twitter page

2012-11-16 Thread Simon
Looks like this can be fixed by setting the user-agent:

webView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U; Android 2.0; 
en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 
Mobile Safari/530.17");


See also: 

http://stackoverflow.com/questions/6625316/webview-not-displaying-twitter-on-some-droids
http://stackoverflow.com/questions/8056063/android-mobile-twitter-page-in-webview-not-opening
http://stackoverflow.com/questions/8951251/getting-blank-page-in-android-webviewclient

and others.

-- Simon

On Friday, July 29, 2011 4:05:10 AM UTC-6, Ethan Gao wrote:
>
>I am developing an app with twitter sharing feature. User can 
> share information via twitter. After user click the twitter image in 
> app view, a webView is brought up with a twitter share url. But the 
> webview is always a blank page. 
> Only twitter url does not work, facebook url works very well. It 
> looks like webview does not support redirecting, right? 
>
> PS: I've set the javascript enable of webview, still do not work 
> for twitter share url.

-- 
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 in ListView

2012-11-07 Thread Vitaly Chernikov
I am use ListView and each cell is WebView. So, I see that I must place 
WebView.loadURL directly in GetView! And it is calling every time when I 
scrolling! So how can I cache WebView to call LoadURL only one time? Or may 
be I would be save Inflated view in array and return in GetView only view 
from array?

On Friday, July 23, 2010 9:36:06 AM UTC+4, Kumar Bibek wrote:
>
> WebViews are pretty heavy components. I don't see a situation where a 
> WebView cannot be replaced by a text view or a combination of other 
> compoenents. I still think this is a bad idea. I am sure, you wouldn't 
> be running scripts inside those web view items in your list, or do 
> you? 
>
> Thanks and Regards, 
> Kumar Bibek 
> http://tech-droid.blogspot.com 
>
> On Jul 23, 8:59 am, Ken  wrote: 
> > I've implemented a list with each item as a WebView. The WebViews are 
> > loaded in their own threads so the UI doesn't have to wait. 
> > 
> > The problem I've ran into is after the list is loaded, some webview 
> > items disappears or repeat after the list is scrolled. I've read posts 
> > from Romain Guy and others about how this is a bad idea. Just 
> > wondering if it's still a bad idea or a solution has been found since 
> > Cupcake. 
> > 
> > Thanks! 
> > 
> > Ken

-- 
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 question - text selection and highlighting

2012-10-17 Thread Leo Kaliazine
Maybe this will be of help: 
http://stackoverflow.com/questions/6058843/android-how-to-select-texts-from-webview/11952553#11952553

On Friday, October 12, 2012 8:27:29 AM UTC-4, Bijaya wrote:
>
> hi Mike Jones,
>
> i ran through your post, i have also working on web view text selection 
> and highlighting. i am not understand how to implement this.
> i need some idea or sample example. can u please help me.
>
> Thank you for your work
>
> Bijaya Guin 
>
>

-- 
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

Re: [android-developers] Re: Webview question - text selection and highlighting

2012-10-16 Thread Mike Jones
This github project is very similar to what I'm doing in my app:
https://github.com/btate/BTAndroidWebViewSelection

On Fri, Oct 12, 2012 at 6:27 AM, Bijaya  wrote:

> hi Mike Jones,
>
> i ran through your post, i have also working on web view text selection
> and highlighting. i am not understand how to implement this.
> i need some idea or sample example. can u please help me.
>
> Thank you for your work
>
> Bijaya Guin
>
>  --
> 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
>

-- 
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 question - text selection and highlighting

2012-10-16 Thread Bijaya
hi Mike Jones,

i ran through your post, i have also working on web view text selection and 
highlighting. i am not understand how to implement this.
i need some idea or sample example. can u please help me.

Thank you for your work

Bijaya Guin 

-- 
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 shows white blank page in Ice Cream Sandwitch

2012-10-12 Thread Russ
Did calling ".destroy()" fix your issue?  I too am getting a blank white 
page on all repeat visits to my app (which uses a webview).

-- 
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 shows white blank page in Ice Cream Sandwitch

2012-10-05 Thread MathieuB
Strangely, the exact same problem happened to me today. Was testing my map 
embedded in a webview on android 4.0.4...and around 3 times out of 4, it 
was showing a blank page...don't really understand why.

I'll try to call the destroy() method on the onDestroy() and see if it 
helps...

What is strange (and bad) is that everything works well in 2.3.x and 4.1

-- 
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 shows white blank page in Ice Cream Sandwitch

2012-10-05 Thread Streets Of Boston
Try this: Try call webtv.*destroy()* in your onDestroy() method. I'm just 
guessing here, but it's worth a try.

On a side-note: Don't call 'this.finish()' in your onPause() method. That 
is usually bad news.


On Friday, October 5, 2012 1:41:37 PM UTC-4, Power Android wrote:
>
>
>   In my webview I have loaded a URL which have an embeded video player of 
> a tv channel live stream. It is working correctly in all the OS version of 
> Android except ICS(4). First time It plays the video well, but when I go 
> back and come again in that page containing the video then the video doesnt 
> loads and shows a blank white page. If I force stop the app from the 
> application setting and start the app again then It runs well then appears 
> white screen again as usual, I have implemented a lot of tactics and this 
> is the latest , I am totally stuck here:
>
>
>
> public class Livetvwebview extends Activity {
>
> RelativeLayout a;
> WebView webtv;
> String url;
> VideoView video;
> WChromeClient chromeClient;
> WebViewClient wvClient;
>
> @Override
> protected void onCreate(Bundle savedInstanceState) {
> // TODO Auto-generated method stub
> super.onCreate(savedInstanceState);
> // requestWindowFeature(Window.FEATURE_NO_TITLE);
> getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
> WindowManager.LayoutParams.FLAG_FULLSCREEN);
> getWindow().requestFeature(Window.FEATURE_PROGRESS);
> setContentView(R.layout.livewebview);
> Toast.makeText(getApplicationContext(),
> "Channel is loading..This may take upto a minute",
> Toast.LENGTH_LONG).show();
> url = getIntent().getStringExtra("tvchannel");
> Log.i("TVURL", url);
> webtv = (WebView) findViewById(R.id.webViewlive);
> webtv.clearCache(true);
> webtv.loadUrl(url);
>
> webtv.getSettings().setLoadWithOverviewMode(true);
> webtv.getSettings().setUseWideViewPort(true);
>
> webtv.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
>
> webtv.setWebChromeClient(new WChromeClient());
> webtv.setWebViewClient(new myWebClient());
> webtv.getSettings().setJavaScriptEnabled(true);
>
> webtv.getSettings().setPluginState(PluginState.ON);
>
> webtv.getSettings().setDomStorageEnabled(true);
> }
>
>
>
> public class myWebClient extends WebViewClient {
> @Override
> public void onPageStarted(WebView view, String url, Bitmap favicon) {
> // TODO Auto-generated method stub
>
> super.onPageStarted(view, url, favicon);
>
> }
>
> @Override
> public boolean shouldOverrideUrlLoading(WebView view, String url) {
> // TODO Auto-generated method stub
>
> view.loadUrl(url);
>
> return true;
> }
>
> @Override
> public void onPageFinished(WebView view, String url) {
> // TODO Auto-generated method stub
> super.onPageFinished(view, url);
>
> }
> }
>
> @SuppressLint("NewApi")
> @Override
> protected void onPause() {
> // TODO Auto-generated method stub
> WebSettings webSettings = webtv.getSettings();
> webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
> webtv.onPause();
> this.finish();
> super.onPause();
>
> }
>
> @SuppressLint("NewApi")
> @Override
> protected void onResume() {
>
>
>
> webtv.onResume();
> super.onResume();
>
> }
>
>
>
>
>
>
> @Override
> protected void onDestroy() {
> // TODO Auto-generated method stub
> // android.os.Process.killProcess(android.os.Process.myPid());
> Editor editor = getSharedPreferences("clear_cache",
> Context.MODE_PRIVATE).edit();
> editor.clear();
> editor.commit();
> trimCache(this);
>
> super.onDestroy();
> }
>
> class WChromeClient extends WebChromeClient {
> @Override
> public void onProgressChanged(WebView view, int progress) {
> Log.i("Method", "Onrogresschanged");
>
> Livetvwebview.this.setTitle("Loading...");
> Livetvwebview.this.setProgress(progress * 100);
> if (progress == 100)
> Livetvwebview.this.setTitle("LiveTv");
>
> }
>
> @Override
> public void onShowCustomView(View view, CustomViewCallback callback) {
> // TODO Auto-generated method stub
> super.onShowCustomView(view, callback);
> if (view instanceof FrameLayout) {
> FrameLayout frame = (FrameLayout) view;
> if (frame.getFocusedChild() instanceof VideoView) {
> webtv.setVisibility(View.GONE);
> video = (VideoView) frame.getFocusedChild();
> FrameLayout.LayoutParams pa

[android-developers] Re: webview cookie sometimes null

2012-09-14 Thread bob
 

If you are calling Webview.loadUrl, *and* the URL is completely loaded, I 
would think the cookie would be there.



On Friday, September 14, 2012 9:18:08 AM UTC-5, emada.adame wrote:
>
> it was my understanding the webview.load(url) would get the cookie, 
> everything else is just to make sure the webview can accept cookies. Which 
> it dose do some times and other not so much. What would you recommend? 
>
> On Thursday, September 13, 2012 11:00:26 AM UTC-5, bob wrote:
>>
>> The issue is probably that the cookie is not necessarily there.  I don't 
>> see anywhere in your code where you load any URL.
>>
>>
>> I'm pretty sure this function doesn't load anything:
>>
>>
>> public String getCookie (String url)
>>
>>
>> It probably just looks in a cookie cache.
>>
>>
>>
>> On Thursday, September 13, 2012 10:28:57 AM UTC-5, emada.adame wrote:
>>>
>>> Yeah I'm still having this issue, can anyone help? any ideas? Here is my 
>>> new updated code:
>>>
>>>  String server = settings.getString("server", "");
>>>  String user = settings.getString("username", "");
>>>  String passwd = settings.getString("passwd", "");
>>>  webview = new WebView(this);
>>>  WebSettings webSettings = webview.getSettings();
>>>  webSettings.setJavaScriptEnabled(true);
>>>  webview.setWebViewClient(new InsideWebViewClient());
>>>  setContentView(webview);
>>>  String credUrl = 
>>> "http://"+server+"/services.php?sname=LoginService&isapp=true&username="+user+"&rawpassword="+passwd;
>>>  //CookieSyncManager.createInstance(webview.getContext());
>>>  //CookieSyncManager.getInstance();
>>>  CookieManager cookieManager = CookieManager.getInstance();
>>>  cookieManager.setAcceptCookie(true);
>>>  webview.loadUrl(credUrl);
>>>  String rawCookie = cookieManager.getCookie(server);
>>>  mes(rawCookie);
>>>  /*while(rawCookie == null){
>>> SystemClock.sleep(1000);
>>> rawCookie = cookieManager.getCookie(credUrl);
>>>  }*/
>>>  webview.loadUrl("http://"+server);
>>>
>>> basically i just took out the cookie sync manager because it wasnt 
>>> really doing anything and put a while loop in "that is now commented out" 
>>> that was crashing the app :/ 
>>>
>>> On Friday, March 23, 2012 4:05:41 PM UTC-5, emada.adame wrote:

 I have an app that is trying to log into a site and get the cookie then 
 show me the cookie in a toast but most of the time it fails to get the 
 cookie, is there some timeout issue here or something im hitting? 

 here is my code

 public void showPage(){
 try{
 String server = settings.getString("server", "");
 String user = settings.getString("username", "");
 String passwd = settings.getString("passwd", "");
 WebView webview = new WebView(this);
 WebSettings webSettings = webview.getSettings();
 webSettings.setJavaScriptEnabled(true);
 setContentView(webview);
 String credUrl = 
 "http://"+server+"/services.php?sname=LoginService&username="+user+"&rawpassword="+passwd;
 CookieSyncManager syncMgr = 
 CookieSyncManager.createInstance(webview.getContext());
 CookieSyncManager.getInstance();
 CookieManager cookieManager = CookieManager.getInstance();
 String rawCookie = cookieManager.getCookie(credUrl);
 mes(rawCookie);
 }catch(Exception e){
 mes("err3: "+e.toString());
 }
 }

>>>

-- 
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 cookie sometimes null

2012-09-14 Thread emada.adame
it was my understanding the webview.load(url) would get the cookie, 
everything else is just to make sure the webview can accept cookies. Which 
it dose do some times and other not so much. What would you recommend? 

On Thursday, September 13, 2012 11:00:26 AM UTC-5, bob wrote:
>
> The issue is probably that the cookie is not necessarily there.  I don't 
> see anywhere in your code where you load any URL.
>
>
> I'm pretty sure this function doesn't load anything:
>
>
> public String getCookie (String url)
>
>
> It probably just looks in a cookie cache.
>
>
>
> On Thursday, September 13, 2012 10:28:57 AM UTC-5, emada.adame wrote:
>>
>> Yeah I'm still having this issue, can anyone help? any ideas? Here is my 
>> new updated code:
>>
>>  String server = settings.getString("server", "");
>>  String user = settings.getString("username", "");
>>  String passwd = settings.getString("passwd", "");
>>  webview = new WebView(this);
>>  WebSettings webSettings = webview.getSettings();
>>  webSettings.setJavaScriptEnabled(true);
>>  webview.setWebViewClient(new InsideWebViewClient());
>>  setContentView(webview);
>>  String credUrl = 
>> "http://"+server+"/services.php?sname=LoginService&isapp=true&username="+user+"&rawpassword="+passwd;
>>  //CookieSyncManager.createInstance(webview.getContext());
>>  //CookieSyncManager.getInstance();
>>  CookieManager cookieManager = CookieManager.getInstance();
>>  cookieManager.setAcceptCookie(true);
>>  webview.loadUrl(credUrl);
>>  String rawCookie = cookieManager.getCookie(server);
>>  mes(rawCookie);
>>  /*while(rawCookie == null){
>> SystemClock.sleep(1000);
>> rawCookie = cookieManager.getCookie(credUrl);
>>  }*/
>>  webview.loadUrl("http://"+server);
>>
>> basically i just took out the cookie sync manager because it wasnt really 
>> doing anything and put a while loop in "that is now commented out" that was 
>> crashing the app :/ 
>>
>> On Friday, March 23, 2012 4:05:41 PM UTC-5, emada.adame wrote:
>>>
>>> I have an app that is trying to log into a site and get the cookie then 
>>> show me the cookie in a toast but most of the time it fails to get the 
>>> cookie, is there some timeout issue here or something im hitting? 
>>>
>>> here is my code
>>>
>>> public void showPage(){
>>> try{
>>> String server = settings.getString("server", "");
>>> String user = settings.getString("username", "");
>>> String passwd = settings.getString("passwd", "");
>>> WebView webview = new WebView(this);
>>> WebSettings webSettings = webview.getSettings();
>>> webSettings.setJavaScriptEnabled(true);
>>> setContentView(webview);
>>> String credUrl = 
>>> "http://"+server+"/services.php?sname=LoginService&username="+user+"&rawpassword="+passwd;
>>> CookieSyncManager syncMgr = 
>>> CookieSyncManager.createInstance(webview.getContext());
>>> CookieSyncManager.getInstance();
>>> CookieManager cookieManager = CookieManager.getInstance();
>>> String rawCookie = cookieManager.getCookie(credUrl);
>>> mes(rawCookie);
>>> }catch(Exception e){
>>> mes("err3: "+e.toString());
>>> }
>>> }
>>>
>>

-- 
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 cookie sometimes null

2012-09-13 Thread bob
 

The issue is probably that the cookie is not necessarily there.  I don't 
see anywhere in your code where you load any URL.


I'm pretty sure this function doesn't load anything:


public String getCookie (String url)


It probably just looks in a cookie cache.



On Thursday, September 13, 2012 10:28:57 AM UTC-5, emada.adame wrote:
>
> Yeah I'm still having this issue, can anyone help? any ideas? Here is my 
> new updated code:
>
>  String server = settings.getString("server", "");
>  String user = settings.getString("username", "");
>  String passwd = settings.getString("passwd", "");
>  webview = new WebView(this);
>  WebSettings webSettings = webview.getSettings();
>  webSettings.setJavaScriptEnabled(true);
>  webview.setWebViewClient(new InsideWebViewClient());
>  setContentView(webview);
>  String credUrl = 
> "http://"+server+"/services.php?sname=LoginService&isapp=true&username="+user+"&rawpassword="+passwd;
>  //CookieSyncManager.createInstance(webview.getContext());
>  //CookieSyncManager.getInstance();
>  CookieManager cookieManager = CookieManager.getInstance();
>  cookieManager.setAcceptCookie(true);
>  webview.loadUrl(credUrl);
>  String rawCookie = cookieManager.getCookie(server);
>  mes(rawCookie);
>  /*while(rawCookie == null){
> SystemClock.sleep(1000);
> rawCookie = cookieManager.getCookie(credUrl);
>  }*/
>  webview.loadUrl("http://"+server);
>
> basically i just took out the cookie sync manager because it wasnt really 
> doing anything and put a while loop in "that is now commented out" that was 
> crashing the app :/ 
>
> On Friday, March 23, 2012 4:05:41 PM UTC-5, emada.adame wrote:
>>
>> I have an app that is trying to log into a site and get the cookie then 
>> show me the cookie in a toast but most of the time it fails to get the 
>> cookie, is there some timeout issue here or something im hitting? 
>>
>> here is my code
>>
>> public void showPage(){
>> try{
>> String server = settings.getString("server", "");
>> String user = settings.getString("username", "");
>> String passwd = settings.getString("passwd", "");
>> WebView webview = new WebView(this);
>> WebSettings webSettings = webview.getSettings();
>> webSettings.setJavaScriptEnabled(true);
>> setContentView(webview);
>> String credUrl = 
>> "http://"+server+"/services.php?sname=LoginService&username="+user+"&rawpassword="+passwd;
>> CookieSyncManager syncMgr = 
>> CookieSyncManager.createInstance(webview.getContext());
>> CookieSyncManager.getInstance();
>> CookieManager cookieManager = CookieManager.getInstance();
>> String rawCookie = cookieManager.getCookie(credUrl);
>> mes(rawCookie);
>> }catch(Exception e){
>> mes("err3: "+e.toString());
>> }
>> }
>>
>

-- 
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 cookie sometimes null

2012-09-13 Thread emada.adame
Yeah I'm still having this issue, can anyone help? any ideas? Here is my 
new updated code:

 String server = settings.getString("server", "");
 String user = settings.getString("username", "");
 String passwd = settings.getString("passwd", "");
 webview = new WebView(this);
 WebSettings webSettings = webview.getSettings();
 webSettings.setJavaScriptEnabled(true);
 webview.setWebViewClient(new InsideWebViewClient());
 setContentView(webview);
 String credUrl = 
"http://"+server+"/services.php?sname=LoginService&isapp=true&username="+user+"&rawpassword="+passwd;
 //CookieSyncManager.createInstance(webview.getContext());
 //CookieSyncManager.getInstance();
 CookieManager cookieManager = CookieManager.getInstance();
 cookieManager.setAcceptCookie(true);
 webview.loadUrl(credUrl);
 String rawCookie = cookieManager.getCookie(server);
 mes(rawCookie);
 /*while(rawCookie == null){
SystemClock.sleep(1000);
rawCookie = cookieManager.getCookie(credUrl);
 }*/
 webview.loadUrl("http://"+server);

basically i just took out the cookie sync manager because it wasnt really 
doing anything and put a while loop in "that is now commented out" that was 
crashing the app :/ 

On Friday, March 23, 2012 4:05:41 PM UTC-5, emada.adame wrote:
>
> I have an app that is trying to log into a site and get the cookie then 
> show me the cookie in a toast but most of the time it fails to get the 
> cookie, is there some timeout issue here or something im hitting? 
>
> here is my code
>
> public void showPage(){
> try{
> String server = settings.getString("server", "");
> String user = settings.getString("username", "");
> String passwd = settings.getString("passwd", "");
> WebView webview = new WebView(this);
> WebSettings webSettings = webview.getSettings();
> webSettings.setJavaScriptEnabled(true);
> setContentView(webview);
> String credUrl = 
> "http://"+server+"/services.php?sname=LoginService&username="+user+"&rawpassword="+passwd;
> CookieSyncManager syncMgr = 
> CookieSyncManager.createInstance(webview.getContext());
> CookieSyncManager.getInstance();
> CookieManager cookieManager = CookieManager.getInstance();
> String rawCookie = cookieManager.getCookie(credUrl);
> mes(rawCookie);
> }catch(Exception e){
> mes("err3: "+e.toString());
> }
> }
>

-- 
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 lost JavaScript update contents after called goBack()

2012-09-07 Thread Pan Ng
Did u come up with an anwser for this issue?

On Friday, November 18, 2011 6:23:32 PM UTC+8, alex wrote:
>
> I have a problem that when I click back button on a WebView, my
> previous page losts all contents updated by JavaScript.
>
> My steps in WebView was below:
> - after Main page loaded, JavaScript starts update contents, like
> refresh shoppings with links;
> - user will see some shopping lists after updated;
> - then user click each link will load new url in same WebView;
> - user click back to Main page;
>
> the problem is when user back to Main page, user cannot see any
> shopping updated by JavaScript, they were gone!
> I tried my page on IE and FF, both works fine, but had problem on
> Android WebView. I'm not sure this issue caused by I'm not set some
> settings correctly or other issues.
>
> My sample code as below:
>
> // set settings for webview
> WebSettings webSettings = web.getSettings();
> webSettings.setBuiltInZoomControls(true);
> webSettings.setJavaScriptEnabled(true);
> webSettings.setUseWideViewPort(true);
> webSettings.setDomStorageEnabled(true);
> webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
>
> // call JavaScript to update shoppings
> webView.loadUrl("javascript:addShoppings(" + str + ");");
>
> // add interface for callback
> webView.addJavascriptInterface(new
> BusinessJavaScriptInterface(), "business");
>
> final class BusinessJavaScriptInterface
> {
> public void businessListReceived()
> {
> ... ...
> }
> }
>
> // handle back key event
> public boolean onKeyDown(int keyCode, KeyEvent event)
> {
> WebView web = (WebView) this.findViewById(R.id.browser);
> if (web != null)
> {
> if ((keyCode == KeyEvent.KEYCODE_BACK) && web.canGoBack())
> {
> web.goBack();
> return true;
> }
> return super.onKeyDown(keyCode, event);
> }
> return false;
> }
>
>

-- 
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

Re: [android-developers] Re: WebView / setBuiltinZoomControls / setOnTouchListener

2012-08-26 Thread Sachin Gupta
I think WebView stops firing onTouch event once the zoom-controls are shown 
on web-view.
I receive touch events even after using pinch zoom, provided zoom-controls 
are not shown yet.

If it is not must to also show the on-screen zoom-controls, following can 
be used to solve the issue.
myWebView.getSettings().setDisplayZoomControls(false);

It just stops to show the controls, pinch-zoom support is still available. 

-- 
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 client, that intercepts requests on API 8

2012-08-06 Thread Gelonida N

On 08/06/2012 11:52 PM, Kristopher Micinski wrote:

On Mon, Aug 6, 2012 at 5:46 PM, Kostya Vasilyev  wrote:

2012/8/7 Kristopher Micinski 


Yes, but to intercept the requests to the browser using a proxy (as
the OP suggests) requires rooting the device.



Feeding a WebView that's in your own app a URL like
"localhost:1234?src=www.foo.bar" requires rooting?


Not really an option, the web page is heavily Ajax based.

What would work though is, using a web proxy, that just passes most 
locations through and would send blank images or a 404 for certain urls.
Not really elegant and causing more traffic than blocking adapting the 
request on the phone, but it would be doable.


However  my naive asumption, that an Android phone is capable of setting 
/ using web proxies seems to be rather wrong.
After some googling I found out, that without rooting it seems to be 
impossible to set a proxy for a wifi connection (seems to be doable 
globally for mobile networks though)





Processing the received HTML / CSS, replacing links requires rooting?



To do it properly, and identify all of the links statically would
require a real considerable amount of analysis because of the
funkiness of HTML.  I previously suggested this approach to the OP,
but I doubt that it will work (and it just *feels* wrong), and even if
it does it's just abhorrently hacky..  So if he knows the structure of
the page, then perhaps, maybe this would be an acceptable hack, but
for the general case of writing a web browser, (as he says), hell no.



I knew Webkit via QT4 and am quite surprised about the rather reduced 
feature set provided by the Google java API. That's really a pity and 
I'm surprised these new features are only added for very new phones.
If shouldInterceptRequest() were suypported by older releases, then I 
wouldn't even have to use proxies.



It seems I have to wait one year or more to get a newer phone or to bite 
the bullet and root my phone.





--
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


Re: [android-developers] Re: webview client, that intercepts requests on API 8

2012-08-06 Thread Kristopher Micinski
On Mon, Aug 6, 2012 at 5:46 PM, Kostya Vasilyev  wrote:
> 2012/8/7 Kristopher Micinski 
>>
>> Yes, but to intercept the requests to the browser using a proxy (as
>> the OP suggests) requires rooting the device.
>
>
> Feeding a WebView that's in your own app a URL like
> "localhost:1234?src=www.foo.bar" requires rooting?
>
> Processing the received HTML / CSS, replacing links requires rooting?
>

To do it properly, and identify all of the links statically would
require a real considerable amount of analysis because of the
funkiness of HTML.  I previously suggested this approach to the OP,
but I doubt that it will work (and it just *feels* wrong), and even if
it does it's just abhorrently hacky..  So if he knows the structure of
the page, then perhaps, maybe this would be an acceptable hack, but
for the general case of writing a web browser, (as he says), hell no.

kris

-- 
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


Re: [android-developers] Re: webview client, that intercepts requests on API 8

2012-08-06 Thread Kostya Vasilyev
2012/8/7 Kristopher Micinski 

> Yes, but to intercept the requests to the browser using a proxy (as
> the OP suggests) requires rooting the device.
>

Feeding a WebView that's in your own app a URL like
"localhost:1234?src=www.foo.bar" requires rooting?

Processing the received HTML / CSS, replacing links requires rooting?


>
> Sure, redirecting the links is one thing if you have control of the
> webview, for arbitrary ajax traffic it's a no.
>

Agree - this won't work for requests dynamically generated by JS, but it
might be acceptable depending on the requirements.

-- K


>
> kris
>
> On Mon, Aug 6, 2012 at 5:32 PM, Kostya Vasilyev 
> wrote:
> >
> > 2012/8/7 Kristopher Micinski 
> >>
> >> Yes, but implementing this proxy would require rooting the device.
> >
> >
> > Not necessarily - if the WebView is under the developer's control (i.e.
> > there is no intention to do this system-wide), then it should be
> possible to
> > feed the WebView a URL that refers to a server running on localhost (as
> part
> > of the same app).
> >
> > -- K
> >
> >> For the second question you're asking, I had hoped to imply that this
> >> was my plan, and the answer is that I believe you cannot do so.
> >>
> >> kris
> >>
> >> On Mon, Aug 6, 2012 at 4:54 PM, Gelonida N  wrote:
> >> > Hi Chris,
> >> >
> >> >
> >> > On 08/06/2012 01:33 AM, Kristopher Micinski wrote:
> >> >>
> >> >> I doubt it, I tried to find a way to proxy traffic, but there's no
> >> >> easy hook.  I.e., if you need something that is in 11 and you're on 8
> >> >> you're just plain out of luck.
> >> >>
> >> >> There is one solution, but implementing it accurately would be dumb
> >> >> because of how much ajax stuff (and related) there is now: you can
> >> >> look at the HTML statically, pull out the image tags, and render the
> >> >> page yourself... There obviously isn't an easy way to do this, so
> this
> >> >> answer is as good as "rewrite webkit."
> >> >
> >> >
> >> > Hmm an alternative would be implementing a filtering web proxy. Much
> >> > more
> >> > complicated, but perhaps doable.
> >> > Is there any way, that I can create an application, that would use a
> >> > webview
> >> > with it's custom proxy, whereas the normal browser (or other web
> views)
> >> > would just use the default proxy setup (which is in my case 'no
> proxy')
> >> >
> >> >>
> >> >>
> >> >> On Sun, Aug 5, 2012 at 6:15 PM, Gelonida N 
> wrote:
> >> >>>
> >> >>> I'm having an HTC desire (Android2.2.2 Froyo API 8)
> >> >>> and  I wanted to create a custom browser (using WebViewclient), that
> >> >>> intercepts some url requests ( tags) and skips loading these
> >> >>> images.
> >> >>>
> >> >>> public WebResourceResponse shouldInterceptRequest (WebView view,
> >> >>> String
> >> >>> url)
> >> >>> seems to be what I need.
> >> >>>
> >> >>> However I'm only on API 8 and the function has been introduced on
> API
> >> >>> 11.
> >> >>>
> >> >>> Is there any way to do what I want to do with API 8
> >> >>>
> >> >>> My phone is supposed to be updatable to Gingerbread, but that brings
> >> >>> me
> >> >>> only
> >> >>> to API 9 (or 10) and still not to 11.
> >> >>>
> >> >>>
> >> >
> >> >
> >> > --
> >> > 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
> >>
> >> --
> >> 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
> >
> >
> > --
> > 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
>
> --
> 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
>

-- 
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, 

Re: [android-developers] Re: webview client, that intercepts requests on API 8

2012-08-06 Thread Kristopher Micinski
Yes, but to intercept the requests to the browser using a proxy (as
the OP suggests) requires rooting the device.

Sure, redirecting the links is one thing if you have control of the
webview, for arbitrary ajax traffic it's a no.

kris

On Mon, Aug 6, 2012 at 5:32 PM, Kostya Vasilyev  wrote:
>
> 2012/8/7 Kristopher Micinski 
>>
>> Yes, but implementing this proxy would require rooting the device.
>
>
> Not necessarily - if the WebView is under the developer's control (i.e.
> there is no intention to do this system-wide), then it should be possible to
> feed the WebView a URL that refers to a server running on localhost (as part
> of the same app).
>
> -- K
>
>> For the second question you're asking, I had hoped to imply that this
>> was my plan, and the answer is that I believe you cannot do so.
>>
>> kris
>>
>> On Mon, Aug 6, 2012 at 4:54 PM, Gelonida N  wrote:
>> > Hi Chris,
>> >
>> >
>> > On 08/06/2012 01:33 AM, Kristopher Micinski wrote:
>> >>
>> >> I doubt it, I tried to find a way to proxy traffic, but there's no
>> >> easy hook.  I.e., if you need something that is in 11 and you're on 8
>> >> you're just plain out of luck.
>> >>
>> >> There is one solution, but implementing it accurately would be dumb
>> >> because of how much ajax stuff (and related) there is now: you can
>> >> look at the HTML statically, pull out the image tags, and render the
>> >> page yourself... There obviously isn't an easy way to do this, so this
>> >> answer is as good as "rewrite webkit."
>> >
>> >
>> > Hmm an alternative would be implementing a filtering web proxy. Much
>> > more
>> > complicated, but perhaps doable.
>> > Is there any way, that I can create an application, that would use a
>> > webview
>> > with it's custom proxy, whereas the normal browser (or other web views)
>> > would just use the default proxy setup (which is in my case 'no proxy')
>> >
>> >>
>> >>
>> >> On Sun, Aug 5, 2012 at 6:15 PM, Gelonida N  wrote:
>> >>>
>> >>> I'm having an HTC desire (Android2.2.2 Froyo API 8)
>> >>> and  I wanted to create a custom browser (using WebViewclient), that
>> >>> intercepts some url requests ( tags) and skips loading these
>> >>> images.
>> >>>
>> >>> public WebResourceResponse shouldInterceptRequest (WebView view,
>> >>> String
>> >>> url)
>> >>> seems to be what I need.
>> >>>
>> >>> However I'm only on API 8 and the function has been introduced on API
>> >>> 11.
>> >>>
>> >>> Is there any way to do what I want to do with API 8
>> >>>
>> >>> My phone is supposed to be updatable to Gingerbread, but that brings
>> >>> me
>> >>> only
>> >>> to API 9 (or 10) and still not to 11.
>> >>>
>> >>>
>> >
>> >
>> > --
>> > 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
>>
>> --
>> 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
>
>
> --
> 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

-- 
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


Re: [android-developers] Re: webview client, that intercepts requests on API 8

2012-08-06 Thread Kostya Vasilyev
2012/8/7 Kristopher Micinski 

> Yes, but implementing this proxy would require rooting the device.
>

Not necessarily - if the WebView is under the developer's control (i.e.
there is no intention to do this system-wide), then it should be possible
to feed the WebView a URL that refers to a server running on localhost (as
part of the same app).

-- K

For the second question you're asking, I had hoped to imply that this
> was my plan, and the answer is that I believe you cannot do so.
>
> kris
>
> On Mon, Aug 6, 2012 at 4:54 PM, Gelonida N  wrote:
> > Hi Chris,
> >
> >
> > On 08/06/2012 01:33 AM, Kristopher Micinski wrote:
> >>
> >> I doubt it, I tried to find a way to proxy traffic, but there's no
> >> easy hook.  I.e., if you need something that is in 11 and you're on 8
> >> you're just plain out of luck.
> >>
> >> There is one solution, but implementing it accurately would be dumb
> >> because of how much ajax stuff (and related) there is now: you can
> >> look at the HTML statically, pull out the image tags, and render the
> >> page yourself... There obviously isn't an easy way to do this, so this
> >> answer is as good as "rewrite webkit."
> >
> >
> > Hmm an alternative would be implementing a filtering web proxy. Much more
> > complicated, but perhaps doable.
> > Is there any way, that I can create an application, that would use a
> webview
> > with it's custom proxy, whereas the normal browser (or other web views)
> > would just use the default proxy setup (which is in my case 'no proxy')
> >
> >>
> >>
> >> On Sun, Aug 5, 2012 at 6:15 PM, Gelonida N  wrote:
> >>>
> >>> I'm having an HTC desire (Android2.2.2 Froyo API 8)
> >>> and  I wanted to create a custom browser (using WebViewclient), that
> >>> intercepts some url requests ( tags) and skips loading these
> images.
> >>>
> >>> public WebResourceResponse shouldInterceptRequest (WebView view, String
> >>> url)
> >>> seems to be what I need.
> >>>
> >>> However I'm only on API 8 and the function has been introduced on API
> 11.
> >>>
> >>> Is there any way to do what I want to do with API 8
> >>>
> >>> My phone is supposed to be updatable to Gingerbread, but that brings me
> >>> only
> >>> to API 9 (or 10) and still not to 11.
> >>>
> >>>
> >
> >
> > --
> > 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
>
> --
> 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
>

-- 
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

Re: [android-developers] Re: webview client, that intercepts requests on API 8

2012-08-06 Thread Kristopher Micinski
Yes, but implementing this proxy would require rooting the device.
For the second question you're asking, I had hoped to imply that this
was my plan, and the answer is that I believe you cannot do so.

kris

On Mon, Aug 6, 2012 at 4:54 PM, Gelonida N  wrote:
> Hi Chris,
>
>
> On 08/06/2012 01:33 AM, Kristopher Micinski wrote:
>>
>> I doubt it, I tried to find a way to proxy traffic, but there's no
>> easy hook.  I.e., if you need something that is in 11 and you're on 8
>> you're just plain out of luck.
>>
>> There is one solution, but implementing it accurately would be dumb
>> because of how much ajax stuff (and related) there is now: you can
>> look at the HTML statically, pull out the image tags, and render the
>> page yourself... There obviously isn't an easy way to do this, so this
>> answer is as good as "rewrite webkit."
>
>
> Hmm an alternative would be implementing a filtering web proxy. Much more
> complicated, but perhaps doable.
> Is there any way, that I can create an application, that would use a webview
> with it's custom proxy, whereas the normal browser (or other web views)
> would just use the default proxy setup (which is in my case 'no proxy')
>
>>
>>
>> On Sun, Aug 5, 2012 at 6:15 PM, Gelonida N  wrote:
>>>
>>> I'm having an HTC desire (Android2.2.2 Froyo API 8)
>>> and  I wanted to create a custom browser (using WebViewclient), that
>>> intercepts some url requests ( tags) and skips loading these images.
>>>
>>> public WebResourceResponse shouldInterceptRequest (WebView view, String
>>> url)
>>> seems to be what I need.
>>>
>>> However I'm only on API 8 and the function has been introduced on API 11.
>>>
>>> Is there any way to do what I want to do with API 8
>>>
>>> My phone is supposed to be updatable to Gingerbread, but that brings me
>>> only
>>> to API 9 (or 10) and still not to 11.
>>>
>>>
>
>
> --
> 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

-- 
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 client, that intercepts requests on API 8

2012-08-06 Thread Gelonida N

Hi Chris,

On 08/06/2012 01:33 AM, Kristopher Micinski wrote:

I doubt it, I tried to find a way to proxy traffic, but there's no
easy hook.  I.e., if you need something that is in 11 and you're on 8
you're just plain out of luck.

There is one solution, but implementing it accurately would be dumb
because of how much ajax stuff (and related) there is now: you can
look at the HTML statically, pull out the image tags, and render the
page yourself... There obviously isn't an easy way to do this, so this
answer is as good as "rewrite webkit."


Hmm an alternative would be implementing a filtering web proxy. Much 
more complicated, but perhaps doable.
Is there any way, that I can create an application, that would use a 
webview with it's custom proxy, whereas the normal browser (or other web 
views) would just use the default proxy setup (which is in my case 'no 
proxy')





On Sun, Aug 5, 2012 at 6:15 PM, Gelonida N  wrote:

I'm having an HTC desire (Android2.2.2 Froyo API 8)
and  I wanted to create a custom browser (using WebViewclient), that
intercepts some url requests ( tags) and skips loading these images.

public WebResourceResponse shouldInterceptRequest (WebView view, String url)
seems to be what I need.

However I'm only on API 8 and the function has been introduced on API 11.

Is there any way to do what I want to do with API 8

My phone is supposed to be updatable to Gingerbread, but that brings me only
to API 9 (or 10) and still not to 11.





--
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 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-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 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


[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 in Andoird 3.x and 4.x does not load JavaScript files

2012-07-12 Thread rhansen
Thanks for your anwsers,

@MathieuB
Yeah, this would be an option for testing but not for the final release. At 
least I will try that although its some effort.

@Streets Of Boston
Unfortunately the LogCat does not show anything suspicious. I have 
overriden almost all functions of WebView and WebChromeClient to see what's 
going on. I can see it starts downloading files and then simply stops in 
the middle.

@Pent
Absolutely. If something goes wrong it is pretty annoying to find out why. 
In this case I am pretty stuck completely. I am fighting with this since 
months. It must be up to something they have changed after Android 2.x, 
because it works without any error in Android 2.x. And the fact that Chrome 
for Android shows the same weird behavior it must be up to sth. they have 
changed in Android 3.x and Android 4.x.


-- 
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 in Andoird 3.x and 4.x does not load JavaScript files

2012-07-12 Thread Pent
> Are you seeing any lines written in the LogCat (generated by the browser)
> that could indicate what is going on?

Also, try set a WebChromeClient on the WebView and override
onConsoleMessage.

On the other hand, I've been working with WebView and JS for the last
few weeks and it's often annoyingly quiet when something goes wrong.

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 in Andoird 3.x and 4.x does not load JavaScript files

2012-07-11 Thread Streets Of Boston
Are you seeing any lines written in the LogCat (generated by the browser) 
that could indicate what is going on?

On Wednesday, July 11, 2012 9:37:27 AM UTC-4, rhansen wrote:
>
> Hey,
>
> We are currently developing an app by using HTML5, JavaScript and CSS in 
> order to have some platform independence. 
>
> On Android we do the following:
> We created a webview which downloads an HTML5 webpage from a server. The 
> HTML5 file includes round about 40 JavaScript files. But somehow in the 
> middle of downloading the JavaScript files the WebView simply stops. 
> Therefore 'window.load' is not called and our JavaScript will never 
> execute. This only happens on Android 3.x and 4.x. On Android 2.x (as well 
> as Safari and Chrome (Desktop) and all iOS devices) it works without any 
> problems. I downloaded Chrome for Android 4.x and used its remote debugging 
> capabilities. It shows the same behaviour: It starts downloading the 
> JavaScript files and stops somewhere in the middle. It does not seem to be 
> up to a specific file though. Chrome stops on random files. 
>
> At the moment this really stops us from developing for Android. We bought 
> several devices (e.g. Galaxy S3) for testing, most of them equipped with 
> Android 3.x and 4.x.
>
> I highly appreciate any hint in to the right direction to make it run. Any 
> hint or workaround is very welcome. Even if we need to "adapt" our server 
> for Android.
>
> Thanks
> René
>

-- 
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 in Andoird 3.x and 4.x does not load JavaScript files

2012-07-11 Thread MathieuB
Do you absolutely need to load the files from a server? You could put them 
in the asset folder.

>
>

-- 
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

Re: [android-developers] Re: WebView and Native Browser

2012-07-10 Thread SAndy

To load a HTML5 webpage try following settings on client side(in webview)  :

 myWebView = new HTML5WebView(context);

myWebView.clearFormData();
myWebView.clearHistory();
myWebView.clearCache(true);

myWebView.getSettings().setAppCacheEnabled(true);
myWebView.getSettings().setDatabaseEnabled(true);
myWebView.getSettings().setDomStorageEnabled(true);

myWebView.loadUrl(url);






On Tuesday, April 27, 2010 7:45:19 AM UTC+5:30, thrusty wrote:
>
> I'm having a similar problem.  Here's an example of a web page that 
> doesn't work within a WebView: 
>
> https://m.gmail.com/ 
>
> I setup my WebView in a manner similar to Nelson...even setup a 
> WebChromeClient that implements onExceededDatabaseQuota  as suggested 
> previously by the PhoneGap folks. 
>
> No luck -- the browser displays a black page with no text or 
> anything.  This does not happen with simple pages or pages that merely 
> "detect" the support for HTML5 features such as  http://html5test.com/ 
>
>
> On Mar 16, 10:46 am, AJ  wrote: 
> > Hi Nelson 
> > Can you share the link/webpage which you are trying ? 
> > 
> > Thanks, 
> > AJ 
> > 
> > On Mar 16, 7:36 pm, nikhil  wrote: 
> > 
> > > Normally, this works for me 
> > 
> > > webView= (WebView) findViewById(R.id.webview); 
> > > webView.setWebChromeClient(new WebChromeClient()); 
> > > webView.setWebViewClient(new WebViewClient()); 
> > > webView.getSettings().setJavaScriptEnabled(true); 
> > > webView.loadUrl(url); 
> > 
> > > On Mar 16, 10:34 am, Nelson  wrote: 
> > 
> > > > Thanks for your reply. 
> > 
> > > > Yes I did: 
> > 
> > > > webView.setWebChromeClient(new WebClient(this)); 
> > > > WebSettings webSettings = webView.getSettings(); 
> > > > webSettings.setSavePassword(false); 
> > > > webSettings.setSaveFormData(false); 
> > > > webSettings.setJavaScriptEnabled(true); 
> > > > webSettings.setSupportZoom(false); 
> > > > webSettings.setDatabaseEnabled(true); 
> > > > 
> webSettings.setJavaScriptCanOpenWindowsAutomatically(true); 
> > > > webSettings 
> > > > .setDatabasePath("/data/data/ 
> > > > my.android.workbench.webviewoverridedemo/app_database"); 
> > > > webSettings.setAllowFileAccess(true); 
> > 
> > > > // workaround so that the default browser doesn't 
> take over 
> > > > webView.setWebViewClient(new MyWebViewClient()) 
> > 
> > > > Even that, the webview browser still cannot render the web page, 
> which 
> > > > can be rendered well on the native browser of Android emulator. 
> > 
> > > > Thanks, 
> > 
> > > > Nelson 
> > 
> > > > On Mar 10, 12:51 pm, nikhil  wrote: 
> > 
> > > > > have you added all the clients? webviewclient,webchromeclient, 
> enabled 
> > > > > javascript etc. 
> > 
> > > > > On Mar 8, 4:08 pm, Nelson  wrote: 
> > 
> > > > > > Dear All, 
> > 
> > > > > > I am working on a WebView browser on Android (like here:
> http://developer.android.com/resources/tutorials/views/hello-webview) 
> > > > > > and trying to load a webpage with HTML5 features. However, the 
> page 
> > > > > > was not loaded very well - only part of it can be shown on the 
> WebView 
> > > > > > browser. Interestingly, this same page can be loaded by the 
> native 
> > > > > > browser of Android emulator very well. I am working on Android 
> 2.0. 
> > 
> > > > > > Can anyone give me some suggestions that what could the things I 
> can 
> > > > > > work on (like settings) to make my WebView browser behave same 
> as the 
> > > > > > native browser? My page has HTML 5 features as said, are there 
> > > > > > differences between what WebView can do and what native browser 
> can do 
> > > > > > in this regard? 
> > 
> > > > > > Thanks a millions for you guys' help. Really appreciate it. 
> > 
> > > > > > Nelson 
>
> -- 
> 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

-- 
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 designMode doesn't work?

2012-07-10 Thread Aerik Sylvan
Another gentle bump.  Testing seems to show that design view sort of works 
- you can enter text, but no cursor shows which makes it almost impossible 
to navigate.  Also, selecting text and changing it does not work (though I 
read on stackoverflow that text selection is handled in a different android 
View so that it sort of understandable...)

-- 
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 -> Flash overdrawing issue

2012-06-28 Thread alex.koukla
I have the same problem .. did you found a solution for this ?

On Friday, May 27, 2011 10:50:44 AM UTC+2, Josh Gitter wrote:
>
> Has anyone noticed that Flash content within a Webview control 
> overdraws other adjacent controls? It seems that the clipping region 
> of the WebView is not respected. 
>
> I'm using Adobe Flash 10.3 and a Nexus S. 
>
> Here is a screen capture of flash content drawing outside of my 
> Webview control. Notice the cartoon drawing on top of the native 
> controls: 
> http://i55.tinypic.com/ea36f9.jpg 
>
> Is there any setting for WebView to keep plugins like Flash within the 
> clipping boundaries? 
>
> Thanks for your help! 
>
> Josh

-- 
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 masking onclick events

2012-03-22 Thread mcterry
that is interesting!  I can't say I've personally seen this issue.  You may 
want to make sure that the WebView container has the "focusable" attributes 
set to "true".
http://developer.android.com/reference/android/view/View.html#attr_android:focusable
 

Hope this helps!
-Matt
www.sep.com/mcterry

On Wednesday, March 21, 2012 5:07:51 AM UTC-4, riv wrote:
>
>
> I have a simple page [www/index.html]: 
>
>  
>  
>  
>  transition="fade" data-theme="b" href="#"> 
> Button 
>  
>  
>  
>  
> //App custom javascript 
>  $("#btnSave").click(function(​) { 
> ​console.log("called"); 
> alert("btnSave is clicked"); 
>
>  }); 
>  
>  
>
> This works fine as: 
>
> public class MyActivity extends DroidGap { 
>
> /** Called when the activity is first created. */ 
> @Override 
> public void onCreate(Bundle savedInstanceState) { 
> super.​onCreate(savedInstanceState); 
>   super.loadUrl(​"file:///android_asset/www/​index.html"); 
>
> but if I use Webview to render this page, onclick event never getting 
> called.. 
>
> mWebView = (WebView) findViewById(R.id.webview); 
> mWebView.​setWebViewClient(new MyWebViewClient()); 
> mWebView.​getSettings().​setJavaScriptEnabled(true); 
> mWebView.​getSettings().​setDomStorageEnabled(true); 
> mWebView.​getSettings().​setAllowFileAccess(true); 
> mWebView.​getSettings().​setBuiltInZoomControls(false); 
> mWebView.​loadUrl("file:///android_​asset/www/index.html"); 
>
>
> Is this a known issue ? 
>
> Thanks in advance, 
> riv

-- 
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

Re: [android-developers] Re: webview problem

2012-03-13 Thread abhijeet tomar
On Tue, Mar 13, 2012 at 5:17 PM, harshita agrawal <
harshitaagrawa...@gmail.com> wrote:

> i think ,it can be solve by writing html content in a file of  local
> folder.can i show file in default web browser.
>
> On Mar 13, 4:35 pm, Narendra Singh Rathore 
> wrote:
> > On Tue, Mar 13, 2012 at 5:00 PM, harshita agrawal <
> >
> > harshitaagrawa...@gmail.com> wrote:
> > > actually , there is more link in webpage .and i am not able to maintain
> > >  history of web page.so i have to show in default browser.
> >
> > Read WebView documentation for that.
> http://developer.android.com/guide/webapps/webview.html
>
> --
> 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
>




yes...this is right method for showing html content..

-- 
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

Re: [android-developers] Re: webview problem

2012-03-13 Thread Narendra Singh Rathore
On Tue, Mar 13, 2012 at 5:17 PM, harshita agrawal <
harshitaagrawa...@gmail.com> wrote:

> i think ,it can be solve by writing html content in a file of  local
> folder.can i show file in default web browser.


No, you cannot.

-- 
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

Re: [android-developers] Re: webview problem

2012-03-13 Thread Mulsaniya Bhadresh
u want to open any url in default browser right?
>
>

-- 
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 problem

2012-03-13 Thread harshita agrawal
i think ,it can be solve by writing html content in a file of  local
folder.can i show file in default web browser.

On Mar 13, 4:35 pm, Narendra Singh Rathore 
wrote:
> On Tue, Mar 13, 2012 at 5:00 PM, harshita agrawal <
>
> harshitaagrawa...@gmail.com> wrote:
> > actually , there is more link in webpage .and i am not able to maintain
> >  history of web page.so i have to show in default browser.
>
> Read WebView documentation for 
> that.http://developer.android.com/guide/webapps/webview.html

-- 
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


Re: [android-developers] Re: webview problem

2012-03-13 Thread Narendra Singh Rathore
On Tue, Mar 13, 2012 at 5:00 PM, harshita agrawal <
harshitaagrawa...@gmail.com> wrote:

> actually , there is more link in webpage .and i am not able to maintain
>  history of web page.so i have to show in default browser.


Read WebView documentation for that.
http://developer.android.com/guide/webapps/webview.html

-- 
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

Re: [android-developers] Re: webview problem

2012-03-13 Thread harshita agrawal
actually , there is more link in webpage .and i am not able to maintain
 history of web page.so i have to show in default browser.

On Tue, Mar 13, 2012 at 4:42 PM, kalandar  wrote:

> You can use android WebView widget to load html
> like this,
>
> *WebViewObject.loadData("html string content");*
>
> i hope this will help you...
>
>  --
> 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
>

-- 
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 problem

2012-03-13 Thread kalandar
You can use android WebView widget to load html
like this,

*WebViewObject.loadData("html string content");*

i hope this will help you...

-- 
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 Java script function

2012-03-08 Thread John Purcell
Amit,

WebViewClient.onPageStarted() is the most reliable and does not depend on 
JS.

-John

On Wednesday, March 7, 2012 7:22:47 AM UTC-5, Amit wrote:
>
> Thanks John for response.
>
> With my response " It is not necessary to be same url as it being loaded 
> from." I didn't mean variable url in  Moktarul's solution can contain wrong 
> value. I was meant: for callback, this info is passed as string variable. 
> This argument carries actual url value, if loaded page is written by us. 
> But think of situation, any malicious page is getting loaded and page calls 
> this exposed JS function. Malicious page writer may not intend to pass 
> correct url information. 
> I am looking for solution, if currently loaded url information can be 
> retrieved inside JS callback from webkit/android SDK , then this info will 
> be authentic.
>
> I hope you understand the problem.
>
> -Amit 
>
> On Tuesday, 6 March 2012 18:20:10 UTC+5:30, John Purcell wrote:
>>
>> Amit,
>>
>>
>>> But i think, if android API provides this infromation, it will be 
>>> reliable information as   android known which url it is currently loading. 
>>>
>>
>> This is incorrect, *webkit* knows what url is authoritatively being 
>> loaded (not necessarily Android). The webkit/JS container bridge is 
>> synchronous while the communication between webkit and the various android 
>> callbacks are asynchronous for the most part. (i.e. In general, Moktarul's 
>> solution is correct if you want the currently loaded url (top level) from 
>> JavaScript).
>>   
>>
>> On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>>>
>>> I think you code snippet has  currentUrl() as JS exposed function. Is 
>>> there anyway to get urk infromation from android API. 
>>> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
>>> be same url as it being loaded from.
>>> But i think, if android API provides this infromation, it will be 
>>> reliable information as   android known which url it is currently loading. 
>>>
>>> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:

 Hi Amit. 

 in html header 
 
 function onload(){
 var url = window.loacation;
 alert(url);
 Android.currentUrl(url);
 } 

 

 

 Moktarul 


 On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>
> Hi,
>
> I am exposing java script function from my webview. This Java script 
> function  is called by webcore thread on-page-loading inside webview. Is 
> there any way to retrieve current loaded url inside called Java script 
> function?
>
>
> Thanks,
>

 On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>
> Hi,
>
> I am exposing java script function from my webview. This Java script 
> function  is called by webcore thread on-page-loading inside webview. Is 
> there any way to retrieve current loaded url inside called Java script 
> function?
>
>
> Thanks,
>

>> On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>>>
>>> I think you code snippet has  currentUrl() as JS exposed function. Is 
>>> there anyway to get urk infromation from android API. 
>>> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
>>> be same url as it being loaded from.
>>> But i think, if android API provides this infromation, it will be 
>>> reliable information as   android known which url it is currently loading. 
>>>
>>> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:

 Hi Amit. 

 in html header 
 
 function onload(){
 var url = window.loacation;
 alert(url);
 Android.currentUrl(url);
 } 

 

 

 Moktarul 


 On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>
> Hi,
>
> I am exposing java script function from my webview. This Java script 
> function  is called by webcore thread on-page-loading inside webview. Is 
> there any way to retrieve current loaded url inside called Java script 
> function?
>
>
> Thanks,
>

 On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>
> Hi,
>
> I am exposing java script function from my webview. This Java script 
> function  is called by webcore thread on-page-loading inside webview. Is 
> there any way to retrieve current loaded url inside called Java script 
> function?
>
>
> Thanks,
>

>> On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>>>
>>> I think you code snippet has  currentUrl() as JS exposed function. Is 
>>> there anyway to get urk infromation from android API. 
>>> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
>>> be same url as it being loaded from.
>>> But i think, if android API provides this infromation, it will be 
>>> reliable information as   android known which url it is currently l

[android-developers] Re: WebView Java script function

2012-03-07 Thread Amit
Thanks John for response.

With my response " It is not necessary to be same url as it being loaded 
from." I didn't mean variable url in  Moktarul's solution can contain wrong 
value. I was meant: for callback, this info is passed as string variable. 
This argument carries actual url value, if loaded page is written by us. 
But think of situation, any malicious page is getting loaded and page calls 
this exposed JS function. Malicious page writer may not intend to pass 
correct url information. 
I am looking for solution, if currently loaded url information can be 
retrieved inside JS callback from webkit/android SDK , then this info will 
be authentic.

I hope you understand the problem.

-Amit 

On Tuesday, 6 March 2012 18:20:10 UTC+5:30, John Purcell wrote:
>
> Amit,
>
>
>> But i think, if android API provides this infromation, it will be 
>> reliable information as   android known which url it is currently loading. 
>>
>
> This is incorrect, *webkit* knows what url is authoritatively being loaded 
> (not necessarily Android). The webkit/JS container bridge is synchronous 
> while the communication between webkit and the various android callbacks 
> are asynchronous for the most part. (i.e. In general, Moktarul's solution 
> is correct if you want the currently loaded url (top level) from 
> JavaScript).
>   
>
> On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>>
>> I think you code snippet has  currentUrl() as JS exposed function. Is 
>> there anyway to get urk infromation from android API. 
>> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
>> be same url as it being loaded from.
>> But i think, if android API provides this infromation, it will be 
>> reliable information as   android known which url it is currently loading. 
>>
>> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>>>
>>> Hi Amit. 
>>>
>>> in html header 
>>> 
>>> function onload(){
>>> var url = window.loacation;
>>> alert(url);
>>> Android.currentUrl(url);
>>> } 
>>>
>>> 
>>>
>>> 
>>>
>>> Moktarul 
>>>
>>>
>>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:

 Hi,

 I am exposing java script function from my webview. This Java script 
 function  is called by webcore thread on-page-loading inside webview. Is 
 there any way to retrieve current loaded url inside called Java script 
 function?


 Thanks,

>>>
>>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:

 Hi,

 I am exposing java script function from my webview. This Java script 
 function  is called by webcore thread on-page-loading inside webview. Is 
 there any way to retrieve current loaded url inside called Java script 
 function?


 Thanks,

>>>
> On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>>
>> I think you code snippet has  currentUrl() as JS exposed function. Is 
>> there anyway to get urk infromation from android API. 
>> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
>> be same url as it being loaded from.
>> But i think, if android API provides this infromation, it will be 
>> reliable information as   android known which url it is currently loading. 
>>
>> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>>>
>>> Hi Amit. 
>>>
>>> in html header 
>>> 
>>> function onload(){
>>> var url = window.loacation;
>>> alert(url);
>>> Android.currentUrl(url);
>>> } 
>>>
>>> 
>>>
>>> 
>>>
>>> Moktarul 
>>>
>>>
>>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:

 Hi,

 I am exposing java script function from my webview. This Java script 
 function  is called by webcore thread on-page-loading inside webview. Is 
 there any way to retrieve current loaded url inside called Java script 
 function?


 Thanks,

>>>
>>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:

 Hi,

 I am exposing java script function from my webview. This Java script 
 function  is called by webcore thread on-page-loading inside webview. Is 
 there any way to retrieve current loaded url inside called Java script 
 function?


 Thanks,

>>>
> On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>>
>> I think you code snippet has  currentUrl() as JS exposed function. Is 
>> there anyway to get urk infromation from android API. 
>> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
>> be same url as it being loaded from.
>> But i think, if android API provides this infromation, it will be 
>> reliable information as   android known which url it is currently loading. 
>>
>> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>>>
>>> Hi Amit. 
>>>
>>> in html header 
>>> 
>>> function onload(){
>>> var url = window.loacation;
>>> alert(url);
>>> Android.currentUrl(url);
>>> } 
>>>
>>> 
>>>
>>> 
>>>
>>> Moktarul 
>>>
>>>
>>> On Monday, 5 March 2012 18:03:30

[android-developers] Re: WebView Java script function

2012-03-06 Thread John Purcell
Amit,


> But i think, if android API provides this infromation, it will be reliable 
> information as   android known which url it is currently loading. 
>

This is incorrect, *webkit* knows what url is authoritatively being loaded 
(not necessarily Android). The webkit/JS container bridge is synchronous 
while the communication between webkit and the various android callbacks 
are asynchronous for the most part. (i.e. In general, Moktarul's solution 
is correct if you want the currently loaded url (top level) from 
JavaScript).
  

On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>
> I think you code snippet has  currentUrl() as JS exposed function. Is 
> there anyway to get urk infromation from android API. 
> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
> be same url as it being loaded from.
> But i think, if android API provides this infromation, it will be reliable 
> information as   android known which url it is currently loading. 
>
> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>>
>> Hi Amit. 
>>
>> in html header 
>> 
>> function onload(){
>> var url = window.loacation;
>> alert(url);
>> Android.currentUrl(url);
>> } 
>>
>> 
>>
>> 
>>
>> Moktarul 
>>
>>
>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>>
>>> Hi,
>>>
>>> I am exposing java script function from my webview. This Java script 
>>> function  is called by webcore thread on-page-loading inside webview. Is 
>>> there any way to retrieve current loaded url inside called Java script 
>>> function?
>>>
>>>
>>> Thanks,
>>>
>>
>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>>
>>> Hi,
>>>
>>> I am exposing java script function from my webview. This Java script 
>>> function  is called by webcore thread on-page-loading inside webview. Is 
>>> there any way to retrieve current loaded url inside called Java script 
>>> function?
>>>
>>>
>>> Thanks,
>>>
>>
On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>
> I think you code snippet has  currentUrl() as JS exposed function. Is 
> there anyway to get urk infromation from android API. 
> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
> be same url as it being loaded from.
> But i think, if android API provides this infromation, it will be reliable 
> information as   android known which url it is currently loading. 
>
> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>>
>> Hi Amit. 
>>
>> in html header 
>> 
>> function onload(){
>> var url = window.loacation;
>> alert(url);
>> Android.currentUrl(url);
>> } 
>>
>> 
>>
>> 
>>
>> Moktarul 
>>
>>
>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>>
>>> Hi,
>>>
>>> I am exposing java script function from my webview. This Java script 
>>> function  is called by webcore thread on-page-loading inside webview. Is 
>>> there any way to retrieve current loaded url inside called Java script 
>>> function?
>>>
>>>
>>> Thanks,
>>>
>>
>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>>
>>> Hi,
>>>
>>> I am exposing java script function from my webview. This Java script 
>>> function  is called by webcore thread on-page-loading inside webview. Is 
>>> there any way to retrieve current loaded url inside called Java script 
>>> function?
>>>
>>>
>>> Thanks,
>>>
>>
On Tuesday, March 6, 2012 1:13:02 AM UTC-5, Amit wrote:
>
> I think you code snippet has  currentUrl() as JS exposed function. Is 
> there anyway to get urk infromation from android API. 
> Android.currentUrl(url), caller can pass anystring. It is not necessary to 
> be same url as it being loaded from.
> But i think, if android API provides this infromation, it will be reliable 
> information as   android known which url it is currently loading. 
>
> On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>>
>> Hi Amit. 
>>
>> in html header 
>> 
>> function onload(){
>> var url = window.loacation;
>> alert(url);
>> Android.currentUrl(url);
>> } 
>>
>> 
>>
>> 
>>
>> Moktarul 
>>
>>
>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>>
>>> Hi,
>>>
>>> I am exposing java script function from my webview. This Java script 
>>> function  is called by webcore thread on-page-loading inside webview. Is 
>>> there any way to retrieve current loaded url inside called Java script 
>>> function?
>>>
>>>
>>> Thanks,
>>>
>>
>> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>>
>>> Hi,
>>>
>>> I am exposing java script function from my webview. This Java script 
>>> function  is called by webcore thread on-page-loading inside webview. Is 
>>> there any way to retrieve current loaded url inside called Java script 
>>> function?
>>>
>>>
>>> Thanks,
>>>
>>

-- 
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 opt

[android-developers] Re: WebView Java script function

2012-03-05 Thread Amit
I think you code snippet has  currentUrl() as JS exposed function. Is there 
anyway to get urk infromation from android API. Android.currentUrl(url), 
caller can pass anystring. It is not necessary to be same url as it being 
loaded from.
But i think, if android API provides this infromation, it will be reliable 
information as   android known which url it is currently loading. 

On Tuesday, 6 March 2012 10:39:42 UTC+5:30, moktarul anam wrote:
>
> Hi Amit. 
>
> in html header 
> 
> function onload(){
> var url = window.loacation;
> alert(url);
> Android.currentUrl(url);
> } 
>
> 
>
> 
>
> Moktarul 
>
>
> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>
>> Hi,
>>
>> I am exposing java script function from my webview. This Java script 
>> function  is called by webcore thread on-page-loading inside webview. Is 
>> there any way to retrieve current loaded url inside called Java script 
>> function?
>>
>>
>> Thanks,
>>
>
> On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>>
>> Hi,
>>
>> I am exposing java script function from my webview. This Java script 
>> function  is called by webcore thread on-page-loading inside webview. Is 
>> there any way to retrieve current loaded url inside called Java script 
>> function?
>>
>>
>> Thanks,
>>
>

-- 
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 Java script function

2012-03-05 Thread moktarul anam
Hi Amit. 

in html header 

function onload(){
var url = window.loacation;
alert(url);
Android.currentUrl(url);
} 





Moktarul 


On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>
> Hi,
>
> I am exposing java script function from my webview. This Java script 
> function  is called by webcore thread on-page-loading inside webview. Is 
> there any way to retrieve current loaded url inside called Java script 
> function?
>
>
> Thanks,
>

On Monday, 5 March 2012 18:03:30 UTC+5:30, Amit wrote:
>
> Hi,
>
> I am exposing java script function from my webview. This Java script 
> function  is called by webcore thread on-page-loading inside webview. Is 
> there any way to retrieve current loaded url inside called Java script 
> function?
>
>
> Thanks,
>

-- 
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 + MediaPlayer Error but what mean this error

2012-02-26 Thread sen
No one knows this error?

On 24 Feb., 12:44, sen  wrote:
>...
> 02-24 11:12:27.080: V/webview(4682):  singleCursorHandlerTouchEvent -
> getEditableSupport  FASLE
> 02-24 11:12:27.680: I/MediaPlayer(4682): prepareAsync called in state
> 4
> 02-24 11:12:27.680: E/MediaPlayer(4682): error (1, -2147483648)
> 02-24 11:12:27.770: E/MediaPlayer(4682): Error (1,-2147483648)
> 02-24 11:12:29.770: V/webview(4682):  singleCursorHandlerTouchEvent -
> getEditableSupport  FASLE
>
>

-- 
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 inner link problem

2012-02-24 Thread moktarul anam
Hi Kalandar,
In webview there s something JavaScriptInterface funda. From webview
browser u can call activity method from here


See this link: http://developer.android.com/guide/webapps/webview.html

Enjoy
Moktarul anam


On Feb 24, 11:37 am, kalandar  wrote:
> hi friends,
>
>             android webview can trigger the event
> shouldOverrideUrlLoading when we click the external url 
> (likehttp://www.google.com).
> but the problem was with inner link. this event does not trigger when
> we click the inner link. but i want to fire some process when click
> the inner link. if anybody have the solution please let me know...
>
> thank you.

-- 
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 resets when I change orientation

2012-02-11 Thread Flowers
Technically, the Activity is shutdown and a new Activity is started
for the new orientation.  You can prevent orientation changes
altogether as Kris stated.

If you do switch to a full Application instead of your Activity, you
may be able to store your state outside of your activity so when the
landscape view opens it can re-open the webview more or less how it
looked before.

On Feb 8, 12:34 pm, Kristopher Micinski 
wrote:
> This is because of what happens when you change orientation.  In this case,
> your application actually gets restarted.
>
> You can read about the process a little 
> here:http://developer.android.com/guide/topics/resources/runtime-changes.html
>
> There is also a flag you can put in your manifest to force a single
> orientation:
>
> http://stackoverflow.com/questions/582185/android-disable-landscape-mode
>
> If you want to start things over again after changing orientation you can
> save some partially stateful things when the switch happens, you'll have to
> decide for yourself...
>
> kris
>
>
>
>
>
>
>
> On Wed, Feb 8, 2012 at 10:16 AM, Felipe Valdez  wrote:
> > I have a webview that shows an html page,
> > this page runsa a javascript
> > when I tilt the devce ideways, the webview resets.
>
> > this behavior is not desired
>
> > is there a way to:
>
> > a) make it so it onl works in one orientation
> > or
> > b) make it so it shows the same view contents, regadless of it's orietation
>
> > thanks in advance, this is making me pull my hair out!
>
> > --
> > Felipe Valdez
> > +(57) 312 444 2124
> > +(57) 1 4797266
>
> >  --
> > 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

-- 
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 problem with youtube video

2012-02-10 Thread drenda
Hi all,
any news about this problem?

On 2 Feb, 13:55, drenda  wrote:
> Hi John,
> I don't understand the meaning of "video needs special handling". Is
> there a tutorial or some examples that work with youtube's videos?
>
> Thanks!
>
> Best regards
>
> Daniele
>
> On 2 Feb, 10:40, John Purcell  wrote:
>
>
>
>
>
>
>
> > Danielle,
>
> > If you look at the src (android-3.2.2_r2 is what I'm looking at), it's
> > crashing in the custom view. Unless you've implemented the code I
> > mentioned before, this will be the case.
>
> > John
>
> > On Jan 31, 3:42 pm, drenda  wrote:
>
> > > Hi John,
> > > thanks for your replay.
> > > I'm usign Honeycomb on a tablet.
> > > Unfortunally the order of the loading url don't resolve the problem.
> > > I'm try with this code:
>
> > > setContentView(R.layout.video);
> > > final WebView webView = (WebView) findViewById(R.id.video_webview);
> > > webView.getSettings().setJavaScriptEnabled(true);
> > > webView.getSettings().setPluginsEnabled(true);
> > > webView.loadUrl(getString(R.string.urlYouTube));
>
> > > You can test this simple code with some video on youtube and you
> > > realize that you can see the preview image of the video but when you
> > > click on play button the video don't start!! Moreover if you click on
> > > maximise icon of the video the application crash as you can see here:
>
> > > 01-31 20:41:24.778: E/AndroidRuntime(399): FATAL EXCEPTION: main
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):
> > > java.lang.NullPointerException
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > android.webkit.HTML5VideoFullScreen.enterFullScreenVideoState(HTML5VideoFul
> > >  lScreen.java:
> > > 253)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > android.webkit.HTML5VideoViewProxy
> > > $VideoPlayer.enterFullScreenVideo(HTML5VideoViewProxy.java:161)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > android.webkit.HTML5VideoViewProxy.enterFullScreenVideo(HTML5VideoViewProxy
> > >  .java:
> > > 667)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at android.webkit.WebView
> > > $PrivateHandler.handleMessage(WebView.java:8017)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > android.os.Looper.loop(Looper.java:132)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > android.app.ActivityThread.main(ActivityThread.java:4123)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > java.lang.reflect.Method.invokeNative(Native Method)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > java.lang.reflect.Method.invoke(Method.java:491)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > com.android.internal.os.ZygoteInit
> > > $MethodAndArgsCaller.run(ZygoteInit.java:841)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
> > > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > > dalvik.system.NativeStart.main(Native Method)
>
> > > Thanks very much
>
> > > Best regards
>
> > > Daniele
>
> > > On Jan 31, 1:02 pm, John Purcell  wrote:
>
> > > > In general, the loading of the URL should come last (right now you've
> > > > got plugins and Javascript enabled messages being sent to the webcore
> > > > after you send a url request).
>
> > > > Is this on Honeycomb or ICS? (I'm guessing ICS due to the 'normal'
> > > > errors you posted above). Keep in mind that video needs special
> > > > handling in older versions of android (well, in all versions 
> > > > really).http://code.google.com/p/html5webview/willworkfor2.x, but is out
> > > > of date for 3.x/4.x
>
> > > > On Jan 30, 3:34 pm, drenda  wrote:
>
> > > > > PLease,
> > > > > someone has some ideas?
>
> > > > > Thanks!
>
> > > > > On 29 Gen, 22:38, drenda  wrote:
>
> > > > > > Hi,
> > > > > > i made a simple example in order to display in my app some youtube's
> > > > > > video of a playlist.
> > > > > > I created a WebView:
>
> > > > > > @Override
> > > > > >         public void onCreate(Bundle savedInstanceState) {
> > > > > >                 super.onCreate(savedInstanceState);
> > > > > >                 try {
> > > > > >                         setContentView(R.layout.video);
>
> > > > > >                         final WebView webView = (WebView) 
> > > > > > findViewById(R.id.video_webview);
> > > > > >                         
> > > > > > webView.loadUrl(getString(R.string.urlYouTube));
> > > > > >                         
> > > > > > webView.getSettings().setJavaScriptEnabled(true);
> > > > > >                         
> > > > > > webView.getSettings().setPluginsEnabled(true);
>
> > > > > >                 } catch (Exception e) {
> > > > > >                         Log.e("Rubner", e.getMessage());
> > > > > >                         e.printStackTrace();
> > > > > >                 }
>
> > > > > > The webview is render correctly and display th

[android-developers] Re: webview resets when I change orientation

2012-02-08 Thread JackN
Yep, you can do either. you have to manage it

On Feb 8, 7:16 am, Felipe Valdez  wrote:
> I have a webview that shows an html page,
> this page runsa a javascript
> when I tilt the devce ideways, the webview resets.
>
> this behavior is not desired
>
> is there a way to:
>
> a) make it so it onl works in one orientation
> or
> b) make it so it shows the same view contents, regadless of it's orietation
>
> thanks in advance, this is making me pull my hair out!
>
> --
> Felipe Valdez
> +(57) 312 444 2124
> +(57) 1 4797266

-- 
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 problem with youtube video

2012-02-02 Thread drenda
Hi John,
I don't understand the meaning of "video needs special handling". Is
there a tutorial or some examples that work with youtube's videos?

Thanks!

Best regards

Daniele

On 2 Feb, 10:40, John Purcell  wrote:
> Danielle,
>
> If you look at the src (android-3.2.2_r2 is what I'm looking at), it's
> crashing in the custom view. Unless you've implemented the code I
> mentioned before, this will be the case.
>
> John
>
> On Jan 31, 3:42 pm, drenda  wrote:
>
>
>
>
>
>
>
> > Hi John,
> > thanks for your replay.
> > I'm usign Honeycomb on a tablet.
> > Unfortunally the order of the loading url don't resolve the problem.
> > I'm try with this code:
>
> > setContentView(R.layout.video);
> > final WebView webView = (WebView) findViewById(R.id.video_webview);
> > webView.getSettings().setJavaScriptEnabled(true);
> > webView.getSettings().setPluginsEnabled(true);
> > webView.loadUrl(getString(R.string.urlYouTube));
>
> > You can test this simple code with some video on youtube and you
> > realize that you can see the preview image of the video but when you
> > click on play button the video don't start!! Moreover if you click on
> > maximise icon of the video the application crash as you can see here:
>
> > 01-31 20:41:24.778: E/AndroidRuntime(399): FATAL EXCEPTION: main
> > 01-31 20:41:24.778: E/AndroidRuntime(399):
> > java.lang.NullPointerException
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > android.webkit.HTML5VideoFullScreen.enterFullScreenVideoState(HTML5VideoFul 
> > lScreen.java:
> > 253)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > android.webkit.HTML5VideoViewProxy
> > $VideoPlayer.enterFullScreenVideo(HTML5VideoViewProxy.java:161)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > android.webkit.HTML5VideoViewProxy.enterFullScreenVideo(HTML5VideoViewProxy 
> > .java:
> > 667)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at android.webkit.WebView
> > $PrivateHandler.handleMessage(WebView.java:8017)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > android.os.Looper.loop(Looper.java:132)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > android.app.ActivityThread.main(ActivityThread.java:4123)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > java.lang.reflect.Method.invoke(Method.java:491)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > com.android.internal.os.ZygoteInit
> > $MethodAndArgsCaller.run(ZygoteInit.java:841)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
> > 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> > dalvik.system.NativeStart.main(Native Method)
>
> > Thanks very much
>
> > Best regards
>
> > Daniele
>
> > On Jan 31, 1:02 pm, John Purcell  wrote:
>
> > > In general, the loading of the URL should come last (right now you've
> > > got plugins and Javascript enabled messages being sent to the webcore
> > > after you send a url request).
>
> > > Is this on Honeycomb or ICS? (I'm guessing ICS due to the 'normal'
> > > errors you posted above). Keep in mind that video needs special
> > > handling in older versions of android (well, in all versions 
> > > really).http://code.google.com/p/html5webview/willworkfor 2.x, but is out
> > > of date for 3.x/4.x
>
> > > On Jan 30, 3:34 pm, drenda  wrote:
>
> > > > PLease,
> > > > someone has some ideas?
>
> > > > Thanks!
>
> > > > On 29 Gen, 22:38, drenda  wrote:
>
> > > > > Hi,
> > > > > i made a simple example in order to display in my app some youtube's
> > > > > video of a playlist.
> > > > > I created a WebView:
>
> > > > > @Override
> > > > >         public void onCreate(Bundle savedInstanceState) {
> > > > >                 super.onCreate(savedInstanceState);
> > > > >                 try {
> > > > >                         setContentView(R.layout.video);
>
> > > > >                         final WebView webView = (WebView) 
> > > > > findViewById(R.id.video_webview);
> > > > >                         
> > > > > webView.loadUrl(getString(R.string.urlYouTube));
> > > > >                         
> > > > > webView.getSettings().setJavaScriptEnabled(true);
> > > > >                         webView.getSettings().setPluginsEnabled(true);
>
> > > > >                 } catch (Exception e) {
> > > > >                         Log.e("Rubner", e.getMessage());
> > > > >                         e.printStackTrace();
> > > > >                 }
>
> > > > > The webview is render correctly and display the videos of playlist.
> > > > > When you click on a video is displayed the page of the video with play
> > > > > button  but if you click on it the video don't start!!!
>
> > > > > Are raised these errors:
>
> > > > > 01-29 22:37:28.714: W/System.err(5963): Error reading from ./org/

[android-developers] Re: WebView problem with youtube video

2012-02-02 Thread John Purcell
Danielle,

If you look at the src (android-3.2.2_r2 is what I'm looking at), it's
crashing in the custom view. Unless you've implemented the code I
mentioned before, this will be the case.

John

On Jan 31, 3:42 pm, drenda  wrote:
> Hi John,
> thanks for your replay.
> I'm usign Honeycomb on a tablet.
> Unfortunally the order of the loading url don't resolve the problem.
> I'm try with this code:
>
> setContentView(R.layout.video);
> final WebView webView = (WebView) findViewById(R.id.video_webview);
> webView.getSettings().setJavaScriptEnabled(true);
> webView.getSettings().setPluginsEnabled(true);
> webView.loadUrl(getString(R.string.urlYouTube));
>
> You can test this simple code with some video on youtube and you
> realize that you can see the preview image of the video but when you
> click on play button the video don't start!! Moreover if you click on
> maximise icon of the video the application crash as you can see here:
>
> 01-31 20:41:24.778: E/AndroidRuntime(399): FATAL EXCEPTION: main
> 01-31 20:41:24.778: E/AndroidRuntime(399):
> java.lang.NullPointerException
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> android.webkit.HTML5VideoFullScreen.enterFullScreenVideoState(HTML5VideoFul 
> lScreen.java:
> 253)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> android.webkit.HTML5VideoViewProxy
> $VideoPlayer.enterFullScreenVideo(HTML5VideoViewProxy.java:161)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> android.webkit.HTML5VideoViewProxy.enterFullScreenVideo(HTML5VideoViewProxy 
> .java:
> 667)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at android.webkit.WebView
> $PrivateHandler.handleMessage(WebView.java:8017)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> android.os.Looper.loop(Looper.java:132)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> android.app.ActivityThread.main(ActivityThread.java:4123)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> java.lang.reflect.Method.invokeNative(Native Method)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> java.lang.reflect.Method.invoke(Method.java:491)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:841)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
> 01-31 20:41:24.778: E/AndroidRuntime(399):      at
> dalvik.system.NativeStart.main(Native Method)
>
> Thanks very much
>
> Best regards
>
> Daniele
>
> On Jan 31, 1:02 pm, John Purcell  wrote:
>
>
>
>
>
>
>
> > In general, the loading of the URL should come last (right now you've
> > got plugins and Javascript enabled messages being sent to the webcore
> > after you send a url request).
>
> > Is this on Honeycomb or ICS? (I'm guessing ICS due to the 'normal'
> > errors you posted above). Keep in mind that video needs special
> > handling in older versions of android (well, in all versions 
> > really).http://code.google.com/p/html5webview/willwork for 2.x, but is out
> > of date for 3.x/4.x
>
> > On Jan 30, 3:34 pm, drenda  wrote:
>
> > > PLease,
> > > someone has some ideas?
>
> > > Thanks!
>
> > > On 29 Gen, 22:38, drenda  wrote:
>
> > > > Hi,
> > > > i made a simple example in order to display in my app some youtube's
> > > > video of a playlist.
> > > > I created a WebView:
>
> > > > @Override
> > > >         public void onCreate(Bundle savedInstanceState) {
> > > >                 super.onCreate(savedInstanceState);
> > > >                 try {
> > > >                         setContentView(R.layout.video);
>
> > > >                         final WebView webView = (WebView) 
> > > > findViewById(R.id.video_webview);
> > > >                         webView.loadUrl(getString(R.string.urlYouTube));
> > > >                         
> > > > webView.getSettings().setJavaScriptEnabled(true);
> > > >                         webView.getSettings().setPluginsEnabled(true);
>
> > > >                 } catch (Exception e) {
> > > >                         Log.e("Rubner", e.getMessage());
> > > >                         e.printStackTrace();
> > > >                 }
>
> > > > The webview is render correctly and display the videos of playlist.
> > > > When you click on a video is displayed the page of the video with play
> > > > button  but if you click on it the video don't start!!!
>
> > > > Are raised these errors:
>
> > > > 01-29 22:37:28.714: W/System.err(5963): Error reading from ./org/
> > > > apache/harmony/luni/internal/net/www/protocol/data/Handler.class
> > > > 01-29 22:37:28.934: E/libEGL(5963): call to OpenGL ES API with no
> > > > current context (logged once per thread)
> > > > 01-29 22:37:28.934: D/ShaderProgram(5963): couldn't load the vertex
> > > > shader!
>
> > > > Any ideas of the problem??
>
> > > > Thanks

-- 
You received this message because you are subscribed to the Google
Group

[android-developers] Re: WebView using Assets

2012-01-31 Thread atcal
Thanks. It was the form of URL I was missing.

On Jan 31, 1:19 pm, Mark Murphy  wrote:
> On Tue, Jan 31, 2012 at 5:31 AM, atcal  wrote:
> > I'd like to use html (with images, btw) to provide documentation for
> > my app. I thought to store my documentation pages in assets and use
> > webview but I cannot find a way to link the webview to the assets.
> > Does anyone know if this is possible?
>
> webView.loadUrl("file:///android_asset/path/to/your/file.html") works fine.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.7 Available!

-- 
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 problem with youtube video

2012-01-31 Thread drenda
Hi John,
thanks for your replay.
I'm usign Honeycomb on a tablet.
Unfortunally the order of the loading url don't resolve the problem.
I'm try with this code:

setContentView(R.layout.video);
final WebView webView = (WebView) findViewById(R.id.video_webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginsEnabled(true);
webView.loadUrl(getString(R.string.urlYouTube));

You can test this simple code with some video on youtube and you
realize that you can see the preview image of the video but when you
click on play button the video don't start!! Moreover if you click on
maximise icon of the video the application crash as you can see here:

01-31 20:41:24.778: E/AndroidRuntime(399): FATAL EXCEPTION: main
01-31 20:41:24.778: E/AndroidRuntime(399):
java.lang.NullPointerException
01-31 20:41:24.778: E/AndroidRuntime(399):  at
android.webkit.HTML5VideoFullScreen.enterFullScreenVideoState(HTML5VideoFullScreen.java:
253)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
android.webkit.HTML5VideoViewProxy
$VideoPlayer.enterFullScreenVideo(HTML5VideoViewProxy.java:161)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
android.webkit.HTML5VideoViewProxy.enterFullScreenVideo(HTML5VideoViewProxy.java:
667)
01-31 20:41:24.778: E/AndroidRuntime(399):  at android.webkit.WebView
$PrivateHandler.handleMessage(WebView.java:8017)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
android.os.Handler.dispatchMessage(Handler.java:99)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
android.os.Looper.loop(Looper.java:132)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
android.app.ActivityThread.main(ActivityThread.java:4123)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
java.lang.reflect.Method.invokeNative(Native Method)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
java.lang.reflect.Method.invoke(Method.java:491)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
01-31 20:41:24.778: E/AndroidRuntime(399):  at
dalvik.system.NativeStart.main(Native Method)


Thanks very much

Best regards

Daniele

On Jan 31, 1:02 pm, John Purcell  wrote:
> In general, the loading of the URL should come last (right now you've
> got plugins and Javascript enabled messages being sent to the webcore
> after you send a url request).
>
> Is this on Honeycomb or ICS? (I'm guessing ICS due to the 'normal'
> errors you posted above). Keep in mind that video needs special
> handling in older versions of android (well, in all versions 
> really).http://code.google.com/p/html5webview/will work for 2.x, but is out
> of date for 3.x/4.x
>
> On Jan 30, 3:34 pm, drenda  wrote:
>
>
>
>
>
>
>
> > PLease,
> > someone has some ideas?
>
> > Thanks!
>
> > On 29 Gen, 22:38, drenda  wrote:
>
> > > Hi,
> > > i made a simple example in order to display in my app some youtube's
> > > video of a playlist.
> > > I created a WebView:
>
> > > @Override
> > >         public void onCreate(Bundle savedInstanceState) {
> > >                 super.onCreate(savedInstanceState);
> > >                 try {
> > >                         setContentView(R.layout.video);
>
> > >                         final WebView webView = (WebView) 
> > > findViewById(R.id.video_webview);
> > >                         webView.loadUrl(getString(R.string.urlYouTube));
> > >                         webView.getSettings().setJavaScriptEnabled(true);
> > >                         webView.getSettings().setPluginsEnabled(true);
>
> > >                 } catch (Exception e) {
> > >                         Log.e("Rubner", e.getMessage());
> > >                         e.printStackTrace();
> > >                 }
>
> > > The webview is render correctly and display the videos of playlist.
> > > When you click on a video is displayed the page of the video with play
> > > button  but if you click on it the video don't start!!!
>
> > > Are raised these errors:
>
> > > 01-29 22:37:28.714: W/System.err(5963): Error reading from ./org/
> > > apache/harmony/luni/internal/net/www/protocol/data/Handler.class
> > > 01-29 22:37:28.934: E/libEGL(5963): call to OpenGL ES API with no
> > > current context (logged once per thread)
> > > 01-29 22:37:28.934: D/ShaderProgram(5963): couldn't load the vertex
> > > shader!
>
> > > Any ideas of the problem??
>
> > > Thanks

-- 
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 problem with youtube video

2012-01-31 Thread John Purcell
In general, the loading of the URL should come last (right now you've
got plugins and Javascript enabled messages being sent to the webcore
after you send a url request).

Is this on Honeycomb or ICS? (I'm guessing ICS due to the 'normal'
errors you posted above). Keep in mind that video needs special
handling in older versions of android (well, in all versions really).
http://code.google.com/p/html5webview/ will work for 2.x, but is out
of date for 3.x/4.x

On Jan 30, 3:34 pm, drenda  wrote:
> PLease,
> someone has some ideas?
>
> Thanks!
>
> On 29 Gen, 22:38, drenda  wrote:
>
>
>
>
>
>
>
> > Hi,
> > i made a simple example in order to display in my app some youtube's
> > video of a playlist.
> > I created a WebView:
>
> > @Override
> >         public void onCreate(Bundle savedInstanceState) {
> >                 super.onCreate(savedInstanceState);
> >                 try {
> >                         setContentView(R.layout.video);
>
> >                         final WebView webView = (WebView) 
> > findViewById(R.id.video_webview);
> >                         webView.loadUrl(getString(R.string.urlYouTube));
> >                         webView.getSettings().setJavaScriptEnabled(true);
> >                         webView.getSettings().setPluginsEnabled(true);
>
> >                 } catch (Exception e) {
> >                         Log.e("Rubner", e.getMessage());
> >                         e.printStackTrace();
> >                 }
>
> > The webview is render correctly and display the videos of playlist.
> > When you click on a video is displayed the page of the video with play
> > button  but if you click on it the video don't start!!!
>
> > Are raised these errors:
>
> > 01-29 22:37:28.714: W/System.err(5963): Error reading from ./org/
> > apache/harmony/luni/internal/net/www/protocol/data/Handler.class
> > 01-29 22:37:28.934: E/libEGL(5963): call to OpenGL ES API with no
> > current context (logged once per thread)
> > 01-29 22:37:28.934: D/ShaderProgram(5963): couldn't load the vertex
> > shader!
>
> > Any ideas of the problem??
>
> > Thanks

-- 
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 using Assets

2012-01-31 Thread arnouf
You have to use loadData applied on webview and you can retrieve your 
assets using getAssetManager

-- 
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 problem with youtube video

2012-01-30 Thread drenda
PLease,
someone has some ideas?

Thanks!

On 29 Gen, 22:38, drenda  wrote:
> Hi,
> i made a simple example in order to display in my app some youtube's
> video of a playlist.
> I created a WebView:
>
> @Override
>         public void onCreate(Bundle savedInstanceState) {
>                 super.onCreate(savedInstanceState);
>                 try {
>                         setContentView(R.layout.video);
>
>                         final WebView webView = (WebView) 
> findViewById(R.id.video_webview);
>                         webView.loadUrl(getString(R.string.urlYouTube));
>                         webView.getSettings().setJavaScriptEnabled(true);
>                         webView.getSettings().setPluginsEnabled(true);
>
>                 } catch (Exception e) {
>                         Log.e("Rubner", e.getMessage());
>                         e.printStackTrace();
>                 }
>
> The webview is render correctly and display the videos of playlist.
> When you click on a video is displayed the page of the video with play
> button  but if you click on it the video don't start!!!
>
> Are raised these errors:
>
> 01-29 22:37:28.714: W/System.err(5963): Error reading from ./org/
> apache/harmony/luni/internal/net/www/protocol/data/Handler.class
> 01-29 22:37:28.934: E/libEGL(5963): call to OpenGL ES API with no
> current context (logged once per thread)
> 01-29 22:37:28.934: D/ShaderProgram(5963): couldn't load the vertex
> shader!
>
> Any ideas of the problem??
>
> Thanks

-- 
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


Re: [android-developers] Re: WebView ignore Javascript that invokes PUT/DELETE Http method

2012-01-17 Thread Daniel Drozdzewski
...or look at cash control on the server side:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9





On 17 January 2012 13:38, Mark Murphy  wrote:
> You might look at setCacheMode() on WebSettings, if caching seems to
> be your issue.
>
> On Tue, Jan 17, 2012 at 8:35 AM, Ori Harel  wrote:
>> Those are not part of Android, but the problem exist only in Android
>> WebView.
>> Anyway, I solved it by forcing the WebView to ignore the cache by:
>>
>>
>>     $.ajax({
>>                 type: methode,
>>                 url: 'some_url?d' + new Date().getTime(),
>>                 data: JSON.stringify(req),
>>           });
>>
>> As you can see I added a new Date() object creation in order to overcome
>> that caching mechanism.
>>
>> --
>> 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
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.7 Available!
>
> --
> 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



-- 
Daniel Drozdzewski

-- 
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


Re: [android-developers] Re: WebView ignore Javascript that invokes PUT/DELETE Http method

2012-01-17 Thread Mark Murphy
You might look at setCacheMode() on WebSettings, if caching seems to
be your issue.

On Tue, Jan 17, 2012 at 8:35 AM, Ori Harel  wrote:
> Those are not part of Android, but the problem exist only in Android
> WebView.
> Anyway, I solved it by forcing the WebView to ignore the cache by:
>
>
>     $.ajax({
>                 type: methode,
>                 url: 'some_url?d' + new Date().getTime(),
>                 data: JSON.stringify(req),
>           });
>
> As you can see I added a new Date() object creation in order to overcome
> that caching mechanism.
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.7 Available!

-- 
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 ignore Javascript that invokes PUT/DELETE Http method

2012-01-17 Thread Ori Harel
Those are not part of Android, but the problem exist only in Android 
WebView.
Anyway, I solved it by forcing the WebView to ignore the cache by:


$.ajax({
type: methode,
url: 'some_url?d' + new Date().getTime(),
data: JSON.stringify(req),
  });

As you can see I added a new Date() object creation in order to overcome 
that caching mechanism.

-- 
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

Re: [android-developers] Re: WebView ignore Javascript that invokes PUT/DELETE Http method

2012-01-17 Thread Mark Murphy
AFAIK, $.ajax is not part of Android. It is part of some JavaScript
library that you are using (e.g., jQuery). Please ask the authors of
that library what the requirements are of the browser to support
PUT/DELETE operations.

On Tue, Jan 17, 2012 at 5:12 AM, Ori Harel  wrote:
> Also, here's the JS code inside the WebView:
>
> var req = new Backbone.Model(auth);
>
> $.ajax({
>             type: PUT,
>             url: 'some_url',
>             data: JSON.stringify(req)
>         });
>
> --
> 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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.7 Available!

-- 
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 ignore Javascript that invokes PUT/DELETE Http method

2012-01-17 Thread Ori Harel
Also, here's the JS code inside the WebView:

var req = new Backbone.Model(auth);

$.ajax({
type: PUT,
url: 'some_url',
data: JSON.stringify(req)
});

-- 
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 ignore Javascript that invokes PUT/DELETE Http method

2012-01-17 Thread Ori Harel
I just tested on ICS emulator and it works there. why is it not working on 
earlier versions?

-- 
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

Re: [android-developers] Re: WebView lost JavaScript update contents after called goBack()

2011-12-07 Thread bhaskar bommala
Hi,

I want to enable javascript using method webview.loaddatawithbaseURL();
webView.loadDataWithBaseURL("", webData, "",  "UTF-8", "");  can anyone
help me on this

On Thu, Nov 24, 2011 at 4:19 PM, alex  wrote:

> seems the page was reloaded after call goBack(), is there any way to
> prevent reload page after call goBack() ???
>
> On 11月18日, 下午6时23分, alex  wrote:
> > I have a problem that when I click back button on a WebView, my
> > previous page losts all contents updated by JavaScript.
> >
> > My steps in WebView was below:
> > - after Main page loaded, JavaScript starts update contents, like
> > refresh shoppings with links;
> > - user will see some shopping lists after updated;
> > - then user click each link will load new url in same WebView;
> > - user click back to Main page;
> >
> > the problem is when user back to Main page, user cannot see any
> > shopping updated by JavaScript, they were gone!
> > I tried my page on IE and FF, both works fine, but had problem on
> > Android WebView. I'm not sure this issue caused by I'm not set some
> > settings correctly or other issues.
> >
> > My sample code as below:
> >
> > // set settings for webview
> > WebSettings webSettings = web.getSettings();
> > webSettings.setBuiltInZoomControls(true);
> > webSettings.setJavaScriptEnabled(true);
> > webSettings.setUseWideViewPort(true);
> > webSettings.setDomStorageEnabled(true);
> > webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
> >
> > // call JavaScript to update shoppings
> > webView.loadUrl("javascript:addShoppings(" + str + ");");
> >
> > // add interface for callback
> > webView.addJavascriptInterface(new
> > BusinessJavaScriptInterface(), "business");
> >
> > final class BusinessJavaScriptInterface
> > {
> > public void businessListReceived()
> > {
> > ... ...
> > }
> >
> > }
> >
> > // handle back key event
> > public boolean onKeyDown(int keyCode, KeyEvent event)
> > {
> > WebView web = (WebView) this.findViewById(R.id.browser);
> > if (web != null)
> > {
> > if ((keyCode == KeyEvent.KEYCODE_BACK) && web.canGoBack())
> > {
> > web.goBack();
> > return true;
> > }
> > return super.onKeyDown(keyCode, event);
> > }
> > return false;
> > }
>
> --
> 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
>

-- 
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 Polling... Multiple Instances.... Need Some Advice

2011-12-03 Thread Doug
> I would like the exit button to completely kill the app off.

Android decides when to fully terminate the app process, not the
developer.  This is just the way things work -- Google it.

> The bigger problem then, is that the next time I launch the app, there are
> now two threads of ajax polling, which is breaking my application.
>
> I have my app set to launch in single instance mode (which is required).
>
> What is the best thing to do here?

Stop whatever needs stopping in the hosting activity's onStop() method
which is invoked whenever that activity is no longer visible to the
user and start it again on onStart().

Doug

-- 
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


  1   2   3   4   5   6   >