Is there a way to read picture data such as date picture taken, filename, GPS location and other information that is stored inside the images that stored in the medialibrary?
From what I can find the GDI+ components you would need for this are not currently available on the phone (or Silverlight for that matter). You can have a webservice provide this data to you or you can look into porting a desktop library, it seems some people here have had luck with that.
There is also a project called ExifLib that loads the metadata without the extra GDI+ overhead. http://www.codeproject.com/KB/graphics/exiflib.aspx
Related
I have a cross-platform solution which is written in C# and VS using Xamarin.Forms. At time being, the PCL project is using the WebRequest class with asynchronous mechanisms to fetch images directly from remote server. The PCL project also applies the UriImageSource class to cache a particular image for the first time when it is requested. However, the solution depends on the speed status of Internet; sometimes it is fast, sometimes it is slow.
Image is not static. It can be changed.
I'd like to change my project in another way. But I am not sure the following way is the right way to go and whether it is possible:
(1) Writing some codes to schedule mobile device (iOS, Android and Win phone) to sync/download images from the server and save images on local mobile device folder (outside embedded folder in the PLC project) dynamically. But is this possible?
(2) If I have images loaded on local mobile devices, how can I fetch such images using methods like ImageSource.FromStream() or ImageSource.FromFile() to show them on Xaml pages? If possible, how can I code?
(3) I am not sure this. If I let image folder of the PCL project to store (assume it is possible) images, then how can I dynamically mark downloaded images as "Embedded Resouce" (Build Actions set). Anyway, I prefer (2) above.
Thank you in advance.
I'm woking now on my senior project, it about identify the places through pictures on windows phone 8 platform.
Any libraries or algorithms could help me ?
if the data is embedded in the image: see How to get the EXIF data from a file using C#
if not: Then perhaps a google api may help, I don't know Google's APIs but here is an article which may give you some idea for what to search for: http://www.labnol.org/internet/find-picture-location/21273/
What would be "best practice" for allowing the user to store data for my application on his phone, using the same application?
For example, my app has a database of images+short audio. I want to allow users to expand said database by using the camera to take a photo and then save some audio along with it.
On MSDN it says
With Windows Phone OS 7.1, you can store relational data in a local database that resides in your application’s isolated storage container
But the rest of the app doesn't need 7.1, so it would be great if I could use this database/storage on 7.0 as well.
Microsoft has done a good job of upgrading devices, so unless you have a core group of users who you know can't upgrade for some reason, you should definitely target Windows Phone 7.1. (It's not like Android where you probably want to use an older SDK for greater compatibility.)
I have a similar app, in that it stores a library of images, audio files and data about those resources. What I've chosen to do is store the images and audio by themselves and then use the built-in SQL CE database to hold metadata about the resources (i.e. file paths and file names for the images and audio files, captions for the audio files).
It's probably possible to shove binary data into the database, but I would stick with storing it straight in isolated storage. The database is pretty fast, so it won't hurt the performance of your app.
If you really need to support 7.0, you can serialize your metadata as XML and then write it to isolated storage. This is what I did before the 7.1 release. Data access is likely going to be faster from the database than it would be if you need to read an entire XML file into memory, then parse it into objects.
I would love to have a fix metadata function for my music player, but as I know there is no library that could do such. However I found that some C# application could accomplish this.
Example
I need some advice and probably a good sources to get start this projects. Any help will be appreciated.
Thanks.
Edit: I also found this, this is very similar to what I want to do, but there is so few sources.
http://wmpoweruser.com/finally-mp3-tag-editor-for-windows-mobile-available/
Currently, the Windows Phone Platform doesn't provide a way to modify song data for songs on the device. There's no way to access the file system from a restricted Silverlight application, and the current XNA Media classes only provide read-only access to song data.
You need direct access to the file via an IsolatedStorage because there is no built-in support to change id3v2 tags.
Then you can use these libraries:
http://sourceforge.net/projects/audiogenie/
http://github.com/mono/taglib-sharp
I'm trying to build an application that will use open source maps from Open Street Maps (though the concept should be applicable to any map provider). The application will enable the user to specify a number of waypoints along a route prior to departure.
Because I don't have a data plan for my cell phone (and because rambling in the countryside rarely gives you a good connection), I want to be able to pre-load the relevant map tiles for the waypoints and/or route before departure so that maps can continue to be used without a data connection.
My initial thoughts are to download the required tiles from the map provider and store them in isolated storage. However, the Bing Maps control implementation, which uses the TileSource class relies on returning an absolute URI that it can download the tile(s) from, which clearly won't work with data stored in isolated storage.
The question has already been asked: Windows Phone 7 Map Control with custom layer in offline mode, but wasn't answered and I'm wondering if since then anyone has cracked the problem.
I've seen this done with a custom layer placed over the map. Tiles are then loaded from anywhere you like (IsolatedStorage, online, somehwere else?) into the custom layer.
Sorry, I don't have any code I can share which demonstrates this at the moment but am currently doing something very similar.
I built a small prototype using OpenStreetMaps for Android. I think it might be interesting to look at the repository and therefore, find a solution similar to mine. I did download the maps before hand, but maybe you can use an online solution for this. This is the repo: https://github.com/kikofernandez/OpenStreetMapExample and the video of how it could look like: https://vimeo.com/40619538.
I used for this prototype OpenLayers, OpenStreetMaps, JavaScript and a WebView in Android. I would like to give you further details but it was just a prototype.
If you can store the data locally (embed it in the XAP), you can reference it via an absolute URI. Chris Walshie talks about it here.
So, for example, once you have the installation path for the app, you can reference the resource like this:
Uri toResource = new Uri("file:///Applications/Install/4FFA38B5-00AF-4760-A7EB-7C0C0BC1D31A/Install/EMBEDDED_RESOURCE", UriKind.Absolute);
Have you set the Build Action on your image(s) to Content?
If your app is running on WP8 then use the built in maps control in the Windows Phone 8 SDK as this already supports offline maps out of the box. If targeting WP7 it is possible to get offline maps to work but takes a lot of work. I created this for a customer a few years ago and I believe that it took me a little over 3000 lines of code to do. Mind you they wanted to also have a framework for adding tiles from various sources such as downloading over and area and downloading zipped files. They way I managed to get the rendering to work was to a canvas to the map without setting it's position. This will be default make it a child of the map but it will not move. I then made the canvas the same size as the map and used the resize event to resize the canvas should the map be resized. I then used the view change event to trigger a method to render the tiles. When this event fired I first calculated all the tiles in view using the code found here: http://msdn.microsoft.com/en-us/library/bb259689.aspx
I then would pull the tiles from isolated storage and draw them on the canvas. For performance I keep track of which tiles I added to the canvas so that if the tile was still in view I simply changed it's position rather than reloading it from isolated storage. I also removed any images that were no longer in view. Overall this works fine but there were some minor issues such as not having the smooth transition between zoom levels. If you really wanted that it is possible to get that to work but requires a lot more math. Also, if you zoom into an area where there is no tiles you end up with an empty map. You can create a custom map mode to prevent the user from going into areas where you don't have tiles.
A solution
The question is a bit old, but there's a solution for anyone who can use Qt.
The solution is not limited to the Windows Phone platform, I've done it targetting Android, and it also works on my desktop.
In Qt, you'll want to patch the OSM Plugin used by QtLocation. It's simple, quick and easy.
How to do it ?
A quick implementation could modify the QGeoTiledMappingManagerEngineOsm class to make it call your own QGeoTileFetcher instead of QGeoTileFetcherOsm.
There may be better ways to acheive this, but at least it works for me.
Basically, you make a fetcher that reads tiles from the filesystem instead of the network.
You build your filesystem database once, from an online resource for instance (see below) and you deploy it with your application for its offline use.
Where do I get tiles from ?
Information how to get the tiles to your offline implementation is available here :
http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
Here are two sources for tiles that can be used for free :
Open Street Maps project servers
Mapquest Open Tiles servers
Take care of the licensing and terms of use.
Open Street Map
Project : wiki.openstreetmap.org/wiki/Main_Page
License : www.openstreetmap.org/copyright
Terms of use : wiki.openstreetmap.org/wiki/Tile_usage_policy
Servers are currently named like *.tile.openstreetmap.org
MapQuest-OSM Tiles
Project : developer.mapquest.com/web/products/open/map
License : opendatacommons.org/licenses/odbl/
Terms of use : developer.mapquest.com/web/info/terms-of-use
Servers are currently named like otile*.mqcdn.com
(Sorry for strange links : I haven't got enough reputation to post real links).