Android :: How To Run Local Web App In Phone Webview?
Aug 5, 2010Can anybody tell how to run the local webapplication using android webview. I want to run my own webpages in android using web view.
View 2 RepliesCan anybody tell how to run the local webapplication using android webview. I want to run my own webpages in android using web view.
View 2 RepliesI am trying to create a hybrid Android app which pulls HTML content from a web server and renders it in a WebView. However, I also want the external HTML to be able to reference images that are packaged within the android app. I realize that currently it is not possible to do something like <img src="file:///my_image.jpg" /> in the HTML. I have seen discussions of using the ContentProvider to create name spaces in the html, however all of these examples seem to assume that the actual html page is also on the device and tend to use WebView.loadData(). So, is there someway that it is possible to do this? The main goal is to package all the application images/css in the android app, but put the bulk of the application on an external server that returns the actual markup.
I thought it might be interesting to some developers. Here's a complete working example of ContentProvider for this purpose: http://blog.tourizo.com/2009/02/how-to-display-local-file-in-android. I also found a topic here: http://groups.google.com/group/android-developers/browse_thread/threa. Looks like the topic was closed and I couldn't reply there, so I created new one.
View 2 Replies View RelatedI am developing a small application in Android. I come across a problem, and not sure whether it is possible in Android platform. I have some local html files. There is an Activity contains a webview, which is used to display these local html files. In some cases, I want to display a picture selected from phone into one of these local html files. Is it possible? Has anyone resolved such problem? I appreciate any of your replies.
View 2 Replies View RelatedI have a WebView that I'm using to open some files stored in the assets/ directory of my project. It works fine for most of the files, but there's one in particular (and I'm sure others I haven't found) that it just will not open.Code...
View 4 Replies View RelatedHow do I open a a local html-page (named, for instance "test.html") in a WebView? where should i keep this keep html page with images in project and how to use Webview.loadUrl(String url)?
View 4 Replies View Relatedwhen I load external web page, image or javascript file from local webpage. I can't see external image and can't load javascript or webpage. But I can only see local image. Why I can't load external javascript, webpage or image? Here is the HTML source. (of course, I filled right [daum open API key])
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta
http-equiv ="Content-Type" content="text/html;
charset=UTF-8"> <title>Daum 지도 API</title>
<script type="text/javascript"
src="http://apis.daum.net/maps/maps.js?
apikey=[daum open API key]" charset="utf-8"></script> </head> <body>
<div id="map" style="width:600px;
height:400px;
" style="border:1px solid #000">
</div> <img src="http://4.bp.blogspot.com/_2-7AdSkZA7I/RlCnDhD3ZfI/ AAAAAAAAE9U/LEHMtyVLdY8/s400/CutyTale10.jpg">
<img src="file:///android_asset/coffeebean.jpg">
<script type="text/javascript">
var map = new DMap("map", {point:new DLatLng(37.48879895934866, 127.03130020103005), level:2} );
</script> <iframe src="http://www.daum.com" width="300" height="150"></iframe> </body> </html>
and I use this Activity source
package bo.my.android.test;
import android.app.Activity;
import android.os.Bundle; import android.webkit.WebView;
public class OpenAPITest extends Activity {
WebView webView;
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webView = (WebView) findViewById(R.id.webView1);
webView.setWebViewClient(new DaumMapClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/daummap.html");
//webView.loadUrl("http://www.daum.net");
} }
I'm thinking of using WebView as a container for "Form" based JavaScript+DHTML applications. This is simple fill-out-forms like you have on the web, but now on mobile like for note taking, order taking, and the like.This is to allow web developers to build the bulk of the application - Javascript will perform validation, computations, etc.On the Java side, I only need to implement database CRUD operations, and a ListView to scroll over the forms.To minimize the learning curve on the JavaScript side, I've been thinking on how to emulate AJAX calls so that the web developers don't need to learn new methods to call on the JavaScript-Java bridge. Of course this isn't possible using XMLHttpRequest, so I'm thinking of adapting JQuery or other Javascript libraries for this purpose.
View 3 Replies View RelatedI guess webview is the best solution to play a local swf-file (flash). I just get cryptic character in the emulator with this html code in webview.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Flash</title>
</head>
[URL]
How can i play a local swf-file when the user click on some kind of link, java or html?
When trying to play a local mp3 file included in the APK, nothing happens. However, if I pull an mp3 from the web it works.
e.g.
< a u d i o src="[URL]..." > WORKS
< a u d i o src="01.mp3" > DOES NOT WORK
I tried looking through logs for clues and found this line. I'm not sure if it's relevant or not.
PlayerDriver::isProtectedFile(file:///android_asset/www/01.mp3)
I'm new to Android development, so I can only guess that the file is somehow inaccessible for streaming.
I'd love to get this figured out though. Having to pull the files remotely every time is not a desirable solution.
Some additional info. Either solution works when tested in the browser. The local file problem only arises when I convert it to an app. I'm using PhoneGap build to create the APK.
I published an application that stores data in a local database.
Now I have to publish an update to this application to fix some little bugs, but I am afraid that downloading and installing the update will delate the local database associated with the previous version.
I would like to know how the update system works. Will installing an update completely delete all the apk, files, databases associeted with the previous version?
If so, how can I avoid this in my code?
I'm trying to read some local files, and ive been reading a lot of stuff about it, but i still don't know where to store the files on my phone and how to get the right path. Some say, it should be stored on /data/data/your.package.here/files but where is that, i mean i can get there when using the emulator but i have no clue how to put files in this on a real device.
View 7 Replies View RelatedNokia had a neat app that would show local events of all kinds (art galleries updates, concerts, weather, festivals, movies, etc) based on your location based on manual zip code input or GPS usage. Is there anything like that for Android? Its really useful if you're traveling a lot.
View 8 Replies View RelatedI'm using CM9, but I tried different ICS roms and I encounter this problem with all of them.
- I'm trying to add a local phone (non gmail) contact to my phone, but it doesn't let me do that. When I add a new contact, a message box pops up saying, that: "Your new contact will be synchronized with <my gmail account>". How to add a local phone (not a SIM card) number?
- I have a backup of all my local phone numbers from GB made with MyPhoneExplorer, and restoring it works when I'm on ICS. The contacts are shown as local phone contacts (PCSC). However, after restarting the phone and waiting a few minutes, all the local contacts are completely gone. MyPhoneExplorer confirms that there are no contacts in the phone either. What's going on?
I really do not want to sync my contacts with google. Looking forward to hearing some answers!
Does anyone know know how to programatically get the local date and time of the Android device? With that local date and time, does anyone know how to convert that to milliseconds from 1970 in UTC time?
View 2 Replies View RelatedI'd like to connect to a local tomcat dev server on my laptop and use my android phone connected via a usb cable to debug things.Is this possible? Do I need to use wifi to make this happen?
View 2 Replies View RelatedCurrent configuration Use Android emulator and GAE tools (to access local GAE service I set uri http://10.0.2.2:8888/XXX and it works.I would like to use Android device(phone) via USB to call web service running on connected "local" computer.What is best configuration practice ((I don't have static IP) I am using mac and linux)?
View 1 Replies View RelatedSo kind of weird, but when I try and dial a 7 digit local phone number, the phone prepends it with an area code for Boston (I am in St. Louis).
Sprint was pretty helpless on the issue and I guess it did not help that the phone just started doing it without rhyme or reason.
Not a huge deal since I can dial the area code before hand, but obviously I am sure none of us like things going wrong with our precious Evo's.
Having some problems with a pop email account - have set up so that it will receive ok but when I try and send I get the message "non local ip cannot send from this phone.
View 2 Replies View RelatedLooking for a tip here.
How do you look up a local phone number (for calling) or address (for nav).
I have tried Yellow Pages, magnifying glass (search), and a few other apps but nothing is working great for finding the closest Pizza Hut for example (had a gift certificate). What do you use?
I have a sprint htc hero, which i successfully rooted. My father, has been looking into rooting. physically he has the exact same phone as i do, make model, appearance, but it's from a local carrier in his area, ntelos. i've been searching forums and it doesn't seem to be recognized anywhere, so does anybody have any suggestions?
View 1 Replies View RelatedHow can I cancel a loading operation in WebView started by loadData() method?
View 1 Replies View Relatedin current email, phone number can be clickable now, I want to customerize the phone number format, So, May I ask how webview recognize a phone number? Anybody knows where the code is in current android code?
View 2 Replies View RelatedI've got a WebView, and in its content is a phone number. I hightlight it and click - voila, taken to the phone app.
Now, all I do is add this code:
CODE:........
clicks no longer work.
If a page has a URL or a phone number on it that isn't a link is there any way to have WebView recognize it and automatically turn it into a link like you can with TextViews?
With a TextView you would simply set the android:autoLink to the desired settings:
<TextView
android:autoLink="web|phone"
... />
but I can't find any equivalent for WebView.
I have a webview that is loading a page from the Internet. I want to show a progressbar until the loading is complete. How do I listen for the completion of page loading of a WebView?
View 4 Replies View RelatedI have a big problem and i did not find a solution for my problem. I try to load an url and i use this tutorial: http://developer.android.com/reference/android/webkit/WebView.html. My Code...
View 1 Replies View RelatedI use loadData method to load some html content into a webview, but when it encounters something like this. And if I'm not mistaken, this should also display the picture. Code...
View 1 Replies View RelatedI've been banging my head against a wall this afternoon trying to get a WebView to work. Below is the code in the main class:
public class fkyougoogle extends Activity {
/** Called when the activity is first created. */
WebView webview;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
// WORKS
//webview.loadUrl("http://www.google.com");
// DOESN'T WORK
//webview.loadUrl("http://www.theregister.co.uk");
//webview.loadData("<html><body>hello</body></html>", "text/html", "utf-8");
//webview.loadDataWithBaseURL("fake://", "<html><body>hello</body></html>", "text/html", "utf-8", "http://www.theregister.co.uk/");}}
This is Google's "Hello, Webview" example. If I use a WebView and try to access www.google.com then it works fine. If I try to access any other site then it fails including loadData and it just displays a black screen in the emulator. In the end I would like to read from a local file.
is included under the manifest tag and the XML schema is the same as the Hello Webview example.
Am I missing something obvious here?
How do you disable all touch events in an Android WebView (or scrolling in particular)? I would like the activity to handle all touch events.
View 2 Replies View Related