webview does not show all content - android

I need to load url in webView - http://intor.club/files/comments.php?serial=56
I can not see in the webView that I see in the browser. Mobile browser works.
JavaScript is on. Help me! Thank you!
mWebView = (WebView) rootView.findViewById(R.id.webView);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://intor.club/files/comments.php?serial=56");

First make sure you xml file you showing your webview like that
width fill parent and height also
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
don't forget your internet permission in AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
it should work know
i test it myself
when i comment javascript enable i got this
//wbeview.getSettings().setJavaScriptEnabled(true);
when i enable java Script i get this (there are no comment in this thread)
i see you want access comment , may be you not authorized to access it.
Things you should try :-
1- try connect your facebook or any other connection to this site and access this link again .
2- try connect to main Page it will work "http://intor.club/ "

Related

Setting Link To Open In App

I am developing an Android application which uses WebView, and I would like to open a link in the app. The problem I have come across is that each of our customers use a different URL and is set via a preference in the android application. From, what I understand you have to set a link in the android manifest. Is this still achievable to have a link open in the application?
In order to open a link in the app just make sure to have an Activity that has a WebView on its layout. Then, in your activity do something like this:
WebView webview = (WebView) findViewById(R.id.your_web_view);
webview.loadUrl("http://your.url/");
Just read the user preference that stores the URL before calling loadUrl() and you're all set
You need to add a webview and give it an id. And then do this in your code:
//Identify the webview
WebView web_view = (WebView)findViewById(R.id.web_view);
//start web client
web_view.setWebViewClient(new WebViewClient());
//Load URL
web_view.loadUrl("your url");
And don't forget to add this line in your AndroidManifest.xml file :
<uses-permission android:name="android.permission.INTERNET" />
Hope it works!! :)

Simple Android activity for displaying Facebook timeline?

I am writing an Android App for a charity, and would like to be able to display the charity's facebook feed within the App. I don't want it to go through the phone's web browser, nor the facebook app.
I read on the developers.facebook.com how to add facebook's android sdk to the app's build gradle. But what I can't find is code for a simple android activity that will display the facebook timeline. I don't have time to dive deep into facebook's sdk to fiigure it out. And the last thing I want to do is reinvent the wheel.
Can anyone point me towards some code for a simple activity to display a facebook timeline? Any help will be greatly appreciated.
I'm not home so I can't test this right now but it should work.
In your layout file, put a webview like so:
<WebView
android:id="#+id/mWebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Then in the onCreate method:
WebView mWebView = (WebView) findViewById(R.id.mWebView);
WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
mWebView.loadUrl("http://LinkToFacebookPage.com/");
And finally, in your manifest file put the following permission before < Application >
<uses-permission android:name="android.permission.INTERNET" />

errors for simple webview app in android studio

i try to make a simple webview app for this interactive map: http://gta5online.com/map/interactive > there is also a fullscreen link below the map.
now i created an asset folder and included the "interactive" folder which has all the files, icons, map tiles and html document in it.
i want to load the html document from there into a activity as a webview. so its a local file. i want the app to handle it not the default browser.
here is what i did by now:
i created a new project and added those codes into the activity_home.xml file:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("file:///android_asset/interactive/map.html");
/>
then i added this code to enable internet access in to manifest even if its a local html doc that i want to load (for later uses):
<uses-permission android:name="android.permission.INTERNET"/>
i also enabled javascript at the first code block as you can see.
should i've put some code into the home.java file too?
in a YT tutorial i saw that he used something like this in the java file:
#in mainactivity.java
setContentView(R.layout.activity_main);
String url ="file:///android_asset/interactive/map.html";
WebView view=(WebView) this.findViewById(R.id.webView);
view.getSettings() .setJavaScriptEnabled(true);
view.loadUrl(url);
can someone please help a noob to achieve this by explaining what i did wrong and simple steps how to complete this app?. i'm sure its simple for you guys even if its that hard for me.
Be very careful in Android, you can never place Java code into XML code.
This code:
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
myWebView.loadUrl("file:///android_asset/interactive/map.html");
webSettings.setJavaScriptEnabled(true);
In your activity_home.xml file must be only this:
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
This is due to same origin policy violation, you need to use loaddatawithurl
Read
http://developer.android.com/reference/android/webkit/WebView.html
and
https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

simplest way to load android webview

what is the simplest way to load android webview?
I have already specified webview in the activity layout, how can i load a website on it while running the emulator. I have had many problems with resources not identified and the main_activity.out.xml files have been giving me troubles. A simple webview to load a webpage would be nice.
...
<WebView
android:id="#+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
You are getting main_activity.out.xml because you are trying to compile Xml files (main_activity.out.xml have the focus and you clicked run). In general if this error happens you have to
Delete the xxx.out.xml
Open any .java file in src/ by double click in the file so it has focus and the cursor is in there
Run your project and everything should be OK now
to load WebView you have to declare your webview component in your xml
<WebView
android:id="#+id/myWebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
and then in your activity in onCreate() method call
// get reference to your view
WebView webview = (WebView)findViewById(R.id.myWebView);
// load your WebView content
webview.loadUrl("http://google.com/");
Simplest way?
Get access to WebView via
WebView webview = (WebView)findViewById(R.id.webView1);
webview.loadUrl("http://stackoverflow.com/");
Greets
Flo
main_activity.out.xml has been created maybe beacuse you pressed the run button on Eclipse while your main_activity.xml was opened. Eclipse tryed to compile your xml and not your application.
To do that right, try to select the reference of your application inside the project explorer on the left and then click the Run button.
In order to manage at best the webview in your android project, just read the documentation:
http://developer.android.com/guide/webapps/webview.html

Google place page is not shown in Android webview

I am trying to show
http://www.google.co.jp/m/place#ipd:mode=home
website thru WebView in Android emulator but I am not seeing the web
site and seeing only blank space under the place tag of the page.
I am able to see other sites like www.google.com.
Do I need to enable more settings for the google place page?
Permission in the manifest
<uses-permission android:name="android.permission.INTERNET" />
Code
WebView view= (WebView) findViewById(R.id.view1);
View.getSettings().setJavaScriptEnabled(true);
View.getSettings().setBuiltInZoomControls(true);
View.getSettings().setSupportZoom(true);
View.loadUrl(" http://www.google.co.jp/m/place#ipd:mode=home");
You need to do
view.getSettings().setAppCacheEnabled(true);
view.getSettings().setDomStorageEnabled(true);
on the setting object. That fixed the problem for me.

Categories

Resources