Building a Windows 8 application with JavaScript for the new Windows Store I stumbled on the lack of good data storage mechanisms.
I would like my app to use the SQLite3, but I cannot seem to make it work. Closest I can get is an error "Class not registered" when trying to access SQLite3 API through JavaScript.
If you made it work for your app, please share an example. Thanks!
Take a look at the SQLLite-WinRT project on github. I haven't played with it but it's in my queue of things to try out.
https://github.com/doo/SQLite3-WinRT
Here's a tutorial:
http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx
I'm not sure how it works in javascript but in the C# version of using sqlite you have to add the dll to the root folder of your app and make sure that in its properties its set to: content--> copy always
Related
I am developing a native android app using HTML/CSS/JavaScript. During the App flow, I need to permanently delete certain HTML files (stored locally). Can this be done?
I am a high school teacher trying to develop an educational app. I have basic knowledge of HTML/CSS and near zero knowledge of JavaScript!
modern broswer support javascript file operation but this file system is only in broswer and isolated from local files, refer https://developer.mozilla.org/en/docs/Web/API/File
if u do need delete file on android system, then u need your app provide a bridge to and call from js, run in app, in java code, delete the file
the code might look like
JsBradge.delete(file)
Javascript disigned as a web document script language, so it has many security essentials, such as absolute isolation in browser, which means no write acces to file system.
So, you have two options - first is create your own bridge to java, for example call prompt('your_file_name'), catch it in java and delete your_file_name.
Second - use any of mobile app framework, for example - Cordova.
Sorry, but no easy ways =(
I created a small web application in c# and wanted to create a installer for the web app and started so, using wix and i come up with the .msi file(installer) with a .wixpdb file.
Now, when i click on the .msi setup file ,installation is getting started and ending up with noting.
steps i followed is,
create web application.
build and publish.
harvest the publish folder and thats creates me a .wxs file.
create a setup project in the same solution of my web app.
add .wxs from step3 to the setup project.
build the setup project it create a .msi(installer) and .wixpdb file.
My Doubt here is that, how can i run the installer that will create a service/web application and installed locally.
Unfortunately WIX harvesting will not create a web application/web site for you automagically, when you harvest a "published" application. It will just produce the code to copy files. In WIX, you have to add this functionality yourself. In comparison with VS installer for example, you've got much more to do, and the rabbit's hole appears to be much deeper.. Take a look here for example:
http://www.codeproject.com/Articles/115036/Creating-WIX-Installer-for-ASP-NET-Web-Application
http://blog.bartdemeyer.be/2013/10/create-an-installer-for-website-with-wix-part-1/
The answer is quite simple, of course we just need to double click the installer, but before that we need to add
<UIRef Id="MyWebUI" /> in FileName.wxs file and define some UI dialogs in the .wxs file, that is more cleary explained here
http://www.codeproject.com/Articles/115036/Creating-WIX-Installer-for-ASP-NET-Web-Application.
I wrote a small web app using Nancy. I was originally using ASP.NET hosting, but I decided to try Nancy self hosting so I could deploy the app easily to any Windows machine. This involved replacing my ASP.NET Empty Web Application with a Console Application.
Pretty much everything is working well, but I've run into an issue where using certain window functions, such as alert() or escape(), in the JavaScript editor causes ReSharper warnings.
Here's how it looks in the editor:
I could always disable these warnings (or add window. before every call), but I'm wondering if there's anything I can do to have these functions recognized as if my project were an ASP.NET app.
Edit
If I return to my original project (the ASP.NET app) and type alert, here is what I see:
Could this mean that DHtml.js doesn't get loaded/included for console apps? Is there a way to make that happen?
When you create a web project, ReSharper adds some "hidden" js files to its cache that provide definitions for global objects, including the "Dhtml.js" file you mention. These files aren't added for console applications. There's no decent workaround here - ReSharper's web support is primarily based on the idea that you're in a web project of some kind, so there will be other features that are not enabled due to the fact that you're in a console app project.
However, it looks like it's possible to replicate what ReSharper does to add these files from a plugin - instead of looking to see if the project is a web project, it should look to see if it's a console app that also references Nancy. If so, tell ReSharper to internally reference these "hidden" files. I'd suggest posting a feature request to the Nancy ReSharper plugin project.
I'm building an Android based WebApp using PhoneGap, and trying to get the app icons of several currently installed applications back into the Javascript environment for displaying in the "browser".
Getting hold of the icons in the ANdroid layer is no problem. I've done that with code similar to this:
Drawable myNewIcon = myResolveInfoInstance.loadIcon(mycontext.getPackageManager());
... but I'm struggling with working out how to get the icon back into the Javascript callback so that I can place it into the "webpage".
If anyone can give me a tip or two on how to achieve this, it would be very much appreciated. It doesn't seem like it should be too difficult...!?
thanks.
If these drawables are going to be used purely on the web side of your project then putting them in the assets folder is the best idea. Then they can be accessed via:
file:///android_asset/www/images/icon.png
for instance.
Hey I'm collaborating on a Trigger.io project and I'm curious if there is documentation on how to best do this? I have other guys who are loading my project into their environments (via github) using TriggerToolkit, and they can't run the projects because there are conflicts with identity.json.
We're working on a simpler way for team collaboration, but for now the process for importing and existing Trigger.io will be similar to the instructions here for one of our demo apps:
https://github.com/amirnathoo/Sales-Square
Basically each app you create has a unique src/identity.json file which is also specific to your account. You should avoid checking in your src/identity.json file and a collaborator should create their own by creating a new app and then copying your code into the src directory.
Update: we've now enabled better collaboration with our Projects launch announced last week:
http://trigger.io/cross-platform-application-development-blog/2013/01/15/introducing-projects/
This should remove the need to manually create / overwrite the src/identity.json file to share Trigger.io app code