Multiple pages WBXML support about org.kxml2.wap.WbxmlSerializer in dalvik/libcore/xml/src/main/java/org/kxml2/wap

by Dengxiang . Zhou » Tue, 04 Nov 2008 07:53:07 GMT


Sponsored Links
 Dear friends,

In dalvik/libcore/xml/src/main/java/org/kxml2/wap/
WbxmlSerializer.java, the function

public void setTagTable(int page, String[] tagTable) {

contents these code lines:
        if (page != 0)
            return;

But in the original org/kxml2/wap/WbxmlSerializer.java on
 http://downloads.sourceforge.net/kxml/kxml2-src-2.3.0.zip?modtime=1151079334& ;big_mirror=0,
there is not these lines.

The question is that with these lines, WbxmlSerializer cannot support
multiple pages WBXML.

Could anyone tell me why android add these lines to disable multiple
WBXML pages support?

Best Regards,.
--~--~---------~--~----~------------~-------~--~----~



Multiple pages WBXML support about org.kxml2.wap.WbxmlSerializer in dalvik/libcore/xml/src/main/java/org/kxml2/wap

by Mark Murphy » Tue, 04 Nov 2008 12:56:48 GMT


 


You will have better luck on a mailing list related to the Android 
source code:

 http://source.android.com/discuss 

android-platform, in the "Open source mailing lists", might be the one 
you want.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 

Android Training on the Ranch! -- Mar 16-20, 2009
 http://www.bignerdranch.com/schedule.shtml 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Bug with Android 2.2 Layout Gravity?

I have an app which lays out several ImageViews symmetrically spaced
from the horizontal center of the screen.  To do this I use layout
code like:

<ImageView ... android:layout_gravity="top|center"
android:layout_marginRight="60dip" android:layout_marginTop="80dip"></
ImageView>
<ImageView ... android:layout_gravity="top|center"
android:layout_marginLeft="-60dip" android:layout_marginTop="80dip"></
ImageView>

So I offset one +60dip from the center, and the other -60dip from the
center.  This has worked fine on 9 different emulators I test with,
including Android 1.5, 1.6, and 2.1.  But recently a user complained
that after "a recent upgrade" the layout became messed up.  I tried
every way to replicate this issue with my existing test emulators, but
only until I installed the 2.2 SDK was I able to see it.  I even set
up two identical Nexus One emulators, one with 2.1 and the other with
2.2, and only the 2.2 emulator has this problem with the layout.

My workaround is to use either left or right gravity for all
ImageViews and manually adjust them so they'll be symmetric around the
center. But that's a little more tedious to design as opposed to just
+/-60 dip.

Has anyone else encountered this issue?

-- 

2. Problem with communication between two apps (server[service]-client[activity]-model) via IPC

Hey Developers

im working on this for several days and I have no clue what the
problem is:

Ok first, what I want to do.
I have an app (the service) that includes a native method, which needs
a lot of time. And I have another app (the activity) which shows the
results of this method. For the communication between them I used IPC,
like it is explained in the book I use (Android 2, it is german...:
( ). I tested it in one project where the service is in a separate
process and it worked. But when I start with two separate applications
I got the following errors in logcat:

08-05 09:17:16.399: DEBUG/AndroidRuntime(4736): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
08-05 09:17:16.409: DEBUG/AndroidRuntime(4736): CheckJNI is ON
08-05 09:17:16.730: DEBUG/AndroidRuntime(4736): --- registering native
functions ---
08-05 09:17:18.289: DEBUG/dalvikvm(254): GC_EXPLICIT freed 161
objects / 11384 bytes in 103ms
08-05 09:17:18.359: DEBUG/PackageParser(87): Scanning package: /data/
app/vmdl53892.tmp
08-05 09:17:18.509: INFO/PackageManager(87): Removing non-system
package:test.versuch.fuenf.service
08-05 09:17:18.509: INFO/ActivityManager(87): Force stopping package
test.versuch.fuenf.service uid=10029
08-05 09:17:18.720: DEBUG/PackageManager(87): Scanning package
test.versuch.fuenf.service
08-05 09:17:18.720: INFO/PackageManager(87): Package
test.versuch.fuenf.service codePath changed from /data/app/
test.versuch.fuenf.service-1.apk to /data/app/
test.versuch.fuenf.service-2.apk; Retaining data and using new
08-05 09:17:18.740: INFO/PackageManager(87): /data/app/
test.versuch.fuenf.service-2.apk changed; unpacking
08-05 09:17:18.770: DEBUG/installd(34): DexInv: --- BEGIN '/data/app/
test.versuch.fuenf.service-2.apk' ---
08-05 09:17:19.049: DEBUG/dalvikvm(4745): DexOpt: load 40ms, verify
31ms, opt 4ms
08-05 09:17:19.070: DEBUG/installd(34): DexInv: --- END '/data/app/
test.versuch.fuenf.service-2.apk' (success) ---
08-05 09:17:19.070: WARN/PackageManager(87): Code path for pkg :
test.versuch.fuenf.service changing from /data/app/
test.versuch.fuenf.service-1.apk to /data/app/
test.versuch.fuenf.service-2.apk
08-05 09:17:19.070: WARN/PackageManager(87): Resource path for pkg :
test.versuch.fuenf.service changing from /data/app/
test.versuch.fuenf.service-1.apk to /data/app/
test.versuch.fuenf.service-2.apk
08-05 09:17:19.079: DEBUG/PackageManager(87):   Services:
test.versuch.fuenf.service.mittwochnachtservice
08-05 09:17:19.089: INFO/ActivityManager(87): Force stopping package
test.versuch.fuenf.service uid=10029
08-05 09:17:19.369: INFO/installd(34): move /data/dalvik-cache/
d...@app@test.versuch.fuenf.service-2....@classes.dex -> /data/dalvik-
cache/d...@app@test.versuch.fuenf.service-2....@classes.dex
08-05 09:17:19.369: DEBUG/PackageManager(87): New package installed
in /data/app/test.versuch.fuenf.service-2.apk
08-05 09:17:19.669: INFO/ActivityManager(87): Force stopping package
test.versuch.fuenf.service uid=10029
08-05 09:17:19.930: WARN/RecognitionManagerService(87): no available
voice recognition services found
08-05 09:17:20.209: DEBUG/dalvikvm(87): GC_EXPLICIT freed 6368
objects / 454216 bytes in 148ms
08-05 09:17:20.309: INFO/installd(34): unlink /data/dalvik-cache/
d...@app@test.versuch.fuenf.service-1....@classes.dex
08-05 09:17:20.319: DEBUG/AndroidRuntime(4736): Shutting down VM
08-05 09:17:20.352: DEBUG/dalvikvm(4736): De{*filter*} has detached;
object registry had 1 entries
08-05 09:17:20.379: INFO/AndroidRuntime(4736): NOTE: attach of thread
'Binder Thread #3' failed
08-05 09:17:21.329: DEBUG/AndroidRuntime(4750): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
08-05 09:17:21.329: DEBUG/AndroidRuntime(4750): CheckJNI is ON
08-05 09:17:21.650: DEBUG/AndroidRuntime(4750): --- registering native
functions ---
08-05 09:17:22.990: INFO/ActivityManager(87): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10000000
cmp=test.versuch.fuenf/.mittwochnacht }
08-05 09:17:23.149: DEBUG/AndroidRuntime(4750): Shutting down VM
08-05 09:17:23.199: DEBUG/dalvikvm(4750): De{*filter*} has detached;
object registry had 1 entries
08-05 09:17:23.219: INFO/ActivityManager(87): Start proc
test.versuch.fuenf for activity test.versuch.fuenf/.mittwochnacht:
pid=4758 uid=10030 gids={}
08-05 09:17:23.269: INFO/AndroidRuntime(4750): NOTE: attach of thread
'Binder Thread #3' failed
08-05 09:17:24.199: WARN/dalvikvm(4758): Unable to resolve superclass
of Ltest/versuch/fuenf/mittwochnacht$2; (29)
08-05 09:17:24.199: WARN/dalvikvm(4758): Link of class 'Ltest/versuch/
fuenf/mittwochnacht$2;' failed
08-05 09:17:24.209: ERROR/dalvikvm(4758): Could not find class
'test.versuch.fuenf.mittwochnacht$2', referenced from method
test.versuch.fuenf.mittwochnacht.<init>
08-05 09:17:24.209: WARN/dalvikvm(4758): VFY: unable to resolve new-
instance 27 (Ltest/versuch/fuenf/mittwochnacht$2;) in Ltest/versuch/
fuenf/mittwochnacht;
08-05 09:17:24.219: DEBUG/dalvikvm(4758): VFY: replacing opcode 0x22
at 0x000a
08-05 09:17:24.229: DEBUG/dalvikvm(4758): VFY: dead code 0x000c-0011
in Ltest/versuch/fuenf/mittwochnacht;.<init> ()V
08-05 09:17:24.229: WARN/dalvikvm(4758): VFY: unable to find class
referenced in signature (Ltest/versuch/fuenf/service/IServiceRemote;)
08-05 09:17:24.249: WARN/dalvikvm(4758): VFY: unable to find class
referenced in signature (Ltest/versuch/fuenf/service/IServiceRemote;)
08-05 09:17:24.249: WARN/dalvikvm(4758): VFY: unable to find class
referenced in signature (Ltest/versuch/fuenf/service/
IServiceCallback;)
08-05 09:17:24.259: INFO/dalvikvm(4758): Could not find method
test.versuch.fuenf.service.IServiceRemote.getnativeStringAsynchron,
referenced from method test.versuch.fuenf.mittwochnacht.onClick
08-05 09:17:24.259: WARN/dalvikvm(4758): VFY: unable to resolve
interface method 33: Ltest/versuch/fuenf/service/
IServiceRemote;.getnativeStringAsynchron ()V
08-05 09:17:24.270: DEBUG/dalvikvm(4758): VFY: replacing opcode 0x72
at 0x0022
08-05 09:17:24.279: INFO/dalvikvm(4758): Could not find method
test.versuch.fuenf.service.IServiceRemote.getnativeString, referenced
from method test.versuch.fuenf.mittwochnacht.onClick
08-05 09:17:24.289: WARN/dalvikvm(4758): VFY: unable to resolve
interface method 32: Ltest/versuch/fuenf/service/
IServiceRemote;.getnativeString ()Ljava/lang/String;
08-05 09:17:24.299: DEBUG/dalvikvm(4758): VFY: replacing opcode 0x72
at 0x004e
08-05 09:17:24.299: DEBUG/dalvikvm(4758): VFY: dead code 0x0051-0054
in Ltest/versuch/fuenf/mittwochnacht;.onClick (Landroid/view/View;)V
08-05 09:17:24.309: INFO/dalvikvm(4758): Could not find method
test.versuch.fuenf.service.IServiceRemote$Stub.asInterface, referenced
from method test.versuch.fuenf.mittwochnacht$1.onServiceConnected
08-05 09:17:24.309: WARN/dalvikvm(4758): VFY: unable to resolve static
method 31: Ltest/versuch/fuenf/service/IServiceRemote
$Stub;.asInterface (Landroid/os/IBinder;)Ltest/versuch/fuenf/service/
IServiceRemote;
08-05 09:17:24.321: DEBUG/dalvikvm(4758): VFY: replacing opcode 0x71
at 0x000b
08-05 09:17:24.329: DEBUG/dalvikvm(4758): VFY: dead code 0x000e-002a
in Ltest/versuch/fuenf/mittwochnacht$1;.onServiceConnected (Landroid/
content/ComponentName;Landroid/os/IBinder;)V
08-05 09:17:24.339: WARN/dalvikvm(4758): VFY: unable to find class
referenced in signature (Ltest/versuch/fuenf/service/IServiceRemote;)
08-05 09:17:24.339: WARN/dalvikvm(4758): VFY: unable to find class
referenced in signature (Ltest/versuch/fuenf/service/
IServiceCallback;)
08-05 09:17:24.349: INFO/dalvikvm(4758): Could not find method
test.versuch.fuenf.service.IServiceRemote.killCallback, referenced
from method test.versuch.fuenf.mittwochnacht$1.onServiceDisconnected
08-05 09:17:24.349: WARN/dalvikvm(4758): VFY: unable to resolve
interface method 34: Ltest/versuch/fuenf/service/
IServiceRemote;.killCallback (Ltest/versuch/fuenf/service/
IServiceCallback;)V
08-05 09:17:24.359: DEBUG/dalvikvm(4758): VFY: replacing opcode 0x72
at 0x0015
08-05 09:17:24.359: DEBUG/AndroidRuntime(4758): Shutting down VM
08-05 09:17:24.359: WARN/dalvikvm(4758): threadid=1: thread exiting
with uncaught exception (group=0x4001d7f0)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758): FATAL EXCEPTION: main
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):
java.lang.NoClassDefFoundError: test.versuch.fuenf.mittwochnacht$2
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
test.versuch.fuenf.mittwochnacht.<init>(mittwochnacht.java:79)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
java.lang.Class.newInstanceImpl(Native Method)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
java.lang.Class.newInstance(Class.java:1429)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2577)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.os.Handler.dispatchMessage(Handler.java:99)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.os.Looper.loop(Looper.java:123)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
java.lang.reflect.Method.invokeNative(Native Method)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
java.lang.reflect.Method.invoke(Method.java:521)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-05 09:17:24.389: ERROR/AndroidRuntime(4758):     at
dalvik.system.NativeStart.main(Native Method)
08-05 09:17:24.409: WARN/ActivityManager(87):   Force finishing
activity test.versuch.fuenf/.mittwochnacht
08-05 09:17:24.920: WARN/ActivityManager(87): Activity pause timeout
for HistoryRecord{43da6a78 test.versuch.fuenf/.mittwochnacht}
08-05 09:17:31.199: DEBUG/dalvikvm(383): GC_EXPLICIT freed 88
objects / 4320 bytes in 153ms
08-05 09:17:35.837: WARN/ActivityManager(87): Activity destroy timeout
for HistoryRecord{43da6a78 test.versuch.fuenf/.mittwochnacht}
08-05 09:17:36.139: DEBUG/dalvikvm(254): GC_EXPLICIT freed 106
objects / 4768 bytes in 88ms
08-05 09:22:24.429: INFO/Process(4758): Sending signal. PID: 4758 SIG:
9
08-05 09:22:24.500: INFO/ActivityManager(87): Process
test.versuch.fuenf (pid 4758) has died.
08-05 09:22:24.530: WARN/InputManagerService(87): Window already
focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@43f1ec90

