Configure UWP Native Messagging App - configuration

I'd like to configure an UWP App in order to receive messages from an Edge Extension, and to answer to these messages using some external configurations: I tried to use the Windows Credentials Vault, but it seems impossible to access it (the UWP App seems running in a SandBox), with no visibility of the Windows Credential Vault).
So my question is: is there a way to manually configure an UWP app without deploying the configuration into the store?
Thanks so much,
Daniele

I don't know if this is the best option, but an UWP app can read a file from the local storage.
So, after the installation took place, I wrote a config file in the local storage directory (%USERPROFILE%\AppData\Local\Packages\\LocalState), and I was able to access it from the UWP app using the following code:
Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
Windows.Storage.StorageFile configFile = await storageFolder.GetFileAsync("config");
String configContent = await Windows.Storage.FileIO.ReadTextAsync(configFile);
//configContent now contains the config info

Related

Adobe Air Android Debug

I am using Flash Builder 4.6 to develop an Android game using Air. When I debug on PC it works fine, however when I plug in my Android phone and attempt to debug, I get an error with the location of a db file.
This is what I presently have the location set to:
private static var DefaultDB:File = File.applicationDirectory.resolvePath("com/arakaron/Assets/Database/DefaultDb.db");
What / where should I be setting it to? It seems that when I debug the app, nothing gets transferred to the phone as I can't find any Arakaron resources on the phone.
Any help would be great.
Thanks.
You can't access the DB in this way.
Please use below code.
File.applicationStorageDirectory.resolvePath("DefaultDb.db");
Your db has to be within the application storage. If you want to have inside the folder then you define the folder name like below:
File.applicationStorageDirectory.resolvePath("db\DefaultDb.db");
The File.applicationDirectory on Android refers to your application and assets. On Android this is contained packaged in your APK and assets are decompressed in memory by the OS when you access them. You shouldn't use this directory unless you are reading assets from your package. Assets in this directory can only be accessed via a url and won't have a nativePath property.
Most likely you should use the File.applicationStorageDirectory or if the files can be safely deleted without breaking the operation of your application you should use the File.cacheDirectory.
You can read more on these locations: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html
If you package a database with your application you should use the File copy process to copy the file to one of the above locations before attempting to access it as a database.

Where is chrome.storage.local stored for Chrome Apps?

Where is chrome.storage.local stored for Chrome Apps in OSX yosemite?
I finally found it: ~/Library/Application Support/Google/Chrome/Default/Local App Settings/{{chrome-app-id}}. The whole {{chrome-app-id}} folder is a leveldb database. I was able to open it and inspect the contents of the stored file using the leveldb-ruby gem. Just do the following
require 'leveldb'
db = LevelDB:DB.new '~/Library/Application Support/Google/Chrome/Default/Local App Settings/{{chrome-app-id}}'
You can now query the database using the db object. By the way if you get a weird error saying that the db is being used by someone else make sure you kill chrome and erase the LOCK file.
localStorage is located in ~/Library/Application Support/Google/Chrome/Default/Local Storage. You'll need the ID to find the correct files but they'll be prefixed with chrome- and have a file extension of .localstorage.
Based on some picking through the POSTMan App, it looks like it makes a call to chrome.storage.local and the data on my Mac is located here: ~/Library/Application Support/Google/Chrome/Default/Local App Settings/<ID>/000003.log.

Unable to upload widget to Wirecloud instances in private server

We have downloaded and installed a running instance of Wirecloud in our company server following the steps at:
https://conwet.fi.upm.es/wirecloud/install
We created the instance using the --quick-start command to try the instance, and ran wirecloud using the Django internal web server with the following command:
$ python manage.py runserver 0.0.0.0:8080 --insecure
We are able to enter the instance, and move around the enviroment, but we have encountered a problem when we try to upload a widget to our local workspace. After I search for the widget in my computer (previously downloaded from the Fi-lab marketplace), we get the next message:
Error adding packaged resource: Internal Server Error.
We also tried to download the zip file of the widget from github, unzip it and recompress it as a wgt file (compress as a zip but changing the extension to .wgt) and we get the same answer from our wirecloud instance; but if we try to upload the same package to the instance in fi-lab, it uploads successfully.
We don't know if it's because of the quick-start installation we made or if we have to modify something from our widget files in order to be able to upload it to our local instance.
Solved
The problem was in the config.xml file: the name of the attributes and the structure of the widgets unable to upload were different from the template of the config.xml file posted at the users guide.
After changing it to follow the structure of the template it works fine.
My widget example was the NGSI Updater. The thing is that it uploads perfectly in the instance at FiLab, even though the config.xml file had a different structure from the one of the template; but it encounters an error when uploading it to the Wirecloud local instance at my server.

How do you open a remote sqlite database over http?

Is it possible to open an sqlite file over http? I only need to read the db, and was hoping I could do something like:
var dbFile:File = new File("http://10.1.1.50/project/db.sqlite");
sqlConnection.open(dbFile);
Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'
My situation calls for several apps compiled for various devices to share this file, which is served locally via wamp.
Zip your sqlite file from db.sqlite to db.zip. Load this zip file in flex using URLLoader and unzip it back in flex.
If not, you can also rename the file's extension to .xml, load it using httpservice or urlloader and once you get the result, you can rename the file's name back to .sqlite and start querying the file and it will work just fine.
There is no way you can achieve this over HTTP.
SqLite is a file and not a service/process that may be accessible via any port.
The best case scenario is when you have network access to the computer where the sqlite file is stored, like:
\\myserver\databases\mysqlitefile.db
...but this may work only on windows :(
You can adapt your code to use modsqlite http://modsqlite.sourceforge.net/#using
there's an apache module to allow remote sqlite access via http.
http://modsqlite.sourceforge.net/

Can't save to a JSON file on Win7 from an AIR app

I'm writing an AIR app that reads from, and writes to a local JSON file. I'm using the File and FileStream classes. It works perfectly on Mac, but on Win7 it's not saving. Does anyone know of any platform-specific issues or tips for the .writeUTFBytes() method?
file = new File(itemBase + "/manifest.json");
fileStream = new FileStream();
fileStream.open(file, FileMode.UPDATE);
fileStream.writeUTFBytes(json);
Thanks,
Wayne
On windows7 you will generally not have write permission to the "program files"-folder. You should probably set up a folder under user documents or something like that.
This might come in handy:
(from: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html)
File.applicationStorageDirectory—a storage directory unique to each
installed AIR application
File.applicationDirectory—the read-only directory where the application is installed (along with any installed assets)
File.desktopDirectory—the user's desktop directory
File.documentsDirectory—the user's documents directory
File.userDirectory—the user directory