android & Smack

by Micka » Wed, 25 Jun 2008 00:07:38 GMT


Sponsored Links
 Hi,

i make a program on Android with the librairy smack.


It's work when i want to connect the server, easy !


but when i want t get the ServiceDiscoveryItem , i've a crash
system ... :


Uncaught handler: thread Main exiting due to uncaught exception

java.lang.RuntimeException: Unable to start activity
ComponentInfo{test.msn/test.msn.msn}: java.lang.ClassCastException:
Lorg/jivesoftware/smack/PacketReader$4;

at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1758)

at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1770)

at android.app.ActivityThread.access$1500(ActivityThread.java:99)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
1271)
at android.os.Handler.dispatchMessage(Handler.java:80)
at android.os.Looper.loop(Looper.java:91)

at android.app.ActivityThread.main(ActivityThread.java:3052)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:356)

at android.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1547)

at android.os.ZygoteInit.main(ZygoteInit.java:1445)

at android.dalvik.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: Lorg/jivesoftware/smack/
PacketReader$4;

at
org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryManager.java:
462)
at
org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryManager.java:
426)

at test.msn.msn.onCreate(msn.java:39)

at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
847)

at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1728)

... 11 more


i didn't unserstand!


that is my code to test the connection :

XMPPConnection connexion;

ConnectionConfiguration connConfig = new ConnectionConfiguration(
"xx.xxx.net", 5222);
connexion = new XMPPConnection(connConfig);

try{
connexion.connect();
connexion.login("micka", "micka");
}catch (XMPPException e){

}

ServiceDiscoveryManager serviceDiscoveryManager = new
ServiceDiscoveryManager(
connexion);
try {
serviceDiscoveryManager.discoverItems(connexion.getHost());

// return serviceDiscoveryManager.discoverItems(entityId);
} catch (XMPPException e) {
Log.e("msn","Can't get discovery items for entityId: "+
" : " + e);

} catch(NullPointerException e){

}

the probleme is in the discoveryintems function :(

can you help me ? please !

thank you very much !

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



android & Smack

by Micka » Fri, 27 Jun 2008 01:28:38 GMT


  discovered that the error is here :



smack 3.0.4 :



smack/XMPPConnection.java




if (isFirstInitialization) {
// Notify listeners that a new connection has been established
for (ConnectionCreationListener listener :
connectionEstablishedListeners) {
listener.connectionCreated(this); <== in this line

}
}







can you explain me, what i can do ?



On 24 juin, 17:49, Micka <[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. porting accelerometer sensor

Hi,

I try to port a accelerometer sensor to my target board. Modified a
sensor library base on 
http://android.git.kernel.org/?p=platform/hardware/htc/dream.git;a=tree

Target board can found my sensor(/dev/input/event2) on boot.
"D/SensorManager(  859): found sensor: LIS3LV02D Accelerometer,
handle=0 "
and I can get xyz-data from getevent command, and can read it from
data__poll function in sensor library.

The problem is onSensorChanged in my appication did not be called
while event value is changed. Anythings I need to changed to enable
it?

Thanks for any help!

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. "java.security.NoSuchAlgorithmException: SSLContext SSL implementation not found"

Hi All,
I want to use sslsocket to my application. I am having one certificate
file called "myserver.cer"

Using my code i got all the details about certification file .

Now i created instance for SSLContext like below.

SSLContext sc = SSLContext.getInstance("SSL");

If i used this in my code i got one exception called

"java.security.NoSuchAlgorithmException: SSLContext SSL implementation
not found"

Instead of "SSL" i gave "TLS". Its never show this exception.

But i need to use "SSL" protocal. so how can i solve my problem.

Help me,

Thanks,
Kums.

-- 

3. About intercept sms

4. Query on omap zoom2 MUX - why not in kernel mode

5. Storing image in phone memory - exception

6. TextToSpeech synthesizeToFile() problem

7. Folder Chooser?