test.versuch.fuenf.service is the package of the service
test.versuch.fuenf is the package of the activity
the service is called mittwochnachtservice
and the activity mittwochnacht

Here is the code from my activity:
public class mittwochnacht extends Activity implements OnClickListener
{
        private IServiceRemote mService;
        private ServiceConnection mServiceConnection = new ServiceConnection()
{
                public void onServiceConnected(ComponentName className,IBinder
binder) {
                        mService = IServiceRemote.Stub.asInterface(binder);
                        try{
                                mService.registerCallback(serviceCallback);     
}
                        catch(RemoteException e){       }
                }
                @Override
                public void onServiceDisconnected(ComponentName name){
                        try{
                                mService.killCallback(serviceCallback);}
                        catch(RemoteException e){       }
                }
        };
        private final IServiceCallback serviceCallback = new
IServiceCallback.Stub() {
                @Override
                public void nativeString(String strong) throws RemoteException {
                        txtResult.setText(strong);
                }
        };
    @Override
    public void onCreate(Bundle savedInstanceState)    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        txtResult = (TextView) findViewById(R.id.txt_ergebnis);

        bindService(new
Intent("test.versuch.fuenf.service.intent.action.GET_NATIVE_STRING"),
mServiceConnection,Context.BIND_AUTO_CREATE);
//GET_NATIVE_STRING is defined in my manifestfile for the service
    }
}

