Ich verwende von hier aus ScanLibrary. Ich habe dies erfolgreich implementiert und es funktioniert auf allen Geräten (z. B. Moto X) außer dem Xiomi MI redmi 3S prime und MI 4i einwandfrei. Ich frage mich, warum es bei Xiomi nicht funktioniert. Ich habe dies auch auf Marshmallow, Lollipop und anderen APIs getestet und es funktioniert auf allen anderen Geräten einwandfrei, nur das Xiomi hat Probleme. Ich habe auch versucht, dies auf ihrer Github-Seite zu melden, habe aber keine Antwort erhalten, daher ist meine letzte Hoffnung Stack Overflow.
Ich erhalte die folgende Ausnahme auf Xiomi-Geräten:
05-18 15:33:33.504 21553-21553/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.vikast.includelibrariesdemo, PID: 21553
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.vikast.includelibrariesdemo-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.vikast.includelibrariesdemo-2/lib/arm64, /data/app/com.example.vikast.includelibrariesdemo-2/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libopencv_java3.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.scanlibrary.ScanActivity.(ScanActivity.java:125)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483)
at android.app.ActivityThread.access$900(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Die Bibliotheksklasse, in der ich die Fehlermeldung erhalte: ScanActivity.java
package com.scanlibrary;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.FragmentTransaction;
import android.content.ComponentCallbacks2;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
/**
* Created by jhansi on 28/03/15.
*/
public class ScanActivity extends Activity implements IScanner, ComponentCallbacks2 {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.scan_layout);
init();
}
private void init() {
PickImageFragment fragment = new PickImageFragment();
Bundle bundle = new Bundle();
bundle.putInt(ScanConstants.OPEN_INTENT_PREFERENCE, getPreferenceContent());
fragment.setArguments(bundle);
android.app.FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.content, fragment);
fragmentTransaction.commit();
}
protected int getPreferenceContent() {
return getIntent().getIntExtra(ScanConstants.OPEN_INTENT_PREFERENCE, 0);
}
@Override
public void onBitmapSelect(Uri uri) {
ScanFragment fragment = new ScanFragment();
Bundle bundle = new Bundle();
bundle.putParcelable(ScanConstants.SELECTED_BITMAP, uri);
fragment.setArguments(bundle);
android.app.FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.content, fragment);
fragmentTransaction.addToBackStack(ScanFragment.class.toString());
fragmentTransaction.commit();
}
@Override
public void onScanFinish(Uri uri) {
ResultFragment fragment = new ResultFragment();
Bundle bundle = new Bundle();
bundle.putParcelable(ScanConstants.SCANNED_RESULT, uri);
fragment.setArguments(bundle);
android.app.FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.content, fragment);
fragmentTransaction.addToBackStack(ResultFragment.class.toString());
fragmentTransaction.commit();
}
@Override
public void onTrimMemory(int level) {
switch (level) {
case ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN:
/*
Release any UI objects that currently hold memory.
The user interface has moved to the background.
*/
break;
case ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE:
case ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW:
case ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL:
/*
Release any memory that your app doesn't need to run.
The device is running low on memory while the app is running.
The event raised indicates the severity of the memory-related event.
If the event is TRIM_MEMORY_RUNNING_CRITICAL, then the system will
begin killing background processes.
*/
break;
case ComponentCallbacks2.TRIM_MEMORY_BACKGROUND:
case ComponentCallbacks2.TRIM_MEMORY_MODERATE:
case ComponentCallbacks2.TRIM_MEMORY_COMPLETE:
/*
Release as much memory as the process can.
The app is on the LRU list and the system is running low on memory.
The event raised indicates where the app sits within the LRU list.
If the event is TRIM_MEMORY_COMPLETE, the process will be one of
the first to be terminated.
*/
new AlertDialog.Builder(this)
.setTitle(R.string.low_memory)
.setMessage(R.string.low_memory_message)
.create()
.show();
break;
default:
/*
Release any non-critical data structures.
The app received an unrecognized memory level value
from the system. Treat this as a generic low-memory message.
*/
break;
}
}
public native Bitmap getScannedBitmap(Bitmap bitmap, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
public native Bitmap getGrayBitmap(Bitmap bitmap);
public native Bitmap getMagicColorBitmap(Bitmap bitmap);
public native Bitmap getBWBitmap(Bitmap bitmap);
public native float[] getPoints(Bitmap bitmap);
//========== GETTING ERROR OVER HERE ================//
static {
System.loadLibrary("opencv_java3"); //========== HERE IS THE ERROR ================//
System.loadLibrary("Scanner");
}
}
Ich verwende von hier aus ScanLibrary. Ich habe dies erfolgreich implementiert und es funktioniert auf allen Geräten (z. B. Moto X) außer dem Xiomi MI redmi 3S prime und MI 4i einwandfrei. Ich frage mich, warum es bei Xiomi nicht funktioniert. Ich habe dies auch auf Marshmallow, Lollipop und anderen APIs getestet und es funktioniert auf allen anderen Geräten einwandfrei, nur das Xiomi hat Probleme. Ich habe auch versucht, dies auf ihrer Github-Seite zu melden, habe aber keine Antwort erhalten, daher ist meine letzte Hoffnung Stack Overflow. Ich erhalte die folgende Ausnahme auf Xiomi-Geräten: [code] 05-18 15:33:33.504 21553-21553/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.vikast.includelibrariesdemo, PID: 21553 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.vikast.includelibrariesdemo-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.vikast.includelibrariesdemo-2/lib/arm64, /data/app/com.example.vikast.includelibrariesdemo-2/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libopencv_java3.so" at java.lang.Runtime.loadLibrary(Runtime.java:367) at java.lang.System.loadLibrary(System.java:1076) at com.scanlibrary.ScanActivity.(ScanActivity.java:125) at java.lang.Class.newInstance(Native Method) at android.app.Instrumentation.newActivity(Instrumentation.java:1068) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) at android.app.ActivityThread.access$900(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5441) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628) [/code] Die Bibliotheksklasse, in der ich die Fehlermeldung erhalte: [b]ScanActivity.java[/b] [code]package com.scanlibrary;
private void init() { PickImageFragment fragment = new PickImageFragment(); Bundle bundle = new Bundle(); bundle.putInt(ScanConstants.OPEN_INTENT_PREFERENCE, getPreferenceContent()); fragment.setArguments(bundle); android.app.FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.add(R.id.content, fragment); fragmentTransaction.commit(); }
protected int getPreferenceContent() { return getIntent().getIntExtra(ScanConstants.OPEN_INTENT_PREFERENCE, 0); }
@Override public void onBitmapSelect(Uri uri) { ScanFragment fragment = new ScanFragment(); Bundle bundle = new Bundle(); bundle.putParcelable(ScanConstants.SELECTED_BITMAP, uri); fragment.setArguments(bundle); android.app.FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.add(R.id.content, fragment); fragmentTransaction.addToBackStack(ScanFragment.class.toString()); fragmentTransaction.commit(); }
@Override public void onScanFinish(Uri uri) { ResultFragment fragment = new ResultFragment(); Bundle bundle = new Bundle(); bundle.putParcelable(ScanConstants.SCANNED_RESULT, uri); fragment.setArguments(bundle); android.app.FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.add(R.id.content, fragment); fragmentTransaction.addToBackStack(ResultFragment.class.toString()); fragmentTransaction.commit(); }
@Override public void onTrimMemory(int level) { switch (level) { case ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN: /* Release any UI objects that currently hold memory.
The user interface has moved to the background. */ break; case ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE: case ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW: case ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL: /* Release any memory that your app doesn't need to run.
The device is running low on memory while the app is running. The event raised indicates the severity of the memory-related event. If the event is TRIM_MEMORY_RUNNING_CRITICAL, then the system will begin killing background processes. */ break; case ComponentCallbacks2.TRIM_MEMORY_BACKGROUND: case ComponentCallbacks2.TRIM_MEMORY_MODERATE: case ComponentCallbacks2.TRIM_MEMORY_COMPLETE: /* Release as much memory as the process can.
The app is on the LRU list and the system is running low on memory. The event raised indicates where the app sits within the LRU list. If the event is TRIM_MEMORY_COMPLETE, the process will be one of the first to be terminated. */ new AlertDialog.Builder(this) .setTitle(R.string.low_memory) .setMessage(R.string.low_memory_message) .create() .show(); break; default: /* Release any non-critical data structures.
The app received an unrecognized memory level value from the system. Treat this as a generic low-memory message. */ break; } }
public native Bitmap getGrayBitmap(Bitmap bitmap);
public native Bitmap getMagicColorBitmap(Bitmap bitmap);
public native Bitmap getBWBitmap(Bitmap bitmap);
public native float[] getPoints(Bitmap bitmap);
//========== GETTING ERROR OVER HERE ================// static { System.loadLibrary("opencv_java3"); //========== HERE IS THE ERROR ================// System.loadLibrary("Scanner"); } } [/code]
Ich habe eine in React Native entwickelte Android-App, bei der es sich um eine WebView handelt.
Die Website verfügt über eine Telefontaste mit einer Tel:123456789-URI, die in den meisten Fällen sehr...
Ich habe eine Elektronen -App mit IPC zwischen dem Hauptprozess und dem Renderer -Prozess. Dies ist kein Produktionsbau. Im Moment versuche ich nur etwas Einfaches zu tun: Zeigen Sie auf der Seite...
Unsere mobile Anwendung scannt kontinuierlich die Daten der IoT -Geräte über Bluetooth. Die Bluetooth -Daten werden im Vordergrund und im Hintergrund gescannt. Diese App kann Bluetooth nicht scannen....
Ich möchte einen BTLE -Scan in einem ViewModel ausführen. Ich bin mir nicht sicher, ob dies der beste Ansatz ist, aber es ist ein gutes Lernexperiment für mich. Ich habe es gelungen, meine BT -Geräte...
Ich habe eine ionische Android -Anwendung, die Daten von drei BLE -Beacon -Sensoren sammelt. Alle zwei Minuten wird der Scan neu gestartet, um das kontinuierliche Scannen zu aktivieren, wenn sich die...