Where is the default location of Sqlite database in android emulator in an Alloy project using Titanium studio - titanium-mobile

I am very new to the Titanium Alloy framework. I am creating a CRUD app. So I need a database. I created a sample.sqlite in app/asset folder using Mozilla Sqlite add on. Then I created a model given below. But after adding the records through the application, I am not able to see the records in db using Mozilla Addon. But in application the added records are showing.So I am confused that the appication is using the sample.sqlite file we created or some other file(s). Please rectify the point. If it uses other file(s) How can I see the database in Mozilla addon? I followed the link but unable to find the Window > Open Perspective > Other > DDMS option in Titanium Studio.
I am using Windows 7 and Genymotion Android Emulator
Here is the Model
exports.definition = {
config: {
columns: {
"Id": "INTEGER",
"Name": "TEXT",
"Age": "INTEGER"
},
adapter: {
type: "sql",
collection_name: "sample",
db_name: "sample",
}
},
extendModel: function(Model) {
_.extend(Model.prototype, {
// extended functions and properties go he
});
return Model;
},
extendCollection: function(Collection) {
_.extend(Collection.prototype, {
// extended functions and properties go here
});
return Collection;
}
};

You want to pull the data from db using Mozilla add on.
For that first you need to open the DDMS that you can find at android-sdk-win > tools > DDMS
Once there go File Explorer > Data > Data > package name > .sqlite file
and save it
You can then use mozilla add on to connect to the .sqlite file.

Related

Reference Error {{variable}} is not defined at global in Rest Client in Visual Studio Code

