no apps can perform this action in android? - android

I got message "No apps can perform this action" in my testing phone but in tablet, it work fine. My testing phone is android version 4.2.2 and my tablet is android version 4.4.4. Here is my code.
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
String[] mimetypes = {"application/pdf","text/plain","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document"};
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
startActivityForResult(Intent.createChooser(intent, "Select File"), 3);
If I change in something like that,
startActivityForResult(intent, 3);
I got this errors from my phone, but still fine in tablet.
03-12 09:22:40.015: E/test(10739): Exception
03-12 09:22:40.026: E/AndroidRuntime(10739): FATAL EXCEPTION: main
03-12 09:22:40.026: E/AndroidRuntime(10739): java.lang.IllegalStateException: Could not execute method of the activity
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.view.View$1.onClick(View.java:3688)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.view.View.performClick(View.java:4293)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.view.View$PerformClick.run(View.java:17535)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.os.Handler.handleCallback(Handler.java:725)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.os.Handler.dispatchMessage(Handler.java:92)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.os.Looper.loop(Looper.java:153)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.ActivityThread.main(ActivityThread.java:5299)
03-12 09:22:40.026: E/AndroidRuntime(10739): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 09:22:40.026: E/AndroidRuntime(10739): at java.lang.reflect.Method.invoke(Method.java:511)
03-12 09:22:40.026: E/AndroidRuntime(10739): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
03-12 09:22:40.026: E/AndroidRuntime(10739): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
03-12 09:22:40.026: E/AndroidRuntime(10739): at dalvik.system.NativeStart.main(Native Method)
03-12 09:22:40.026: E/AndroidRuntime(10739): Caused by: java.lang.reflect.InvocationTargetException
03-12 09:22:40.026: E/AndroidRuntime(10739): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 09:22:40.026: E/AndroidRuntime(10739): at java.lang.reflect.Method.invoke(Method.java:511)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.view.View$1.onClick(View.java:3683)
03-12 09:22:40.026: E/AndroidRuntime(10739): ... 11 more
03-12 09:22:40.026: E/AndroidRuntime(10739): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT cat=[android.intent.category.OPENABLE] typ=*/* (has extras) }
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1423)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Activity.internalStartActivityForResult(Activity.java:3427)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Activity.access$200(Activity.java:660)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Activity$2.onStartActivity(Activity.java:3417)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Activity.startActivityForBusiness(Activity.java:5441)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Activity.startActivityForResult(Activity.java:3413)
03-12 09:22:40.026: E/AndroidRuntime(10739): at android.app.Activity.startActivityForResult(Activity.java:3367)
That should work in both device and what should I do.Help me, Please.!!

The Intent Intent.ACTION_OPEN_DOCUMENT is only supported on devices with Android 4.4 (KitKat) and above.
Have a look at the Storage Access Framework docs, and specifically the one on ACTION_OPEN_DOCUMENT.

In Android 4.3 or lower, use ACTION_PICK or ACTION_GET_CONTENT as substitude.
In addition, when you invoke build-in "ACTION", you must verify there is more than one activity to receive it, if not your app may crash. Use the following code snippet to do this:
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0);
boolean isIntentSafe = activities.size() > 0;
if (isIntentSafe) {
startActivity(intent);
}

Related

ContentProvider classnotfound after using Proguard

I've got this provider defined in Manifest.
<provider
android:name="com.jon.aqclient.sync.StubProvider"
android:authorities="com.jon.aqclient.provider"
android:exported="false"
android:syncable="true" />
The app package is com.jon.aqclient, and the class is inside sync package, so the class is in com.jon.aqclient.sync.StubProvider. I had the application running perfectly, but after trying Proguard for the first time and mavenizing the project it crashes with a classnotfoundexception.
I've de-mavenized the project, I tried with -keep public class com.jon.aqclient.sync, and now commenting the Proguard line in the project.properties file as follows.
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
# proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
I've cleaned the project and nothing. And a strange thing is that if I change the provider definition in Manifest to StubProviderNew, without any other change, the error is the same, classnotfoundexception com.jon.aqclient.sync.StubProvider, and not StubProviderNew.
Where is the project reading that class name? How can I clear totally these?
Please help!
EDIT:
Stack trace:
03-12 15:04:56.259: E/AndroidRuntime(7506): FATAL EXCEPTION: main
03-12 15:04:56.259: E/AndroidRuntime(7506): java.lang.RuntimeException: Unable to get provider com.jon.aqclient.sync.StubProvider: java.lang.ClassNotFoundException: com.jon.aqclient.sync.StubProvider in loader dalvik.system.PathClassLoader[/system/framework/android.test.runner.jar:/data/app/com.jon.aqclient-2.apk]
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread.installProvider(ActivityThread.java:3709)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread.installContentProviders(ActivityThread.java:3461)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3417)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread.access$2200(ActivityThread.java:123)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:977)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.os.Handler.dispatchMessage(Handler.java:99)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.os.Looper.loop(Looper.java:130)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread.main(ActivityThread.java:3835)
03-12 15:04:56.259: E/AndroidRuntime(7506): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 15:04:56.259: E/AndroidRuntime(7506): at java.lang.reflect.Method.invoke(Method.java:507)
03-12 15:04:56.259: E/AndroidRuntime(7506): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
03-12 15:04:56.259: E/AndroidRuntime(7506): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
03-12 15:04:56.259: E/AndroidRuntime(7506): at dalvik.system.NativeStart.main(Native Method)
03-12 15:04:56.259: E/AndroidRuntime(7506): Caused by: java.lang.ClassNotFoundException: com.jon.aqclient.sync.StubProvider in loader dalvik.system.PathClassLoader[/system/framework/android.test.runner.jar:/data/app/com.jon.aqclient-2.apk]
03-12 15:04:56.259: E/AndroidRuntime(7506): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
03-12 15:04:56.259: E/AndroidRuntime(7506): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
03-12 15:04:56.259: E/AndroidRuntime(7506): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-12 15:04:56.259: E/AndroidRuntime(7506): at android.app.ActivityThread.installProvider(ActivityThread.java:3694)
03-12 15:04:56.259: E/AndroidRuntime(7506): ... 12 more
Pff, I've solved it. It was a Maven thing. I didn't know if was Maven or Proguard, but it where the main changes I did before the error appeared.
Maven changed the default output folder to target/... and not bo bin/classes... so the device couldn't find the classes.
To solve it I had to go to Project->Properties->Source and at the bottom put as Default output folder {project}/bin/classes.

Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE

I am trying to programmatically set the aeroplane mode on.
Settings.System.putInt(context.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
Intent aeroPlaneIntent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
aeroPlaneIntent.putExtra("state", true);
context.sendBroadcast(aeroPlaneIntent);
Setting the Global.AIRPLANE_MODE_ON is failing as if I check the status it returns 0 (OFF)
Trying to broadcast the intent it raises the following exception:
03-12 07:01:18.747: E/AndroidRuntime(1579): java.lang.RuntimeException: Unable to start receiver com.example.toggleaeroplanemode.AeroplaneModeReceiver: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=1579, uid=10050
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2431)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ActivityThread.access$1500(ActivityThread.java:141)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.os.Handler.dispatchMessage(Handler.java:99)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.os.Looper.loop(Looper.java:137)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ActivityThread.main(ActivityThread.java:5103)
03-12 07:01:18.747: E/AndroidRuntime(1579): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 07:01:18.747: E/AndroidRuntime(1579): at java.lang.reflect.Method.invoke(Method.java:525)
03-12 07:01:18.747: E/AndroidRuntime(1579): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
03-12 07:01:18.747: E/AndroidRuntime(1579): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-12 07:01:18.747: E/AndroidRuntime(1579): at dalvik.system.NativeStart.main(Native Method)
03-12 07:01:18.747: E/AndroidRuntime(1579): Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=1579, uid=10050
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.os.Parcel.readException(Parcel.java:1431)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.os.Parcel.readException(Parcel.java:1385)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:2224)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ContextImpl.sendBroadcast(ContextImpl.java:1046)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:344)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:344)
03-12 07:01:18.747: E/AndroidRuntime(1579): at com.example.toggleaeroplanemode.AeroplaneModeReceiver.onReceive(AeroplaneModeReceiver.java:31)
03-12 07:01:18.747: E/AndroidRuntime(1579): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2424)
03-12 07:01:18.747: E/AndroidRuntime(1579): ... 10 more
Is there a way to set the airplane mode ON/OFF?
Please help
For little info:
Use this Permission first..
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
further info: Just check this conversation
The below was tested and verified on Android API 23 & 26 Emulators;
The manifest permission needed is as follows;
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" tools:ignore="ProtectedPermissions"/>
The code is as follows;
boolean turnOnOffAirplaneMode(boolean isTurnOn) {
boolean result = true;
try {
Settings.Global.putInt(context.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, isTurnOn ? 1 : 0);
// The below old code is now not necessary # API Level 23, 26 ...
//Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
//context.sendBroadcast(intent);
} catch (Exception e) {
result = false;
}
return result;
}
The APK should be signed with the relevant platform key for above to work. In the Emulator test, the APK was signed with Google Sign Keys. The keys depend on the OEM of the device.
$ adb shell
$ su
# settings put global airplane_mode_on 0
# am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false

populate expandable listview from sqlite database

This is my first time here in this site. I already did searched the web on how to populate sqlite database into expandable listview but i failed.
I follow
these steps on how to create an expandable listview and modify some codes to make it dynamic.
Here is my modified code. This is only to set parent text on expandable listview:
public void setGroupParents() {
String selectQuery = "select * from " + DbHelper.TABLE_NAME + " ORDER BY "+DbHelperTablon.KEY_FNAME+" ASC ";
SQLiteDatabase db = mHelper.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
if (cursor.moveToFirst()) {
do {
parentItems.add(cursor.getString(1));
} while (cursor.moveToNext());
}
cursor.close();
db.close();
return;
}
When i tried to run the emulator, the program crashed.
I am a newbie in android development and i need any help from you experts.. Thanks in advance.
Oh.. im sorry. This is the results of my LogCat... This is only the error portion..
03-12 07:25:10.059: ERROR/AndroidRuntime(367): FATAL EXCEPTION: main
03-12 07:25:10.059: ERROR/AndroidRuntime(367): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Sample/com.Sample.MainListview}: java.lang.NullPointerException
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.os.Handler.dispatchMessage(Handler.java:99)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.os.Looper.loop(Looper.java:123)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.ActivityThread.main(ActivityThread.java:3647)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at java.lang.reflect.Method.invoke(Method.java:507)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at dalvik.system.NativeStart.main(Native Method)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): Caused by: java.lang.NullPointerException
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at com.Sample.MainListview.setGroupParents(MainListview.java:56)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at com.Sample.MainListview.onCreate(MainListview.java:39)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
03-12 07:25:10.059: ERROR/AndroidRuntime(367): ... 11 more
03-12 07:25:12.428: ERROR/InputDispatcher(59): channel '40703be0 com.Sample/com.Sample.Drawer (server)' ~ Consumer closed input channel or an error occurred. events=0x8
03-12 07:25:12.428: ERROR/InputDispatcher(59): channel '40703be0 com.Sample/com.Sample.Drawer (server)' ~ Channel is unrecoverably broken and will be disposed!
well i guess if you initiate the database object outside your class your problem might be solved...

Unfortunately app has stopped error eclipse? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I've created an application in eclipse and it was working fine and then suddenly it keeps giving me the error message 'unfortunately app has stopped' could anyone explain where my problem lies from my log cat report as i am new to this and dont really understand what the log cat means?
03-12 12:31:03.465: D/AndroidRuntime(4997): Shutting down VM
03-12 12:31:03.465: W/dalvikvm(4997): threadid=1: thread exiting with uncaught exception (group=0x416a8930)
03-12 12:31:03.465: E/AndroidRuntime(4997): FATAL EXCEPTION: main
03-12 12:31:03.465: E/AndroidRuntime(4997): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.softwaresearchapp/com.example.softwaresearchapp.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.softwaresearchapp/com.example.softwaresearchapp.SoftwareSearchActivity}; have you declared this activity in your AndroidManifest.xml?
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.os.Handler.dispatchMessage(Handler.java:99)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.os.Looper.loop(Looper.java:137)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-12 12:31:03.465: E/AndroidRuntime(4997): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 12:31:03.465: E/AndroidRuntime(4997): at java.lang.reflect.Method.invoke(Method.java:511)
03-12 12:31:03.465: E/AndroidRuntime(4997): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-12 12:31:03.465: E/AndroidRuntime(4997): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-12 12:31:03.465: E/AndroidRuntime(4997): at dalvik.system.NativeStart.main(Native Method)
03-12 12:31:03.465: E/AndroidRuntime(4997): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.softwaresearchapp/com.example.softwaresearchapp.SoftwareSearchActivity}; have you declared this activity in your AndroidManifest.xml?
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread.resolveActivityInfo(ActivityThread.java:1993)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:285)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:749)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.widget.TabHost.setCurrentTab(TabHost.java:413)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.widget.TabHost.addTab(TabHost.java:240)
03-12 12:31:03.465: E/AndroidRuntime(4997): at com.example.softwaresearchapp.MainActivity.onCreate(MainActivity.java:27)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.Activity.performCreate(Activity.java:5104)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-12 12:31:03.465: E/AndroidRuntime(4997): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-12 12:31:03.465: E/AndroidRuntime(4997): ... 11 more
03-12 12:31:22.666: I/Process(4997): Sending signal. PID: 4997 SIG: 9`
your logcat clearly said
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.softwaresearchapp/com.example.softwaresearchapp.SoftwareSearchActivity}; have you declared this activity in your AndroidManifest.xml?
Add SoftwareSearchActivity into manifest.xml like
<activity
android:name="com.example.softwaresearchapp.SoftwareSearchActivity"
android:configChanges="keyboardHidden|orientation"
android:label="SoftwareSearch"
/>
Look at this line:
3-12 12:31:03.465: E/AndroidRuntime(4997): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.softwaresearchapp/com.example.softwaresearchapp.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.softwaresearchapp/com.example.softwaresearchapp.SoftwareSearchActivity}; have you declared this activity in your AndroidManifest.xml?
Specifically: Unable to find explicit activity class {com.example.softwaresearchapp/com.example.softwaresearchapp.SoftwareSearchActivity}; have you declared this activity in your AndroidManifest.xml?
Well, have you?
Each activity in your app must be declared in the manifest file. I imagine the minimum information you would want to provide would be the name and label e.g.
<activity
android:name=".SoftwareSearchActivity"
android:label="#string/title_activity_software_search"
/>
You are getting ActivityNotFoundException. Please check for Activity entry for com.example.softwaresearchapp.SoftwareSearchActivity in manifest file.

javacv for android

I'm trying to use OpenCV on android
I created my android project, added javacv.jar and iavacpp.jar to the build path, created the lib folder and copied the *.so files from javacv-arm.jar to libs/armeabi.
All jar & *.so files are version 2.4.2.
When I run the app, I created a test button. When it is clicked I'm calling this line:
IplImage image = cvLoadImage("file:///android_asset//"+"pic1.jpg");
and get the following crash
03-12 19:22:12.189: E/AndroidRuntime(4524): FATAL EXCEPTION: main
03-12 19:22:12.189: E/AndroidRuntime(4524): java.lang.ExceptionInInitializerError
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.myapp.MainActivity.runTest(MainActivity.java:260)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.myapp.MainActivity$3.onClick(MainActivity.java:174)
03-12 19:22:12.189: E/AndroidRuntime(4524): at android.view.View.performClick(View.java:4084)
03-12 19:22:12.189: E/AndroidRuntime(4524): at android.view.View$PerformClick.run(View.java:16966)
03-12 19:22:12.189: E/AndroidRuntime(4524): at android.os.Handler.handleCallback(Handler.java:615)
03-12 19:22:12.189: E/AndroidRuntime(4524): at android.os.Handler.dispatchMessage(Handler.java:92)
03-12 19:22:12.189: E/AndroidRuntime(4524): at android.os.Looper.loop(Looper.java:137)
03-12 19:22:12.189: E/AndroidRuntime(4524): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.reflect.Method.invokeNative(Native Method)
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.reflect.Method.invoke(Method.java:511)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-12 19:22:12.189: E/AndroidRuntime(4524): at dalvik.system.NativeStart.main(Native Method)
03-12 19:22:12.189: E/AndroidRuntime(4524): Caused by: java.lang.ExceptionInInitializerError
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.Class.classForName(Native Method)
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.Class.forName(Class.java:217)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacpp.Loader.load(Loader.java:334)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:85)
03-12 19:22:12.189: E/AndroidRuntime(4524): ... 13 more
03-12 19:22:12.189: E/AndroidRuntime(4524): Caused by: java.lang.ExceptionInInitializerError
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.Class.classForName(Native Method)
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.Class.forName(Class.java:217)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacpp.Loader.load(Loader.java:334)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
03-12 19:22:12.189: E/AndroidRuntime(4524): ... 17 more
03-12 19:22:12.189: E/AndroidRuntime(4524): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]: 124 could not load needed library 'libopencv_core.so' for 'libjniopencv_core.so' (load_library[1093]: Library 'libopencv_core.so' not found)
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.Runtime.loadLibrary(Runtime.java:370)
03-12 19:22:12.189: E/AndroidRuntime(4524): at java.lang.System.loadLibrary(System.java:535)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:444)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacpp.Loader.load(Loader.java:368)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacpp.Loader.load(Loader.java:315)
03-12 19:22:12.189: E/AndroidRuntime(4524): at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
03-12 19:22:12.189: E/AndroidRuntime(4524): ... 21 more
03-12 19:22:12.243: D/dalvikvm(4524): GC_CONCURRENT freed 2368K, 16% free 16864K/20039K, paused 12ms+3ms, total 50ms
Am I missing libopencv_core.so? If so, where can I find it built for version 2.4.2?
Thanks!
I'm sure by now you've figured it out. download javacv-0.5-cppjars.zip, inside it extract the contents of opencv-2.4.5-android-arm.jar. you'll find libopencv_core.so in there and several other .so files

Categories

Resources