nativescript

Nativescript and resources folder - is there a simple solution?

早过忘川 提交于 2019-12-08 03:40:30
问题 I will start with the fact that currently - I'm uploading successfully an mp3 file to a server - but via a hacky way. I'm having 2 raw folders as you can see : And here is the working code to upload the file : upload1() { let file = fs.path.join(fs.knownFolders.currentApp().path, "raw/a1.mp3"); var request = { url: "http://posttestserver.com/post.php", method: "POST", ... }; var task = session.uploadFile(file, request); task.on("progress", this.logEvent); } Here is the output for the

Nativescript - How to POST Image with http.request

独自空忆成欢 提交于 2019-12-08 00:26:18
问题 Help, I need call the http.request for send Image captured in camera api in my NativeScript App. I capture the photo in camera api for nativescript and need send to api in upload process. Follow the code about this process: var frameModule = require("ui/frame"); var viewModule = require("ui/core/view"); var Observable = require("data/observable").Observable; var config = require("../../shared/config"); var cameraModule = require("camera"); var imageModule = require("ui/image"); var http =

Expected 2 arguments, but got 1.ts(2554) core.d.ts(8064, 47): An argument for 'opts' was not provided

a 夏天 提交于 2019-12-07 15:18:32
问题 Error Expected 2 arguments, but got 1.ts(2554) core.d.ts(8064, 47): An argument for 'opts' was not provided. Code is from NativeScript Marketplace https://play.nativescript.org/?template=play-ng&id=Hqp5UQ&v=3073 I've brought the code over verbatim and I"m getting the errors in my export class on @ViewChild("password") password: ElementRef; @ViewChild("confirmPassword") confirmPassword: ElementRef; Does anyone know how to resolve this? import { Component, ElementRef, ViewChild } from "@angular

Nativescript + iOS webview + local files

萝らか妹 提交于 2019-12-07 11:59:00
问题 I'm currently working in a simple app, which has a HTML section which uses a webview. The contents are in an app/www folder, and I access them from a "home.ts" component with something like this in the HTML <GridLayout class="main-layout" columns="*" rows="*" > <WebView src="~/www/index.html" class="web-view" col="0" id="wv" row="0" ></WebView> </GridLayout> This file uses a few images, some JS and some CSS. It works fine on Android, but I can't make it work on iOS. Oh, and it works fine on

Does anybody know how to detect orientation change for Nativescript?

自作多情 提交于 2019-12-07 06:12:17
问题 I have created two xml files for a screen. one named "login-page.port.xml" and the other one is "login-page.land.xaml". Is there a way to programmatically detect orientation change within the application? Thanks, Keks 回答1: Yes, there is a way to detect orientation change in the application. The easiest method is in the page you want to get the orientation; add the loaded and unloaded events to your page.xml files: <Page loaded="pageLoaded" unloaded="pageUnloaded"> In your page.js file; add

Get mac address and ip in Nativescript

可紊 提交于 2019-12-07 01:04:34
We are implementing a server for app distribution and we need restrict the access to the apps by: mac address ip At the moment I have not found any module that can obtain this data from the device in nativescript, so i don't know if there's a plugin or how else can I achieve this. Habib Kazemi In nativescript you can access native apis of device so if there isn't any module/plugin for it you can use this option for accessing native apis. https://docs.nativescript.org/core-concepts/accessing-native-apis-with-javascript for example there is solution for mac adress here in JAVA: WifiManager

Make a NativeScript ListView Transparent on iOS

这一生的挚爱 提交于 2019-12-07 01:00:48
问题 I’m trying to get a NativeScript <ListView> to be transparent on iOS and I’m failing. I found an old thread on the topic at https://groups.google.com/forum/#!topic/nativescript/-MIWcQo-l6k, but when I try the solution it doesn’t work for me. Here’s my complete code: /* app.css */ Page { background-color: black; } <!-- main-page.xml --> <Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="loaded"> <ListView id="list-view" items="{{ items }}" itemLoading="itemLoading"> <ListView

repositories.cfg could not be loaded in Windows 10 [closed]

。_饼干妹妹 提交于 2019-12-06 16:52:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . while installing native-script i got repositories.cfg could not be loaded error , please help me debugging it. It would help me if you can give the way to download the file externally. The code i used was..... @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString

How can I migrate a web app with Angular v7 to mobile NativeScript app

北城余情 提交于 2019-12-06 14:53:33
I made a simple web app with Angular v7 and I want to migrate it to a NativeScript mobile app . I followed the instructions in https://docs.nativescript.org/angular/code-sharing/migrating-a-web-project#migrating-components but I am facing a difficulty. The app is running in my Android mobile phone but it does not show the content because I need to adjust it properly for a mobile app. It shows auto-generated works. The problem is I do not know how I can do adjust properly the code since I cannot find a properly doc. Any help? My code in app.component.html : <!--The content below is only a

NativeScript: How do I disble zoom controls in WebView?

橙三吉。 提交于 2019-12-06 14:29:36
问题 I found the way to enable/disable zoom controls in Android WebView from following question. How to remove zoom buttons on Android webview? I'm using NativeScript and I don't see similar method in NativeScript WebView. Is there any way I can access the methods of Android WebView from NativeScript? Or, is there any other way? Thanks. 回答1: You can get hold of the actual android trough the android property of your WebView. So you can probably use something like that in the loaded event: var