小编Moj*_*ojo的帖子

Docker PostgreSQL 静态数据加密

根据手册,PostgreSQL 支持“数据分区加密”,以便将静态加密的数据存储在系统上。

对于我的下一个应用程序,我想使用 Docker 容器化 PostgreSQL。不幸的是,我没有找到任何选项来加密此 Docker 容器中的数据库文件以保护数据。我想过一些事情,比如当容器在运行时开始解密所有需要的文件时输入密码。

有没有人有这方面的经验?

encryption postgresql docker

7
推荐指数
1
解决办法
773
查看次数

禁用Firebase崩溃报告

我决定将Firebase Crash API 9.0.1包含在我的Android应用中.目前一切正常.现在,我想让我的用户有机会禁用,Firebase会自动发送崩溃报告.

可以使用此代码段禁用Firebase Analytics

FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);
Run Code Online (Sandbox Code Playgroud)

你们中有谁知道类似的方法来禁用崩溃报告吗?

非常感谢

android firebase firebase-crash-reporting

6
推荐指数
2
解决办法
3069
查看次数

Android Fileprovider:无法找到包含的配置根目录

我创建了一个应用程序,用于创建 gpx 文件。除了共享之外,一切正常。因此我创建了一个文件提供程序。您可以在下面看到它的配置。Provider 在我运行 Android 8.0.0 的 android 设备上运行良好,但在朋友 Huawei (6.0) 上它不工作

Fatal Exception: java.lang.IllegalArgumentException
Failed to find configured root that contains /storage/8737-15E4/Android/data/XXX/cache/20171009_171900.gpx
Run Code Online (Sandbox Code Playgroud)

清单中的提供者:

<provider
        android:name=".GenericFileProvider"
        android:authorities="com.package.test.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths" />
    </provider>
Run Code Online (Sandbox Code Playgroud)

文件路径.xml:

<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="external-files" path="/" />
<external-cache-path name="cache-files" path="/" />
</paths>
Run Code Online (Sandbox Code Playgroud)

代码中的用法:

File gpxFile = new File(context.getExternalCacheDir(), "20171009_171900.gpx");    
Uri gpxContentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", gpxFile);

        Intent gpxIntent = new Intent(Intent.ACTION_SEND);
        gpxIntent.setType("text/gpx");

        gpxIntent.putExtra(Intent.EXTRA_STREAM, gpxContentUri);

        Intent programChooser = Intent.createChooser(gpxIntent, context.getString(R.string.select_app_to_share));
        programChooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);

        activityForDialog.startActivity(programChooser);
Run Code Online (Sandbox Code Playgroud)

我希望有人能帮我找到导致应用程序在某些设备上崩溃的错误...

android android-fileprovider

5
推荐指数
1
解决办法
2384
查看次数

MapKit 中 MKMarkerAnnotationView 的彩色图像

我正在为 iOS 构建一个应用程序,它允许用户基于位置存储图像。现在我想使用 iOS 中最新的AnnotationView( MKMarkerAnnotationView) 来实现此目的,因为它提供了自动集群。

我的问题是,这个类需要 aglyphTintColor如果没有提供它设置为UIColor().red. iOS 使用这种颜色来为整个图像着色。之后图像就只有这种颜色。我尝试将其设置glyphTintColor为,nil但这会导致图像变红。我也尝试将其设置为,UIColor(red:1.00, green:1.00, blue:1.00, alpha:0.0)但之后图像消失了,您只能看到标记本身。

我希望标记以原始颜色而不是单色显示图像。

谁能帮我解决这个问题吗?

这是我的完整代码:

func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
    if annotation is MKUserLocation {
        return nil
    }

    let identifier = "PinAnnotationIdentifier"

    var pinView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: identifier)

    pinView?.annotation = annotation
    pinView?.clusteringIdentifier = "clusterId"
    pinView?.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)


    pinView?.canShowCallout = false
    pinView?.glyphImage = UIImage(named: "image")


    return pinView
}
Run Code Online (Sandbox Code Playgroud)

mapkit mkmapview ios mapkitannotation

4
推荐指数
1
解决办法
3801
查看次数

OsmDroid显示当前的LocationIcon无法正常工作

我在我的Android应用程序中使用OSMDroid.一切正常,但我无法显示图标以显示我当前的位置.遵循我的准则:

openMapView = (org.osmdroid.views.MapView) v.findViewById(R.id.openmapview);
openMapView.setClickable(true);

openMapView.setMultiTouchControls(true);
final float scale = getResources().getDisplayMetrics().density;
final int newScale = (int) (256 * scale);
String[] OSMSource = new String[2];
OSMSource[0] = "http://a.tile.openstreetmap.org/";
OSMSource[1] = "http://b.tile.openstreetmap.org/";
XYTileSource MapSource = new XYTileSource(
    "OSM",
    null,
    1,
    18,
    newScale,
    ".png",
    OSMSource
);
openMapView.setTileSource(MapSource);
mapController = (MapController) openMapView.getController();
mapController.setZoom(14);

// My Location Overlay
myLocationoverlay = new MyLocationOverlay(getActivity(), openMapView);
myLocationoverlay.enableMyLocation(); // not on by default
myLocationoverlay.enableCompass();
myLocationoverlay.disableFollowLocation();
myLocationoverlay.setDrawAccuracyEnabled(true);

myLocationoverlay.runOnFirstFix(new Runnable() {
    public void run() {
        mapController.animateTo(myLocationoverlay.getMyLocation());
    }
});
Run Code Online (Sandbox Code Playgroud)

任何人都可以给我一个想法,我要去哪里以及我的代码应该改变什么.

icons android osmdroid currentlocation

3
推荐指数
1
解决办法
3167
查看次数