In Java application, how to load native library which depends on the third shared library

by Jiang » Wed, 26 Aug 2009 13:47:00 GMT


Sponsored Links
 Hello, guys.

I created a jni library which depends the third shared library, I must copy the 
third shared library to /system/lib, otherwise, Java application can't load jni 
library. But you know, on G1 with official OS image, /system/lib is readonly. I 
tried to call System.setProperty to set java.library.path to the location 
stored the thired shared library before load jni library, but the issue still 
exists.

Is there any one konw how to solve this issue? Thanks a lot.

BR,
- Jiang



      ___________________________________________________________ 
  
 http://card.mail.cn.yahoo.com/ 
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. start AlertDialog from AppWidgetProvider

Anyone know if it is possible to add AlertDialog within a
AppWidgetProvider class?

Here is the code I am working on where I start the AlertDialog on
onEnabled function call.

@Override
        public void onEnabled(Context context) {
        super.onEnabled(context);
        Log.v(TAG,"onEnabledWidget");
        AlertDialog.Builder builder = new
AlertDialog.Builder(context).setIcon(
                 android.R.drawable.ic_dialog_info
                 ).setTitle(R.string.app_name)
                 .setMessage("This is testing")
                 .setNeutralButton("Confirm",
                 new DialogInterface.OnClickListener() {
                         public void onClick(DialogInterface dialog, int id) {
                                 }
                 });
        alertNotSmc = builder.create();
                alertNotSmc.show();
        //runs when all of the first instance of the widget are placed
        //on the home screen


        }


08-06 18:07:43.938: ERROR/AndroidRuntime(514): Uncaught handler:
thread main exiting due to uncaught exception
08-06 18:07:44.038: ERROR/AndroidRuntime(514):
java.lang.RuntimeException: Unable to start receiver
com.vaka.select.AppSelectWidget: android.view.WindowManager
$BadTokenException: Unable to add window -- token null is not for an
application
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2604)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.app.ActivityThread.access$3100(ActivityThread.java:119)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1871)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.os.Handler.dispatchMessage(Handler.java:99)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.os.Looper.loop(Looper.java:123)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.app.ActivityThread.main(ActivityThread.java:4310)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
java.lang.reflect.Method.invokeNative(Native Method)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
java.lang.reflect.Method.invoke(Method.java:521)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
dalvik.system.NativeStart.main(Native Method)
08-06 18:07:44.038: ERROR/AndroidRuntime(514): Caused by:
android.view.WindowManager$BadTokenException: Unable to add window --
token null is not for an application
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.view.ViewRoot.setView(ViewRoot.java:472)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.app.Dialog.show(Dialog.java:239)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
com.vaka.select.AppSelectWidget.onEnabled(AppSelectWidget.java:71)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:
73)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
com.vaka.select.AppSelectWidget.onReceive(AppSelectWidget.java:52)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     at
android.app.ActivityThread.handleReceiver(ActivityThread.java:2595)
08-06 18:07:44.038: ERROR/AndroidRuntime(514):     ... 10 more

-- 

2. Are there any LDPI or HDPI devices running 1.5?

Sorry yeah that is what I meant.  Prior to 1.6 the platform did not have any
APIs to deal correctly with different screen sizes, so it is impossible to
build a compatible device with such a screen on 1.5.

It can be confusing because when talking about "what android devices there
are," there are at least two significantly different things:

- An Android device that is compatible according to the CDD, which imposes
significant restrictions and expectations on what such a device can do.
 Android Market will only be available on these types of devices, so people
placing apps on the market only need to worry about such devices.  A ldpi
and hdpi 1.5 device is not compatible with the 1.5 CDD, and thus not
something such developers need to worry about.

- All other Android devices.  Increasingly, if you ask "is there an Android
device X" and include this category, the answer is going to be "yes". :)
 This is basically chaos for app developers.  As a developer, you very
likely want to ignore this world.










> > > 

3. ZoomButtonsController example

4. On multi-accounts setting, LVL returns NOT_LICENSED.

5. Are there any LDPI or HDPI devices running 1.5?

6. Eclipse problems

7. CyaSSL SSL Provider for Android Re leased 鈥?Alpha Version