I try to use Rest Client VS Code Extension from Huachao Mao. I created a new profile in my workspace settings
vs-code-workspace.code-workspace
{
"settings": {
"git.ignoreLimitWarning": true,
"rest-client.enableTelemetry": false,
"rest-client.environmentVariables": {
"xyz": {
"host": "http://localhost:8080/",
}
}
}
}
and I'm trying to send the following request
request.http
GET {{restBasePath}}/api/employee
but I'm getting
ReferenceError: host is not defined at global.<anonymous> (c:\Users\dev\request.http:3:20)
at N$ (c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extension.js:191:43412)
at zCe (c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extension.js:191:43961)
at c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extension.js:191:47073
at Jh (c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extension.js:190:30551)
at Object.V3t [as action] (c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extension.js:191:47038)
at I2e.<anonymous> (c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extension.js:1:5703)
at Generator.next (<anonymous>)
at s (c:\Users\user\.vscode\extensions\anweber.vscode-httpyac-5.8.3\dist\extensi...
after I switched environment to xyz and tried to send the request. How to get rid of the error?
You mixed vscode-rest-client with vscode-httpyac. httpyac is an alternative to vscode-rest-client developed by me (see httpyac.github.io). To configure my extension use setting httpyac.environmentVariables. To use vscode-rest-client use codelens Send Request. I would be happy for you to try httpyac, but I would recommend using only one of the two extensions and disabling the other.

How do I implement a "Settings" section for a custom Teams Message Extension?

I built a small teams message extension which just uses some user input, builds a link from it, and returns a card with a button pointing to that link.
I need to add a Settings section, but I couldn't find proper instructions or a sample for this.
I tried to use this sample as example (which is JS, and I'm using TypeScript), but I could not get it to work.
Relevant portion in my class:
export class MessageExtensionBot extends TeamsActivityHandler {
...
protected handleTeamsMessagingExtensionConfigurationQuerySettingUrl(context: TurnContext, query: MessagingExtensionQuery): Promise<MessagingExtensionResponse> {
return Promise.resolve({
composeExtension: {
type: "config",
suggestedActions: {
actions: [
{
title: "Title",
type: ActionTypes.OpenUrl,
value: "https://" + `${process.env.PUBLIC_HOSTNAME}` + "/settings.html"
}
]
}
}
});
}
protected handleTeamsMessagingExtensionConfigurationSetting(context, settings): Promise<void> {
return Promise.resolve(undefined);
}
process.env.PUBLIC_HOSTNAME points to the temporary ngrok link, smth like xxx-yyy-zzz.ngrok.io.
When I access xxx-yyy-zzz.ngrok.io/settings.html, I get the correct content of that html file
I also added "canUpdateConfiguration": true, in my manifest file, and the Settings link is available.
THE PROBLEM: when I click the Settings link in my custom teams message extension, all I get is a pop-up with the error message Sorry, the setting of this compose extension is not available. Please try again later. and an OK button.
What is wrong/missing in my code ?
Thank you.
We also faced this issue. It is resolved after adding validDomains in the manifest. Please try updating the validDomains in manifest, hope this resolves the issue.

Whats the right BlobStorageService Configuration format?

When creating a Microsoft Bot Framework 4 project - the Startup.cs has the following code which can be uncommented.
const string StorageConfigurationId = "<NAME OR ID>";
var blobConfig = botConfig.FindServiceByNameOrId(StorageConfigurationId);
if (!(blobConfig is BlobStorageService blobStorageConfig))
{
throw new InvalidOperationException($"The .bot file does not contain an blob storage with name '{StorageConfigurationId}'.");
}
This code handles a way to configure an Azure Storage Account via Json Configuration.
However the project lacks an example on what the config Json looks like for the "is BlobStorageService" to work.
I have done various tries and searched for examples but cannot make it work.
Has anyone got the nailed?
Got it working using this json...
{
"type": "blob", //Must be 'blob'
"name": "<NAME OF CONFIG - MUST BE UNIQUE (CAN BE ID)>",
"connectionString": "<COPY FROM AZURE DASHBOARD>",
"container": "<NAME OF CONTAINER IN STORAGE>"
}

Fireox, how get tabs object?

I try get tabs of current brouser window
var tabs = require("sdk/tabs");
and catch all new tabs
tabs.on('load', function(tab) {
console.info( tab.url );
});
if I run firefox by jpm run, all work fine. But if I build the xpi and install it to firefox then I'm getting tabs by other empty windows (if I call tabs.open opening new windows)
How fix it?
Now I'm trying the following simple example:
var buttons = require('sdk/ui/button/action');
var tabs = require("sdk/tabs");
var button = buttons.ActionButton({
id: "mozilla-link",
label: "Visit Mozilla",
icon: {
"16": "./icon-16.png",
"32": "./icon-32.png",
"64": "./icon-64.png"
},
onClick: handleClick
});
function handleClick(state) {
tabs.open("http://www.mozilla.org/");
}
And this example works only if I run "jpm run".
if I build the extension and simple run the firefox (with the addon), the button do not created.
I'm thinking that your xpi can not locate the icons, so your plugin seems not working.
The icons should be in your ./data directory and furthermore in your package.json it is a good practice to specify your main. The file hierarchy of your working extension is:
├--data/
├-- icon-16.png
├-- icon-32.png
├-- icon-64.png
├--lib/
├-- main.js
├--package.json
The package.json looks like:
{
"name": "stackexample",
"title": "stackexample",
"id": "mail#mail.com",
"description": "An stackoverflow example",
"author": "mail#mail.com",
"main": "./lib/main.js",
"version": "0.0.1"
}
In firefox after 'ready' event has been emitted, all properties relating to the tab's content can be used.You cannot access tab's properties on load event.
Please refer to this link of addon sdk tabs ready event
I found answer
If set setting history
"Never remember history" i got the problem
if set
"Remember history" problem has gone
it's very strange, i know

Vagrant Meta Data is Corrupt

Hope someone can help out here. I'm trying to version self hosted vagrant boxes, so doing this without using Vagrant Cloud.
I've created the following meta data file:
{
"description": "How about this",
"name": "Graphite",
"versions": [
{
"version": "1.8",
"providers": [
{
"name": "virtualbox",
"url": "http://desktopenvironments/Graphite/Graphite_1.8.box"
}
]
}
]
}
This is taken directly from the vagrant (somewhat lacking) documentation found at: http://docs.vagrantup.com/v2/boxes/format.html.
When running a vagrant add (taking the box file that contains this file directly from disk) I get:
The metadata associated with the box 'graphite' appears corrupted.
This is most often caused by a disk issue or system crash. Please
remove the box, re-add it, and try again.
Any assistance as to why this is happening would be greatly appreciated.
Was generating my metadata file from a c# app I wrote, using UTF8 for text encoding. This is not enough. You need to use UTF8 without BOM.
Once the Byte Order Mark was removed it all works 100s.
var settings = new JsonSerializerSettings() { ContractResolver = new LowercaseContractResolver() };
string json = JsonConvert.SerializeObject(metadata, Formatting.None, settings);
var utf8WithoutBom = new System.Text.UTF8Encoding(false);
using (var sink = new StreamWriter(outputFilePath, false, utf8WithoutBom))
{
sink.Write(json);
}

Resources