小编Vik*_*ngh的帖子

如何在Geofence android中添加后台服务

我正在尝试使用后台服务为监视器创建地理围栏.地理围栏创建成功并在应用程序活动打开时工作,但在关闭应用程序地理围栏时不起作用.我现在应该怎么做.我的代码是:

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback,
    GoogleApiClient.ConnectionCallbacks,
    GoogleApiClient.OnConnectionFailedListener,
    LocationListener {


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    ref = FirebaseDatabase.getInstance().getReference("MyLocation");
    geoFire = new GeoFire(ref);
    mVerticalSeekBar = (VerticalSeekBar)findViewById(R.id.verticalSeekBar);

    setUpdateLocation();

}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    switch (requestCode) {
        case MY_PERMISSION_REQUEST_CODE:
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { …
Run Code Online (Sandbox Code Playgroud)

android google-maps geofencing android-geofence geofire

13
推荐指数
1
解决办法
3689
查看次数

如何向SheetJS .xlsx生成的文件添加单元格边框?

我有一个SheetJS的.xlsx生成的文件,但我一直没能投入bordercells.

我有这个:

在此输入图像描述

我需要这个:

在此输入图像描述

有没有办法做到这一点SheetJS?如果有办法应用其他单元格样式(如背景颜色),那将会很酷.

编辑:

我正在用这个功能制作纸张:

function makeSheet(wb, day){        //sheet for a specific day
    var ws = XLSX.utils.table_to_sheet(document.getElementById("table"+day));
    wb.SheetNames.push(day);
    wb.Sheets[day] = ws;
    //columns width working ok
    wb["Sheets"][day]["!cols"] = [{ wpx : 70 },{ wpx : 121 }];
    //wb["Sheets"][day]["A1"]["s"] = {"border":"1px"};  //I've tried this but doesn't work
  return wb;
}
Run Code Online (Sandbox Code Playgroud)

编辑2

我创建了这个示例代码段,如果你可以在这里放置边框和/或其他单元格样式,那将是一个胜利:

$(document).ready(myMain);
function myMain(){
  $(document).on("click","#btnexcel", function(){makeExcel()});
}
function s2ab(s) {
  var buf = new ArrayBuffer(s.length);
  var view = new Uint8Array(buf);
  for …
Run Code Online (Sandbox Code Playgroud)

javascript sheetjs

11
推荐指数
1
解决办法
3915
查看次数

Ionic socialSharing插件无法在iOS上运行

Ionic社交共享插件无法在iOS上运行.错误响应返回"不可用".在Android上它按预期工作.我做错了吗?

// share functions parse accepts 'app' parameter
this.socialSharing.canShareVia(app, this.property.heading, '', '', this.property.link).then(res => {
      this.socialSharing.shareVia(app, this.property.heading, '', '', this.property.link);
}).catch(res => {
      this.gApp.hideLoading();
      this.gApp.showAlert('error', res);
});

// app name is parsed from html
<a (click)="shareVia('facebook')">facebook</a>
...    
<a (click)="shareVia('viber')">viber</a>
Run Code Online (Sandbox Code Playgroud)

cordova typescript ionic-framework cordova-plugins ionic3

11
推荐指数
1
解决办法
1641
查看次数

确定WebView是否仅使用JS是不可见的

我有一个带有webView的Android测试应用程序,如下所示:

<WebView
        android:alpha="0"
        android:id="@+id/myWebView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
Run Code Online (Sandbox Code Playgroud)

我的主要活动加载了一个我运行JS内容的页面.使用JS启用JS:

webSettings.setJavaScriptEnabled(true);
Run Code Online (Sandbox Code Playgroud)

我的应用程序上有一个按钮,可以将alpha值从0切换为1(显示/隐藏webView).

是否有任何"创造性"方式来检测JS方面的变化?

我试过的事情:

更新:

澄清,我正在寻找一个JS Only解决方案,实际的JS代码是在WebView环境中使用的SDK.

我无法控制Android应用程序,完全控制WebView内容.

javascript android alpha google-chrome android-webview

11
推荐指数
1
解决办法
624
查看次数

Cordova - Android上的自适应图标

我使用Android Image Asset Studio生成了一组图标.但是,我不知道如何将这些图标设置到我的应用程序中Cordova.

在遵循Cordova中有关图标文档时,我只设法使用以下代码将方形图标设置为我的项目:

<platform name="android">
    <!--
        ldpi    : 36x36 px
        mdpi    : 48x48 px
        hdpi    : 72x72 px
        xhdpi   : 96x96 px
        xxhdpi  : 144x144 px
        xxxhdpi : 192x192 px
    -->
    <icon src="res/android/ldpi.png" density="ldpi" />
    <icon src="res/android/mdpi.png" density="mdpi" />
    <icon src="res/android/hdpi.png" density="hdpi" />
    <icon src="res/android/xhdpi.png" density="xhdpi" />
    <icon src="res/android/xxhdpi.png" density="xxhdpi" />
    <icon src="res/android/xxxhdpi.png" density="xxxhdpi" />
</platform>
Run Code Online (Sandbox Code Playgroud)

但是,在Android Oreo中,应用程序的图标是圆形的,它不能在该手机上正确显示我的应用程序图标.图标在圆圈内缩小,周围有白色背景.

在此输入图像描述

问题:如何将Image Asset Studio生成的圆形图标设置为Cordova项目?

icons android fill cordova

11
推荐指数
1
解决办法
3163
查看次数

哪些三星设备不支持Android的原生指纹API?

我假设在marshmallow支持指纹API之前没有带OS的手机.

我的问题是:

(a)使用棉花糖发布的所有/任何三星手机都支持android指纹API

(b)操作系统升级为棉花糖的三星手机是否支持Android指纹API?

我读过这些:

在Samsung S5上使用Android 6.0 Fingerprint API时未检测到指纹扫描程序

三星galaxy note 4指纹未找到

对于Samsung Note 4,Android FingerPrint API isHardwareDetected返回false

指纹传感器6.0以上的设备未使用Android指纹SDK

但没有明确的答案.三星的网站还提到所有三星设备都支持Pass SDK,但没有提到android指纹API支持

android version hardware-interface samsung-mobile-sdk android-fingerprint-api

10
推荐指数
1
解决办法
1979
查看次数

如何构建Cordova 8.x cordova.jar以包含在现有的Android应用程序中?

我这个文件:

Cordova文档

我在这里克隆了最新的Cordova:https://github.com/apache/cordova-android

但是,当我按照文档中的描述运行"ant jar"时,我收到此错误:

cordova-android-master/framework/build.xml:124:找不到从/ Users/me/cordova-android-master/framework/build导入的/Users/neigaard/Library/Android/sdk/tools/ant/build.xml .XML

谷歌说这是因为ant/build.xml从Android SDK中删除了.我发现一篇帖子说我应该下载一个旧的Android SDK工具并用它替换我的SDK工具文件夹,但我依靠我的Android SDK工作和更新.

如果没有过时的Android SDK,有没有办法构建Cordova Android jar,或者在某个地方我可以下载预先构建的jar,还是有另一种方法将Cordova集成到现有的Android应用程序中?

android cordova

10
推荐指数
1
解决办法
569
查看次数

文章中h1和h2的字体大小相同

问题:

为什么<h1><h2>标签font-size放在一起<article>

输出:

在此输入图像描述

然后我想也许只是我的眼睛愚弄我所以我测量了它.

在此输入图像描述

我原来是相同的大小.

我看了看下面的链接(http://w3c.github.io/html/rendering.html#sections-and-headings)我才知道,那是基于层次结构,但<h1><h2>上层次的同一级别.

因此,<h1>应该是2em,<h2>应该是1.5em.

码:

<!DOCTYPE html>
<html>
    <head>
        <title>Headings</title>
        <meta charset="utf-8">
    </head>
    <body>
        <article>
            <h1>This is h1.</h1>
            <h2>This is h2.</h2>
            <h3>This is h3.</h3>
            <h4>This is h4.</h4>
            <h5>This is h5.</h5>
            <h6>This is h6.</h6>
        </article>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

html css html5 html-heading

9
推荐指数
2
解决办法
4186
查看次数

AngularJS-Ionic:创建一个可滑动的horizo​​natlview,它将更新垂直视图

我想使用angularjs和ionic为Android和iOS创建一个UI.查看如下: 在此输入图像描述

说明:在此视图中,我希望包含一个水平条带(当前显示1到8个日期,但可以从月份的第1天到月的最后一天可以刷卡)包含日期.该条带可左右滑动.每天都会有一些数据显示在垂直列表视图中.当用户在水平条带上向左或向右滑动时,垂直数据将会更新.垂直列表视图将仅显示水平条带中显示的日期数据.

我不知道我怎么做.任何指针,例如库/示例代码等都将非常感激.

谢谢

html javascript jquery angularjs ionic-framework

9
推荐指数
1
解决办法
258
查看次数

为什么`android:foreground`属性不起作用?

看看这个小的Android应用程序:

MainActivity.java:

package io.github.gsaga.toucheventtest;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}
Run Code Online (Sandbox Code Playgroud)

activity_main:

<ImageView android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:foreground="@drawable/ic_launcher_background"
    xmlns:android="http://schemas.android.com/apk/res/android" />
Run Code Online (Sandbox Code Playgroud)

指示的图像android:foreground不会显示,但如果我更改foregroundsrcbackground中,则会显示activity_main.xml.此代码似乎遵循此处描述的说明:

https://developer.android.com/reference/android/view/View.html#attr_android:foreground

为什么android:foreground标签在上面的代码中不起作用?

注意:

minSdkVersion是的19,我正在运行这个应用程序Android 5.1(API level 22)

xml android android-layout

9
推荐指数
2
解决办法
6784
查看次数