how to make library for another application to use

by cindy » Mon, 19 Jul 2010 15:33:25 GMT


Sponsored Links
 Hi friend,

I need to provide some SDK as third party library for other
applications. We don't want to open our source code. How could make a
jar file?

Thanks!
Cindy

--



Other Threads

1. Froyo Error

I am trying to bring-up Froyo on a custom board. I am not able to make
much sense of the error here. Could someone please give me any hints ?

E/AndroidRuntime(  673): *** FATAL EXCEPTION IN SYSTEM PROCESS:
android.server.ServerThread
E/AndroidRuntime(  673): java.lang.UnsatisfiedLinkError: native_update
E/AndroidRuntime(  673):        at
com.android.server.BatteryService.native_update(Native Method)
E/AndroidRuntime(  673):        at
com.android.server.BatteryService.update(BatteryService.java:208)
E/AndroidRuntime(  673):        at
com.android.server.BatteryService.<init>(BatteryService.java:134)
E/AndroidRuntime(  673):        at
com.android.server.ServerThread.run(SystemServer.java:146)
I/Process (  673): Sending signal. PID: 673 SIG: 9
E/AndroidRuntime(  673): Error reporting crash
E/AndroidRuntime(  673): java.lang.NullPointerException
E/AndroidRuntime(  673):        at
android.os.DropBoxManager.isTagEnabled(DropBoxManager.java:287)
E/AndroidRuntime(  673):        at
com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:
9190)
E/AndroidRuntime(  673):        at
com.android.server.am.ActivityManagerService.handleApplicationCrash(ActivityManagerService.java:
9101)
E/AndroidRuntime(  673):        at com.android.internal.os.RuntimeInit
$UncaughtHandler.uncaughtException(RuntimeInit.java:76)
E/AndroidRuntime(  673):        at
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887)
E/AndroidRuntime(  673):        at
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884)
I/ServiceManager(  574): service 'activity' died
I/ServiceManager(  574): service 'batteryinfo' died
I/ServiceManager(  574): service 'entropy' died
I/ServiceManager(  574): service 'SurfaceFlinger' died
I/ServiceManager(  574): service 'package' died
I/ServiceManager(  574): service 'power' died
I/ServiceManager(  574): service 'meminfo' died
I/ServiceManager(  574): service 'cpuinfo' died
I/ServiceManager(  574): service 'permission' died
I/ServiceManager(  574): service 'account' died
I/ServiceManager(  574): service 'content' died
I/ServiceManager(  574): service 'usagestats' died
I/ServiceManager(  574): service 'telephony.registry' died
D/BootAnimation(  683): SurfaceFlinger died, exiting...

-- 

2. EditText setWidth upon orientation change fail

I wanted to update my searchBox width display upon device orientation
change.

I tried two options:
1. set res/layout-land/main.xml. I noticed that the layout is loaded
at the beginning of the application properly. However, if I change the
orientation while the application is still running, the layout is not
automatically updated to the correct form.

2. I use a single layout/main.xml, and set searchBox width inside
OrientationEventListener. I noticed that the width of the searchbox is
repainted correctly when I run the application for the first time on
the device (Nexus one), However after I exit the application and
launch the application again, the searchBox width will fail to update
width during orientation change. My debug shows that Edittext
setWidth() and invalidate() were called.  The impact is that when the
application launched in horizontal position and switches to vertical,
the searchBox is NOT shortened as expected.

  public void onCreate(Bundle savedInstanceState) {
   ...
     OrientationEventListener mListener = new OrientationEventListener
(this,
        SensorManager.SENSOR_DELAY_UI) {

            public void onOrientationChanged (int orientation) {

                Configuration cf = getResources().getConfiguration();
                if (lastOrientation!=cf.orientation){

                    lastOrientation = cf.orientation;
                    searchBox.setWidth(getResources().getD
                }
            }
        };
        mListener.enable();
  ...
 }

public void adjustOrientation(){
        Configuration cf = getResources().getConfiguration();
        float scale = getResources().getDisplayMetrics().density;
        try {
            int iconWidth = mSearchIcon.getWidth()>0?
mSearchIcon.getWidth():25;
            int padding  = (int)(30*scale);
 
mSearchBox.setWidth(getResources().getDisplayMetrics().widthPixels-
mAppTitle.getWidth()-iconWidth-padding);
            mSearchBox.invalidate();

            Log.d(LOG_TAG,"padding="+padding+" searchbox="+
(getResources().getDisplayMetrics().widthPixels-mAppTitle.getWidth()-
iconWidth-padding));
          */
            mWebView.loadUrl("javascript:updateOrientation()");
        } catch (Exception e) {
        }
    }

Can anyone advise what is the problem here. Is there any other way to
achieve this?

Thanks,

June Jorgensen

-- 

3. WebSettings cache

4. developing the android xmpp cleint

5. application widget and switching orientation...

6. Create rows and columns at runtime

7. Tutorial to start developing Graphic EQ in C or C++