Android : Load A Local KML / KMZ File To A MapView?
Jan 13, 2010
How can i load a local (on my HD) KML or KMZ file to the android application? I know that these lines do the work:
Intent mapIntent = new Intent(Intent.ACTION_VIEW); Uri uri1 = Uri.parse("geo:0,0?q=http://code.google.com/apis/kml/ documentation/KML_Samples.kml"); mapIntent.setData(uri1); startActivity(Intent.createChooser(mapIntent, "Sample"));
BUT, if I download the KML_Samples.kml and put it on my local apache server, it doesn't work. Another thing, can I load a kmz file to my application?
View 4 Replies
Nov 12, 2009
I am having File which contains Hebrew Content.. How to load that file.. I tried by using
webview .loadUrl("file:///android_asset/abc.htm") but it won't works.. Some garbage content was there.
View 2 Replies
View Related
Apr 6, 2009
Can one use an Android phone to access basically local (think intranet for example) web servers to view pages? I ask this question because some cell phones with some phone network appear to use a special server to funnel cell phone requests thru and that the server offloads from the browser part of what a browser normally does. I get the impression that the Opera mobile browser works this way.I want to talk to local devices that serve web pages and connect directly to them from phones. Does the Chrome browser in Android have the full functionality that Chrome has on a PC? Can it parse HTML, do XMLHttpRequest, and otherwise act like a modern browser?
View 2 Replies
View Related
Sep 6, 2010
How to play video present in local file system (ex:in res/a.3gp) using VideoView .I am getting error as Video cant be played.Can any one help me in sorting out this issue?
View 2 Replies
View Related
Jun 11, 2010
I am trying to overlay route data in KML files on a MapView.
The following code works great:
CODE:................
The only problem I have with this is that I don't need to re download these KML files every time. I have about 10-15 KML files that will rarely change. Also since it has to connect, download, and parse these each time there is a delay in opening the maps.
It would make a lot more since for me to save these as a local resource and have the URI reference it there. Is there a way to construct a URI using the geo: scheme and have it point towards a local resource?
It looks like file:///sdcard support was included in 2.1. The only reference I could find to it was at the end of this bug report thread. I am currently at work and don't have time to play with this yet but I would like to figure it out later. I feel like there are a lot of people on stackoverflow and elsewhere who would really appreciate a reasonable way to do this.
View 1 Replies
View Related
Aug 13, 2010
the question i have is simple but hard to put in words, ill give it a try anyways.i am trying to load a web page in web view,however the load time is a little high.is there anyway i can put the images in the assets folder and load them from there instead?if not, is there a way i can load the whole site from the assets folder, providing that my php files can still communicate with my internet database?i have already read most tutorials however they are pretty vague when it comes to concrete help.
View 2 Replies
View Related
Jul 1, 2009
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 Related
Jul 26, 2010
All of the android examples for XmlPullParser pull from a local resource file, and all of the SAX examples pull the XML from a URL. I've been told SAX is faster, so I'm trying to use that to pull data from a local resource file (res/xml/thefile.xml)
The example code I'm working off of is here. So in that example, the code I want to change is:
URL url = new URL("http://example.com/example.xml");
...
xr.parse(new InputSource(url.openStream()));
Instead of using URL, I want to use getXml(R.xml.thefile)
Is that possible, or does SAX need to get data from a URL?
View 1 Replies
View Related
Nov 27, 2009
I'm trying to get a byte array of an image saved locally on the phone. I'm using the code...
How can I get the Bytes?
View 1 Replies
View Related
May 30, 2012
Using Local XML file as a database for a android app?
I am trying to build a app with flash using a xml file as database, to read the xml from a external file from the local directory isn't a problem, the problem is how to write data from flash to the xml file.
View 1 Replies
View Related
Nov 24, 2010
How can I read an XML file and then take over the individual items as markers in an overlay.
Here is an example of my XML files.
CODE:...............
I'm still a newbie in Java / Android but nowhere can I find a guide.
View 1 Replies
View Related
Nov 8, 2010
I don't want to store said file on the sdcard in this case. The file also cannot be storage directly in the apps local files directory. It needs to be in a subdirectory, so it cannot write the file using openFileOutput() and MODE_WORLD_READABLE.
The app may download files small files like pdfs and store them locally in a subdirectory. I would like to be able to have the user open these files if they have an app that can open them.
For example here is an intent for sending a pdf:
CODE:..............
path being something like: /data/data/packagename/files/subdir/example.pdf
That intent will open a pdf viewer, but the viewer is unable to open the file. I assume this is a permissions issue. I tried Mark Murphy's suggestion here: http://groups.google.com/group/android-developers/browse_thread/thread/4e55d869213483a9/b7270078ac1a2744?lnk=raot of using Runtime.getRuntime().exec("chmod 755 " + fileName); but it didn't make any difference. He also suggested a Content Provider but I would like to avoid it if I can because it seems like a lot just to get this file over to another app.
If the content provider is the only option, do I have to save the file to the content provider or can I just use the content provider as a pass through to get it to the other app when I need to?
View 2 Replies
View Related
Feb 28, 2009
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 Related
Apr 28, 2010
Can anyone tell me how to parse a local xml file stored in the system using SAX ,with an example code.please also tell me where can i find information on that
View 2 Replies
View Related
Sep 29, 2010
This should be very simple, but I can't find the answer anywhere. How do I load an html file (which I assume I keep in res/raw folder) into a webview?
neither mWebView.loadUrl("file:///raw/about");
or
mWebView.loadUrl("file:///raw/about.htmal");
works.
What's the correct syntax or arrangement.
View 3 Replies
View Related
Nov 2, 2010
How 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 Related
Mar 5, 2010
I am trying to get googlemaps to accept a local KML file.
final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=file://" + Environment.getExternalStorageDirectory() + "/locate.kml"));
startActivity(myIntent);
The file is on the SD card, and is a valid KML file. Google Maps loads up, but says it cannot find the file.
final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=http://www.website.com/locate.kml"));
startActivity(myIntent);
Works fine. geo: 0,0? q= seems to be very under documented, how to use it to refer to a local file?
View 2 Replies
View Related
Jul 21, 2009
I plan to have a 3gp video file that will come with the installation package, it will be placed in /files/ subdirectory, and I would like to ask the native Android media player to play it when I want that.
Here is what I have planned to do/code:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("BattlestarGalactica.3gp"); intent.setDataAndType(data,"video/3gpp"); startActivity(intent);
However, when I try to launch the lines above, I get the following error:
CODE:.............
And the video can not be played.
What am I doing wrong that is not applicable to Android platform?
View 7 Replies
View Related
Oct 20, 2009
I am working on a project for a belgium Tv Guide. Now I download a database (.db) file from a server to the sdcard to work with. In this database are 2 tabels, tvchannels and tvprograms. Now I can do several updates to the tvchannels table and i want to make a backup of this table to a lokal database file. How can i do that? I want to do this because I have to download a new database file every daye from the server and the channels that are choses are saved in the tvchannels database. I want to backup this database table and when the new database file (tvgids.db) is downloaded I want to replace the tvchannels database (from downloaded database file) with the backup from tvchannels..
View 6 Replies
View Related
May 21, 2010
What is the easiest way to read an xml file? How is the best way to store the information from the xml?
I have tried to find a good tutorial, but I just can't get it to work..
I have an xml file in /res/xml called myxml.xml which looks like this:
<?xml version="1.0"?> <school> <student> <fname>Ola</fname><lname>Nordmann</lname> </student> </school>
I just want a simple way to read and store.
(Yes, I am a beginner
-- 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 4 Replies
View Related
Nov 3, 2010
I am new to Android and relatively new to Java so please bear with me. I have an XML file stored in the res/xml that I am trying to write to. I know how to read it using XmlResourceParser, but I have not been able to find a way to write to that file locally. Could someone point me in the right direction please.
View 2 Replies
View Related
May 27, 2009
when 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");
} }
View 3 Replies
View Related
Jun 15, 2010
I would like to get the mime type of my local media file (3gpp , mp4, ...etc) if it is of video then i want to allocate a SurfaceView for it additionally otherwise i just use MediaPlayer to play it i have found opencore has provided some interface for that and used by mediascanner.cpp but it seems in android media framework it isnt so can i achieve this by using android media framework?
View 4 Replies
View Related
Aug 31, 2009
My open source application needs to browse local HTML files on the SD card, and WebView is not enough because I need history and bookmarks. I wrote the following code. It correctly opens the browser, but fails to reach catalog.html and in fact it just opens whatever page was last browsed:
Uri uri = Uri.parse("content://com.android.htmlfileprovider/sdcard/ myapp/catalog.html");
Intent intent = new Intent(); intent.setData(uri); intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity"); startActivity(intent);
View 2 Replies
View Related
Oct 27, 2010
I am having a file in the folder res/raw/a.xml.
I want to write some data to this file?
How it can be done in Android?
How can we access a file stored in local directory in order to write data to that file.
can anyone help me in sorting out this issue ?
View 1 Replies
View Related
Aug 11, 2010
How can I copy my data from xyz.xml in my assets dir to my sqllite db during development in android platform
View 1 Replies
View Related
Jul 12, 2010
Instead of launching a UI I was wondering if I could have a process monitor the execution of a javascript in the emulator's browser and read in the output data. Is it possible to execute a local javascript file using the phone's browser?
View 10 Replies
View Related
Aug 10, 2010
How can I parse my local XML file located in the systems hard disk.
View 1 Replies
View Related
Jul 16, 2010
I had found a lot of stackoverflow post about save an Activity and the reload it.
My question: How can I have an Activity with an MapView and after reload the same mapview?
What is the best way to switch between activity and views?
View 2 Replies
View Related
Sep 9, 2010
I 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?
View 10 Replies
View Related