我想在不同于活动的文件夹中设置类.当前文件夹结构:
-> APP
-> Manifests
-> Java
-> com.test.testing
-> classes
auth.java
home_activity
-> libs
Run Code Online (Sandbox Code Playgroud)
auth.java
package com.test.testing;
// error here: Package name ‘com.test.testing’ does not correspond to file path.
public class auth{
public void auth(){}
}
Run Code Online (Sandbox Code Playgroud)
另外,我无法在活动中调用此类:
import classes.auth;
Run Code Online (Sandbox Code Playgroud)
所以我去构建gradle这是我的配置:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.test.testing"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
java.srcDirs = …Run Code Online (Sandbox Code Playgroud) 我的应用程序已经在 Google Play 和 iTunes 中firebase_messaging提交、审核和在线,但最近我添加了通知功能插件。
在加入 Firebase Cloud Messaging 时,Google 强迫我下载两个文件:
google-services.json - 保存在我的 flutter App 文件夹中: MyApp\android\appGoogleService-Info.plist-我不知道在哪里保存它,而是尝试在MyApp\ios\Runner与MyApp\ios\Runner.xcodeworkspace没有成功所有教程都指向使用 Xcode 来GoogleService-Info.plist正确设置文件,但我没有 Mac,而且我一直在成功使用 Windows 应用程序AppUploader来提交我的 iOS 应用程序。
有什么方法可以不使用 Xcode 并能够将其附加GoogleService-Info.plist到我的项目中?
首先我已经阅读过这个主题jQuery AJAX函数返回true或false只返回false而它的一切都很好,在回调函数中返回jQuery的ajax数据参数是什么?,如何返回数据响应ajax的真或假功能?我无法弄清楚如何使这个工作.
$("#btn_go").on('click', function(){
if(validateUserDetails() == false){
return;
}
});
Run Code Online (Sandbox Code Playgroud)
所以,该功能validateUserDetails有以下几点:
function validateUserDetails(){
var bool = false;
$.ajax({
url: 'response.php?type=validateUserDetails',
type: 'POST',
dataType: 'json',
data: {name: $("#checkout_name").val(), email: $("#checkout_email").val(), "country": $("#checkout_country").val(),
"city": $("#checkout_city").val()},
success: function(data){
console.log(data); // this is currently returning FALSE
// Which is totally correct!
if(data == true){ bool = true; }
return trueOrFalse(bool);
}
});
}
function trueOrFalse(bool){
return bool;
}
Run Code Online (Sandbox Code Playgroud)
但这不起作用,因为如果我输出函数我得到"未定义",这意味着该函数没有重新调整正确的值. console.log(validateUserDetails()); // = undefined
我在做什么?
以以下函数为例:
List<Widget> getListFiles() {
List<Widget> list = [
Container(),
Container(),
Container(),
];
return list;
}
Run Code Online (Sandbox Code Playgroud)
如何插入子参数?
Column(
children: <Widget>
[
Text(),
Text(),
getListFiles(), <---
Text(),
]
)
Run Code Online (Sandbox Code Playgroud) 我有一个返回结果的函数(或不返回).问题是当它没有返回我在控制台中获得的任何值的消息
无法读取未定义的属性"已完成"
这是真的,我确实理解这个问题.此外,此错误不会使我的代码停止工作,但我想知道是否有任何机会避免这种情况?
ajax中的函数是:
function getDelivery(){
var items = new Array();
$("#tab-delivery tr").each(function(){
items.push({"id" : $(this).find('.form-control').attr('id'), "id_option" : $(this).find('.form-control').val()});
});
if(items.length > 0){
return $.ajax({
url: 'response.php?type=getDelivery',
type: 'POST',
data: {content: items}
});
}
}
Run Code Online (Sandbox Code Playgroud)
我称之为:
getDelivery().done(function(data){ // the problem is here
if(data == false){
return;
}
});
Run Code Online (Sandbox Code Playgroud)
那么,有没有办法避免错误?我试过以下没有成功:
if(items.length > 0){
return $.ajax({
url: 'response.php?type=getDelivery',
type: 'POST',
data: {content: items}
});
}else{
return false;
}
Run Code Online (Sandbox Code Playgroud)
我收到错误:
未捕获的TypeError:undefined不是函数
我有以下HTML结构:
<div id="container">
<div class='label-item-text drag' data-type='text'>
<div>Right click on me and check the HTML of the duplicated</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
而我正在尝试复制里面的项目#container.不幸的是,我没有按预期工作.
A)我的代码复制了里面的所有项目,实际上我只选了一个
B)我不能正确复制
复制所有项目的代码如下.
$('#container').append($dragRightClick.parent().html());
Run Code Online (Sandbox Code Playgroud)
好了,parent()的$dragRightClick是#container,让我明白为什么它复制的所有项目的原因...
我想复制的只是里面的div #container,这意味着:
<div class='label-item-text drag' data-type='text'>
<div>Right click on me and check the HTML of the duplicated</div>
</div>
Run Code Online (Sandbox Code Playgroud)
但到目前为止我所得到的只是:
<div>Right click on me and check the HTML of the duplicated</div>
Run Code Online (Sandbox Code Playgroud)
以下代码输出上面的代码:
console.log("Clone: " + $dragRightClick.clone().html());
console.log("HTML: " + $dragRightClick.html());
Run Code Online (Sandbox Code Playgroud)
您可以在JSFiddle中查看完整的问题.
我需要使用选择器在文本中添加一个小边框底部::after。
<h3>
Hello, this border is too long
</h3>
<h4>
Hello, this border should be small
</h4>
Run Code Online (Sandbox Code Playgroud)
该<h3>元素具有正常边框,填充文本的整个空间。但我需要<h4>元素只有一个 10px 长度的边框。
基本上这就是我想要实现的目标:
所以我尝试用 CSS 玩一下,但没有成功:
h3
{
border-bottom: 3px solid #000;
}
h4::after
{
content: '';
border-bottom: 3px solid #000;
width: 10px;
}
Run Code Online (Sandbox Code Playgroud)
我使用以下代码将.webm视频转换为.mp4使用 FFMPEG 库:
ffmpeg -i video.webm -vcodec h264 -acodec aac -strict experimental video.mp4
Run Code Online (Sandbox Code Playgroud)
在 Windows (Chrome/Firefox)、Mac (Safari/Chrome)、Android (Chrome) 中播放转换后的视频时,此功能可以完美运行,但在通过 iOS (Safari/Chrome) 观看时则无法运行。
起初我以为这可能是一个mp4问题?但后来我在 iOS Safari 中毫无问题地播放了这段视频https://www.w3schools.com/html/mov_bbb.mp4,它也是一个mp4.
所以这告诉我转换有些地方不太正确。
我在转换过程中缺少什么?
从 PuTTy 登录: https: //pastebin.com/VLSPL0nC
在使用 PHP 成功验证我的包并通过端点将其交付给 Safari 后/v1/pushPackages/web.com.mywebsite,出现了预期的弹出窗口:
现在出现三个问题:
granted条件中打印“设备令牌:...” 。我可以选择该项目,然后按“删除”按钮,重新启动 Safari,我的网站将再次请求权限,但问题仍然存在。我的日志文件是空的,没有抛出错误!
var checkSafariPermission = function (permissionData)
{
if (permissionData.permission === 'default')
{
window.safari.pushNotification.requestPermission(
'https://mywebsite.com',
'web.com.mywebsite',
{},
checkSafariPermission
);
} else if (permissionData.permission === 'denied')
{
console.log('denied');
} else if (permissionData.permission === 'granted')
{
// This is never triggered!
console.log('Device token: ' + permissionData.deviceToken);
}
};
var permissionData = window.safari.pushNotification.permission('web.com.mywebsite');
checkSafariPermission(permissionData);
Run Code Online (Sandbox Code Playgroud)
我有路线:
POST /v1/devices/{deviceToken}/registrations/web.com.mywebsite
DELETE /v1/devices/{deviceToken}/registrations/web.com.mywebsite …Run Code Online (Sandbox Code Playgroud) Binance 提供具有多种功能的 Web Socket Streams,例如聚合流、交易流、Kline/Candlestick Streams 等,您可以在此处查看https://github.com/binance/binance-spot-api-docs/blob/master/ web-socket-streams.md
我希望获得我选择的硬币的当前价格和过去 24 小时的百分比变化,但我不明白如何获得这些信息。价格必须是实时的,可以每 60 秒或其他时间调用 24 小时 % 的变化。
我目前正在使用 CoinCap https://docs.coincap.io/,这很简单:
https://api.coincap.io/v2/assets?ids=bitcoin,ethereumwss://ws.coincap.io/prices?assets=bitcoin,ethereumCoinCap 的问题是我无法用我想要的交易所过滤价格,在这种情况下是 Binance。所以我不断得到与币安不匹配的价格。
var socket = new WebSocket('wss://ws.coincap.io/prices?assets=bitcoin,ethereum');
socket.addEventListener('message', function (event)
{
// parse & show the data
});
Run Code Online (Sandbox Code Playgroud)
例如,Kline/Candlestick Streams 说明如下:
Kline/Candlestick Stream 每秒推送更新到当前的 klines/烛台
并返回以下数据:
{
"e": "kline", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"k": {
"t": 123400000, // Kline start time
"T": …Run Code Online (Sandbox Code Playgroud)