and this is my service

public class mittwochnachtservice extends Service{
        private static Manager manager= new Manager(); //manages the native
code
        private final RemoteCallbackList<IServiceCallback> callbacks = new
RemoteCallbackList<IServiceCallback>();
        private final IServiceRemote.Stub mBinder = new IServiceRemote.Stub()
{
                public String getnativeString() throws RemoteException          
{
                        final String teststring = manager.stringFromJNI();
                        return teststring;
                }
                @Override
                public void getnativeStringAsynchron() throws RemoteException   
{
                        final int countCallbacks=callbacks.beginBroadcast();
                        for(int i = 0; i<countCallbacks;i++){
                                try{
        
callbacks.getBroadcastItem(i).nativeString(manager.stringFromJNI());}
                                catch(RemoteException e){       }
                                callbacks.finishBroadcast();
                        }
                }
                @Override
                public void killCallback(IServiceCallback callback)     throws
RemoteException {
                        if(callback!=null){
                                callbacks.unregister(callback);
                        }
                }
                @Override
                public void registerCallback(IServiceCallback callback) throws
RemoteException {
                        if(callback!=null)      {
                                callbacks.register(callback);
                        }
                }
        };
        @Override
        public IBinder onBind(Intent intent) {
                return mBinder;
        }
}

and the two aidl files:

package test.versuch.fuenf.service;

import test.versuch.fuenf.service.IServiceCallback;

interface IServiceRemote{
        String getnativeString();
        oneway void getnativeStringAsynchron();
        void registerCallback(IServiceCallback callback);
        void killCallback(IServiceCallback callback);
}

________

package test.versuch.fuenf.service;

interface IServiceCallback{
        void nativeString(in String strong);
}


It already crashes without calling one of the methods of the
interface... If I comment the "private ServiceConnection
mServiceConnection = new ServiceConnection(){.." and the "private
final IServiceCallback serviceCallback = new
IServiceCallback.Stub()..." it is showing me my activity. with this
methods it crashes...

Can you help me?

Thanks for you help

M4271N

-- 

3. Figuring out Google Checkout

4. Mod: Pre-order HTC Desire + Wildfire untuk member id-android

5. Nexus One 2n

6. Texturing a square with OpenGL ES

7. Looking for Android Developer