map inclusion file for skobbler sdk - skmaps

I am trying to understand how to download offline maps from osm.
Eg jamaica.osm and use in skobbler for android. But so for i am confused.
The only they provided was this,
public void downloadMapsXMLForVersion(int version) {
String url = SKPackageManager.getInstance().getMapsXMLPathForVersion(version);
// … Download the xml from the URL … //
// … When download is finished call [downloadPackages] … //
}
I really don't understand.
All i simply want is to download an osm map file and load it into map view.
Thank You!

The Skobbler SDK uses .skm as a map format, which is an internal, proprietary format, so you can't use .osm
For download, on a device, start the demo project - go the “Map download” menu, navigate to North America -> Jamaica and proceed to download the map.
On the device you should now be able to find the downloaded package on: /Android/data/com.skobbler.sdkdemo/files/SKMaps/PreinstalledMaps/v1/20160426/package ) (you can search for .skm files to make things easier)

Related

Convert HTML To Image in .NET Core

Heading ##I want to convert HTML code to Image(png/jpg) on Web Server and then send image link in email in my .NET Core application. I don't want to purchase any third party library like NReco or EVo.
Is there any other way to convert HTML To Image in dotnet core 2.0?
I use net-core-html-to-image library that embeds wkhtmltoimage tool. The library is very simple to use. There is a nuget package:
Install-Package CoreHtmlToImage
If you want to convert HTML string to image:
var converter = new HtmlConverter();
var html = "<div><strong>Hello</strong> World!</div>";
var bytes = converter.FromHtmlString(html);
File.WriteAllBytes("image.jpg", bytes);
Or for URLs:
var converter = new HtmlConverter();
var bytes = converter.FromUrl("http://google.com");
File.WriteAllBytes("image.jpg", bytes);
I know this is old but I wanted to save some from headaches if you come across it. The wkhtmltopdf.exe file that this uses, uses an older rendering engine. I had to go all the way back to bootstrap v2 to make it render correctly.
There are number of free libraries on web to convert HTML to image/PDF/other formats.
I prefer TuesPechkin dll to export to image/pdf.
For image you need to use wkhtmltoimage dll. You can go through below links:
https://wkhtmltopdf.org/
Below is the Github link. You can find more details here:
https://github.com/tuespetre/TuesPechkin
Sharing you the solution, which might helps to others
I used wkhtmltopdf.exe and it worked.
Following post helped me
https://beeming.net/just-coding/2017/5/converting-html-to-pdf-using-c-and-magic

Deploy and load a picture to use as a texture in a holographic app

I created a sample holographic application in Visual Studio 2015 with C++/CX (or whatever they call that fancy C++ with hats and ref new). It builds, deploys and runs fine, rendering a rotating colored cube, just as it's supposed to. Now I am trying to add a jpeg image and use it as a texture on the cube. The question is, where shall I put the image, how do I add it to the project, how do I make VS to deploy it along with the rest of the project, and how do I load it in my application?
I have literally zero experience with both DirectX and UWP. I've done this tutorial on textures on my desktop Windows 10 (a regular C++ app, not managed, not UWP), although the way they load a file into a texture in the tutorial didn't work for me. After some googling I downloaded this library, built it for desktop Windows 10 (DirectXTex_Desktop_2015_Win10.sln) and used in my project as follows:
DirectX::ScratchImage image;
LoadFromWICFile(L"myimage.jpg", DirectX::WIC_FLAGS_NONE, nullptr, image);
CreateShaderResourceView(d3d11Device, image.GetImages(), image.GetImageCount(), image.GetMetadata(), &CubesTexture);
It worked. Now, for Hololens I built their DirectXTex_Windows10.sln solution (assuming that if the other one was for desktop, this one must be for non-desktop) and tried (unsuccessfully) using it like this:
DirectX::ScratchImage image;
HRESULT hr = LoadFromWICFile(L"ms-appx:///myimage.jpg", DirectX::WIC_FLAGS_NONE, nullptr, image);
CreateShaderResourceView(m_deviceResources->GetD3DDevice(), image.GetImages(), image.GetImageCount(), image.GetMetadata(), &m_cubesTexture);
I also tried ms-appdata instead of ms-appx. In both cases LoadFromWICFile does not return S_OK. It gives ERROR_INVALID_NAME: The filename, directory name or volume label syntax is incorrect. As for myimage.jpg, I put it into the Assets subfolder and added to the solution through Add->Existing Item. Is that enough to get it deployed to Hololens? How do I check if it gets deployed? Where on the device is it going to be located, if deployed?
It seems I over-complicated things.
To add a file like that into a project, simply use right click (on the Assets sub-folder in the solution explorer) -> Add -> Existing Item. To get it deployed on the device or emulator, right click on the file -> Properties, set Content to Yes and Item Type to Image or Does not participate in build (for something that doesn't get recognized correctly, for example, Wavefront .OBJ file, which VS would otherwise try and fail to link).
To check if (and where) the file is going to be on the device or emulator, you can build an actual package: right click on the project, choose Store->Create App Packages... It creates an .appx file, which is actually a zip-archive. You can explore it with an archiver like 7zip, or rename it from .appx to .zip and open with Windows File Explorer. In my case the image file was there, in the Assets subfolder. I was able to read it by its simple relative path, like this (no ms-appx:/// or other such prefixes):
HRESULT hr = LoadFromWICFile(L"Assets/myimage.jpg", DirectX::WIC_FLAGS_NONE, nullptr, image);
For some other functions (std::fopen, std::ifstream etc.) this relative path didn't work, I had to use the full path as follows:
Platform::String^ appInstallFolder = Windows::ApplicationModel::Package::Current->InstalledLocation->Path;
std::wstring folderNameW(appInstallFolder->Begin());
std::string folderNameA(folderNameW.begin(), folderNameW.end());
std::string fname = folderNameA + std::string("/Assets/model.obj");
std::FILE *f = std::fopen(fname.c_str(), "r");
This textured cube project might give you some insight. I think is based on the C# VS2015 Holographic template.
https://github.com/dngoins/HololensDXTutorials

android use the camera app and private storage

I am trying to use the sample code at
https://developer.android.com/training/camera/photobasics.html
to take pictures that WILL NOT show up in gallery or get shared. Google's example missed this part of the demo.
I followed the example: My code is at:
https://github.com/tomha2014/SecureCameraIntent/tree/master
Failed to ensure directory: /storage/sdcard1/Android/data/thackbarth.com.securecameraintent/files/Pictures
I have all the read/write external permissions in the manifest.
Make sure folders in this path exist.
thackbarth.com.securecameraintent/files/Pictures
YEA! I found it
In the google sample code found at
https://developer.android.com/training/camera/photobasics.html
There is a line of of code that looks like:
mCurrentPhotoPath = "file:" + image.getAbsolutePath();
That create a file uri, the bitmap decode:
Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);
Wants a path to the file Take off the "file:" and it it works.....
That was a lot of hours wasted, if Google would have just provided that code in the sample linked to that page.
In any case, I am working on a sample that uses that code for Android 6
can be found at:
https://github.com/tomha2014/SecureCameraIntent

mergPopActivity from mergExt use in android with livecode

Anyone have use the mergPopActivity in the Android to share text for Facebook or something else?
Is there any example how we use it?
This is from mergExt
on mouseUp
try
mergPopActivity "Hello"
catch e
answer e
end try
end mouseUp
The mergAndroid.html contains the following information about mergPopActivity:
command mergPopActivity pText,pImagePaths,pURLs
Share data to other apps
Parameters:
pText - A string that you want to share.
Note that the Facebook app has a bug that it will not accept shared text.
pImagePaths - A list of image paths to share. The image paths must be readable by other applications such as on external storage
pURLs - A list of URLs to include in the share text.

Getting the full path of a DirectoryEntry

Does anyone know how to get the full path of a DirectoryEntry object in a Chrome Packaged App, without any tildes or other shortcuts?
I am writing a Google Chrome Packaged App. My app has a button where a user can choose a directory using chrome.fileSystem API. When the directory choice comes back to my app, it is represented by a DirectoryEntry object, which is defined in the File API. The object looks like this in the console:
DirectoryEntry {
filesystem: DOMFileSystem
fullPath: "/to_read"
isDirectory: true
isFile: false
name: "to_read"
__proto__: DirectoryEntry
}
I am using Windows and the full path of the directory is
C:\Users\David\Desktop\to_read
I would like a function that can return that path or something close. Unfortunately, the closest thing I found is chrome.fileSystem.getDisplayPath, but that returns the following:
~\Desktop\to_read
The return value from getDisplayPath is not useful to me, because I want to get the full name of the directory (including the drive) so I can compare it to some other full directory paths I have.
I tried calling toURL() on the DirectoryEntry and it returned an empty string.
A bit about my project: I want to write an iTunes library synchronizer as a Chrome Packaged App. The iTunes library XML file contains full paths like file://localhost/D:/David/Music/Bob/Bob%20Album/01%20Bob.mp3. The user will give my app access to his music folders, and I want to be able to tell if he gave me access to the right folders.
The only full paths available are those returned by getDisplayPath.
The mediaGalleries API may be a better fit for your project: http://developer.chrome.com/apps/mediaGalleries.html#iTunes.
If you have a full path path/to/the/file.mp3 and you want to load the file directly with tis you can do it but the solution is not perfect. Use the chrome.mediaGalleries API to ask where the user saves his music (in your case), then you can write a loop who check if one of the path repository is equal to a gallery.
For example if you got a file path/to/the/file.mp3 from the xml file and your galleries list looks like ["D", "to", "Videos"], write a function to check if each component of the file's path is a gallery. In this case your code will find "to", so you can launch a second function who use "the/file.mp3".
The second function has to use the given path and find if the gallery contains the right folders and finally the right file (use this example by Google). In the case you're trying to find "the/file.mp3" with the gallery to your loop has to find a directory named "the" then "file.mp3" (write a recursive function), if you find the file open it, otherwise come back to the first function if you haven't check all the galleries or all the path's component.
This is currently (2014-01-10) not a feature of Chrome, but I have suggested it and they are working on it:
https://code.google.com/p/chromium/issues/detail?id=322952

Resources