JXTA Application on android - java

I am trying to build an app that establishes P2P connection between two wifi enabled android device. I have added JXTA 2.5 library into android 2.2, but don't know where i am going wrong. Ending up with run-time exception: No Class found error and Instance not found error.
Is there anything else to be done apart from just including .jar file into android project ?
Any configuration to be written ? If yes, please let know how i can write configuration file and employ it in my project ? I am working on final year project, so please let me know if you have any pointers regarding this ?
Thanks in advance !
Here is the Log :
04-24 22:41:47.429: I/dalvikvm(556): Could not find method org.apache.log4j.Logger.getLogger, referenced from method net.jxta.peergroup.PeerGroupFactory.<clinit>
04-24 22:41:47.429: W/dalvikvm(556): VFY: unable to resolve static method 8971: Lorg/apache/log4j/Logger;.getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;
04-24 22:41:47.441: D/dalvikvm(556): VFY: replacing opcode 0x77 at 0x0010
04-24 22:41:47.461: W/dalvikvm(556): VFY: unable to resolve static field 4047 (ERROR) in Lorg/apache/log4j/Level;
04-24 22:41:47.461: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x0012
04-24 22:41:47.461: W/dalvikvm(556): VFY: unable to resolve static field 4050 (WARN) in Lorg/apache/log4j/Level;
04-24 22:41:47.461: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x000c
04-24 22:41:47.469: W/dalvikvm(556): VFY: unable to resolve static field 4048 (FATAL) in Lorg/apache/log4j/Level;
04-24 22:41:47.469: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x001a
04-24 22:41:47.469: W/dalvikvm(556): VFY: unable to resolve static field 4048 (FATAL) in Lorg/apache/log4j/Level;
04-24 22:41:47.480: D/dalvikvm(556): VFY: replacing opcode 0x62 at 0x0045

JXTA 2.5 is buggy. Just forget it. I lead release 2.6 and 2.7. We have corrected many issues. I have published a book about it called Practical JXTA II and you can read it online at scribd. It contains examples.
You will probably need a central super peer, unless you only use adhoc connections (broadcasting).

Related

Failed to connect to HTTPS using Retrofit 2 in Android < 21

So, I've tried to connect my API https://api.*****.id that use TLS v1.2 (Let's Encrypt) through my Android.
Everything works as normal when using Android > 20, but when using Android < 21 the android monitor says:
W/dalvikvm: VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
W/dalvikvm: VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
I/dalvikvm: Could not find method java.nio.file.Files.newOutputStream, referenced from method okio.Okio.sink
W/dalvikvm: VFY: unable to resolve static method 23633: Ljava/nio/file/Files;.newOutputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream;
D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
W/dalvikvm: VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
W/dalvikvm: VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
I/dalvikvm: Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
W/dalvikvm: VFY: unable to resolve static method 23632: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
D/dalvikvm: VFY: replacing opcode 0x71 at 0x000a
D/Error: java.net.ConnectException: Failed to connect to api.*****.id/64:ff9b::8b3b:eb77:443
I've implemented the TLSSocketFactory from here https://gist.github.com/fkrauthan/ac8624466a4dee4fd02f
Then have used it something like this:
httpClient = new OkHttpClient.Builder();
ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_2, TlsVersion.TLS_1_1)
.build();
if (Build.VERSION.SDK_INT < 21) {
X509TrustManager trustManager = TLSPatch.systemDefaultTrustManager();
httpClient.sslSocketFactory(new TLSPatch.TLSSocketFactory(), trustManager);
}
httpClient.connectionSpecs(Collections.singletonList(spec))
.readTimeout(60, TimeUnit.SECONDS);
Is anyone have issue something like this?
Whoops, I think, I found the problem.
Because my API uses cipher AES_256_GCM, I think SSL handshake always failed (behind the scene). So, instead uses cipher AES_256_GCM, I changed it to AES_128_GCM.
And this is my config
https://gist.github.com/nmfzone/d175d66752a0c1e1f460fd559b62546f.
Then, my code works properly. Actually, without custom SSLSocketFactory in Android < 21 should also work.

sending a post request from android

I have been struggling for hours now. I have been trying to make a post request from my android application. I figured out that i can't just make a request from the main thread, so i found out that i can put it in a thread runnable. I snooped around for answers tried out a lot of methods people used, that worked for others and none of them worked for me. The one I kind of understood was this one(doesn't work for me):
package com.example.matt.event;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
public class lokacije extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lokacije);
thread.start();
}
Thread thread = new Thread(new Runnable(){
#Override
public void run()
{
HttpClient httpClient = new DefaultHttpClient();
// replace with your url
HttpPost httpPost = new HttpPost("http://www.awesomeholidays.com/login.php");
//Post Data
List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2);
nameValuePair.add(new BasicNameValuePair("username", "123"));
nameValuePair.add(new BasicNameValuePair("password", "456"));
//Encoding POST data
try {
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
} catch (UnsupportedEncodingException e) {
Log.d("omg it doesn't work",e.toString());
e.printStackTrace();
}
//making POST request.
try {
HttpResponse response = httpClient.execute(httpPost);
// write response to log
Log.d("Http Post Response:", response.toString());
} catch (ClientProtocolException e) {
// Log exception
e.printStackTrace();
} catch (IOException e) {
// Log exception
e.printStackTrace();
}
}
});
}
I allowed it to get acces to internet so:
<uses-permission android:name="android.permission.INTERNET"/>
The server side script api works, as i am just using it in a web app.
Can somebody point me in the right direction? I am clueless. Where could be the error? Perhaps the error is in my gradle?(I had to download the http libraries from apache.com and include the in my gradle - had to add a dependency compile 'org.apache.httpcomponents:httpclient:4.5' and a bunch of packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
})Is there an easy way? Also found out about the okhttp library, I'm going to try to implement it, but i'm really not good with gradle and importing foreign libraries.
This is what i get:
11-28 20:49:49.587 10450-10450/? D/dalvikvm: Late-enabling CheckJNI
11-28 20:49:50.008 10450-10450/com.example.matic.eventer W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
11-28 20:49:50.008 10450-10450/com.example.matic.eventer I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.internal.view.WindowCallbackWrapper.onSearchRequested
11-28 20:49:50.008 10450-10450/com.example.matic.eventer W/dalvikvm: VFY: unable to resolve interface method 14051: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
11-28 20:49:50.008 10450-10450/com.example.matic.eventer D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
11-28 20:49:50.018 10450-10450/com.example.matic.eventer I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.internal.view.WindowCallbackWrapper.onWindowStartingActionMode
11-28 20:49:50.018 10450-10450/com.example.matic.eventer W/dalvikvm: VFY: unable to resolve interface method 14055: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
11-28 20:49:50.018 10450-10450/com.example.matic.eventer D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
11-28 20:49:50.238 10450-10450/com.example.matic.eventer I/dalvikvm: Could not find method android.view.ViewGroup.onRtlPropertiesChanged, referenced from method android.support.v7.widget.Toolbar.onRtlPropertiesChanged
11-28 20:49:50.248 10450-10450/com.example.matic.eventer W/dalvikvm: VFY: unable to resolve virtual method 13952: Landroid/view/ViewGroup;.onRtlPropertiesChanged (I)V
11-28 20:49:50.248 10450-10450/com.example.matic.eventer D/dalvikvm: VFY: replacing opcode 0x6f at 0x0007
11-28 20:49:50.268 10450-10450/com.example.matic.eventer I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
11-28 20:49:50.268 10450-10450/com.example.matic.eventer W/dalvikvm: VFY: unable to resolve virtual method 402: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
11-28 20:49:50.268 10450-10450/com.example.matic.eventer D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
11-28 20:49:50.278 10450-10450/com.example.matic.eventer I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
11-28 20:49:50.278 10450-10450/com.example.matic.eventer W/dalvikvm: VFY: unable to resolve virtual method 424: Landroid/content/res/TypedArray;.getType (I)I
11-28 20:49:50.278 10450-10450/com.example.matic.eventer D/dalvikvm: VFY:replacing opcode 0x6e at 0x0002
11-28 20:49:50.438 10450-10450/com.example.matic.eventer D/libEGL: loaded /system/lib/egl/libEGL_mali.so
11-28 20:49:50.458 10450-10450/com.example.matic.eventer D/libEGL: loaded /system/lib/egl/libGLESv1_CM_mali.so
11-28 20:49:50.458 10450-10450/com.example.matic.eventer D/libEGL: loaded /system/lib/egl/libGLESv2_mali.so
11-28 20:49:50.498 10450-10454/com.example.matic.eventer D/dalvikvm: GC_CONCURRENT freed 198K, 9% free 9534K/10375K, paused 3ms+32ms, total 128ms
11-28 20:49:50.518 10450-10450/com.example.matic.eventer D/OpenGLRenderer: Enabling debug mode 0
11-28 20:49:54.722 10450-10450/com.example.matic.eventer E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-28 20:49:54.722 10450-10450/com.example.matic.eventer E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
11-28 20:49:56.514 10450-10583/com.example.matic.eventer D/Http Post Response:: org.apache.http.message.BasicHttpResponse#417e0af0
Please help. :)
All the help is very appreciated.
Not sure about your error.
But for your question :
Is there an easy way? Also found out about the okhttp library,
Comparison of Android Networking Libraries: OkHTTP, Retrofit, Volley is the beautiful post that compares all the available network libraries on every factor. Never think of framing the headers, body and parsing the responses on your own. Also retry, cancel-ongoing-requests, caching etc all are very easily done through libraries. And Retrofit tops on every factor. We are using it and it is good. It supports JSON, XML, Jackson, Moshi, Protobuf and also Wire data formats. All you need to do is to create request Body model classes, and response models. Take a look at Retrofit beginner doc.
OK. First of all thank you all for answering. :) It helped a lot. I just imported the okhttp library into the project and i will work with this from now on. Seems easy enough. Thanks again.
May the code be with you all!
Sincerely,
Matic

Facebook integration - Android - Parse

I am using ParseFacebookUtilsV4-1.9.2.jar and everytime I am facing an error in this line:
ParseFacebookUtils.initialize(this);
The error I am facing is below
... I/dalvikvm﹕ Could not find method com.facebook.FacebookSdk.sdkInitialize, referenced from method com.parse.FacebookAuthenticationProvider.<init>
... I/dalvikvm﹕ Could not find method com.facebook.login.LoginManager.getInstance, referenced from method com.parse.FacebookAuthenticationProvider.authenticateAsync
... W/dalvikvm﹕ VFY: unable to resolve static method 14412: Lcom/facebook/login/LoginManager;.getInstance ()Lcom/facebook/login/LoginManager;
... W/dalvikvm﹕ VFY: unable to resolve static method 14411: Lcom/facebook/FacebookSdk;.sdkInitialize (Landroid/content/Context;I)V
... W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lcom/facebook/AccessToken;)
... I/dalvikvm﹕ Could not find method com.facebook.AccessToken.getUserId, referenced from method com.parse.FacebookAuthenticationProvider.getAuthData
... W/dalvikvm﹕ VFY: unable to resolve virtual method 14406: Lcom/facebook/AccessToken;.getUserId ()Ljava/lang/String;
... I/dalvikvm﹕ Could not find method com.facebook.CallbackManager.onActivityResult, referenced from method com.parse.FacebookAuthenticationProvider.onActivityResult
... W/dalvikvm﹕ VFY: unable to resolve interface method 14409: Lcom/facebook/CallbackManager;.onActivityResult (IILandroid/content/Intent;)Z
... I/dalvikvm﹕ Could not find method com.facebook.login.LoginManager.getInstance, referenced from method com.parse.FacebookAuthenticationProvider.restoreAuthentication
... W/dalvikvm﹕ VFY: unable to resolve static method 14412: Lcom/facebook/login/LoginManager;.getInstance ()Lcom/facebook/login/LoginManager;
... E/dalvikvm﹕ Could not find class 'com.facebook.AccessToken', referenced from method com.parse.FacebookAuthenticationProvider.restoreAuthentication
... W/dalvikvm﹕ VFY: unable to resolve new-instance 1749 (Lcom/facebook/AccessToken;) in Lcom/parse/FacebookAuthenticationProvider;
... I/dalvikvm﹕ Failed resolving Lcom/parse/FacebookAuthenticationProvider$1; interface 1753 'Lcom/facebook/FacebookCallback;'
... W/dalvikvm﹕ Link of class 'Lcom/parse/FacebookAuthenticationProvider$1;' failed
... W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41823700)
... E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.facebook.FacebookSdk
at com.parse.FacebookAuthenticationProvider.<init>(FacebookAuthenticationProvider.java:68)
at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:96)
at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:81)
...
Can anyone help me?
Note: ParseFacebookUtils requires Facebook Android SDK v4.x.x
from Parse docs
Could not find method com.facebook.FacebookSdk.sdkInitialize
This means you need Facebook SDK also. Parse call function from Facebook SDK which is not exist in your project.

Could not find method AdvertisingIdClient.getAdvertisingIdInfo

When trying to run Android project on my Meizu MX3, I get the problem mentioned in topic.
My logcat out is:
04-23 01:05:01.855: I/dalvikvm(18549): Could not find method com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo, referenced from method com.myapp.deviceinfo.AndroidDeviceInfo$1.run
04-23 01:05:01.855: W/dalvikvm(18549): VFY: unable to resolve static method 14581: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;.getAdvertisingIdInfo (Landroid/content/Context;)Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
04-23 01:05:01.855: D/dalvikvm(18549): VFY: replacing opcode 0x71 at 0x0005
04-23 01:05:01.885: W/dalvikvm(18549): VFY: unable to resolve exception class 2144 (Lcom/google/android/gms/common/GooglePlayServicesNotAvailableException;)
04-23 01:05:01.885: W/dalvikvm(18549): VFY: unable to find exception handler at addr 0xa4
04-23 01:05:01.885: W/dalvikvm(18549): VFY: rejected Lcom/myapp/deviceinfo/AndroidDeviceInfo$1;.run ()V
04-23 01:05:01.885: W/dalvikvm(18549): VFY: rejecting opcode 0x0d at 0x00a4
04-23 01:05:01.885: W/dalvikvm(18549): VFY: rejected Lcom/myapp/deviceinfo/AndroidDeviceInfo$1;.run ()V
04-23 01:05:01.885: W/dalvikvm(18549): Verifier rejected class Lcom/myapp/deviceinfo/AndroidDeviceInfo$1;
Any help is going to be appreciated.
It was a big problem that made me stunned for a days.
I had tried all methods, like Proguard editing, changing libraries, context changing, but this solved the problem: simple update to new SDK build version 22.0.1; this fixed the issue.

CircularFifoBuffer crashing after initializing on android app

Tested and it Works on a non android program but immediately crashes after initializing on Android. Log cat isn't producing any error messages either. I found this from CircularFifoBuffer.
Any obvious problems?
Edit: I do get this error message if I add in the jar files into the libs folder (not externally) and then add it to build path. This error isn't present though, if I add the jar files externally.
[2012-08-05 20:56:03 - wifiCollection] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.apache.commons.collections.SequencedHashMap$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is not an inner class.
Edit2:
08-05 21:12:48.837: I//system/bin/batteryd(1189): 1566474 v_bat 3.678 (3.677), i_supply 0.500, i_demand 0.282 => v_bat_idle 3.649 (3.649), level 41% (41%, 41%), state 5
08-05 21:12:50.837: I//system/bin/batteryd(1189): 1568477 v_bat 3.678 (3.677), i_supply 0.500, i_demand 0.282 => v_bat_idle 3.649 (3.649), level 41% (41%, 41%), state 5
08-05 21:12:51.267: I/ActivityManager(1291): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.jimmyc.summer.wificollection/.WiFiLocationApp bnds=[245,418][355,553] }
08-05 21:12:51.337: I/dalvikvm(1374): Jit: resizing JitTable from 4096 to 8192
08-05 21:12:51.353: I/ActivityManager(1291): Start proc com.jimmyc.summer.wificollection for activity com.jimmyc.summer.wificollection/.WiFiLocationApp: pid=1782 uid=10045 gids={1015}
08-05 21:12:51.634: D/dalvikvm(1782): GC_FOR_MALLOC freed 1571 objects / 198264 bytes in 56ms
08-05 21:12:51.751: V/LocationManagerService(1291): _removeUpdates: listener = Receiver{45a6e008 Listener android.os.BinderProxy#45a6e4b8}
08-05 21:12:51.774: V/Tagging(1782): Application starting
08-05 21:12:51.774: V/Tagging(1782): Checking for wifi
08-05 21:12:51.774: V/Tagging(1782): Creating new wifiMode
08-05 21:12:51.782: E/dalvikvm(1782): Could not find class 'org.apache.commons.collections.buffer.CircularFifoBuffer', referenced from method com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.
08-05 21:12:51.782: W/dalvikvm(1782): VFY: unable to resolve new-instance 575 (Lorg/apache/commons/collections/buffer/CircularFifoBuffer;) in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;
08-05 21:12:51.782: D/dalvikvm(1782): VFY: replacing opcode 0x22 at 0x0032
08-05 21:12:51.782: D/dalvikvm(1782): VFY: dead code 0x0034-0041 in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;. (Lcom/jimmyc/summer/wificollection/WiFiLocationApp;)V
08-05 21:12:51.790: I/dalvikvm(1782): Could not find method org.apache.commons.collections.buffer.CircularFifoBuffer.isFull, referenced from method com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.detectStableEnvironment
08-05 21:12:51.790: W/dalvikvm(1782): VFY: unable to resolve virtual method 3504: Lorg/apache/commons/collections/buffer/CircularFifoBuffer;.isFull ()Z
08-05 21:12:51.790: D/dalvikvm(1782): VFY: replacing opcode 0x74 at 0x0006
08-05 21:12:51.790: D/dalvikvm(1782): VFY: dead code 0x0009-0230 in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;.detectStableEnvironment ()Z
08-05 21:12:51.790: I/dalvikvm(1782): Could not find method org.apache.commons.collections.buffer.CircularFifoBuffer.size, referenced from method com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.match
08-05 21:12:51.790: W/dalvikvm(1782): VFY: unable to resolve virtual method 3506: Lorg/apache/commons/collections/buffer/CircularFifoBuffer;.size ()I
08-05 21:12:51.790: D/dalvikvm(1782): VFY: replacing opcode 0x74 at 0x000f
08-05 21:12:51.790: D/dalvikvm(1782): VFY: dead code 0x0012-0227 in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;.match ()Z
08-05 21:12:51.790: I/dalvikvm(1782): Could not find method org.apache.commons.collections.buffer.CircularFifoBuffer.add, referenced from method com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.processResults
08-05 21:12:51.790: W/dalvikvm(1782): VFY: unable to resolve virtual method 3502: Lorg/apache/commons/collections/buffer/CircularFifoBuffer;.add (Ljava/lang/Object;)Z
08-05 21:12:51.790: D/dalvikvm(1782): VFY: replacing opcode 0x6e at 0x0020
08-05 21:12:51.790: D/dalvikvm(1782): VFY: dead code 0x0023-0050 in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;.processResults ()V
08-05 21:12:51.790: D/dalvikvm(1782): VFY: dead code 0x0074-00f0 in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;.processResults ()V
08-05 21:12:51.798: W/dalvikvm(1782): VFY: unable to find class referenced in signature (Lorg/apache/commons/collections/buffer/CircularFifoBuffer;)
08-05 21:12:51.798: I/dalvikvm(1782): Could not find method org.apache.commons.collections.buffer.CircularFifoBuffer.iterator, referenced from method com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.takeAverage
08-05 21:12:51.798: W/dalvikvm(1782): VFY: unable to resolve virtual method 3505: Lorg/apache/commons/collections/buffer/CircularFifoBuffer;.iterator ()Ljava/util/Iterator;
08-05 21:12:51.798: D/dalvikvm(1782): VFY: replacing opcode 0x74 at 0x001b
08-05 21:12:51.798: D/dalvikvm(1782): VFY: dead code 0x001e-0419 in Lcom/jimmyc/summer/wificollection/WiFiLocationApp$wifiMode;.takeAverage (Lorg/apache/commons/collections/buffer/CircularFifoBuffer;)Ljava/util/Map;
08-05 21:12:51.798: W/dalvikvm(1782): VFY: unable to find class referenced in signature (Lorg/apache/commons/collections/buffer/CircularFifoBuffer;)
08-05 21:12:51.798: V/Tagging(1782): Starting WiFi mode
08-05 21:12:51.798: D/AndroidRuntime(1782): Shutting down VM
08-05 21:12:51.806: W/dalvikvm(1782): threadid=1: thread exiting with uncaught exception (group=0x4001d8a8)
08-05 21:12:51.806: E/AndroidRuntime(1782): FATAL EXCEPTION: main
08-05 21:12:51.806: E/AndroidRuntime(1782): java.lang.NoClassDefFoundError: org.apache.commons.collections.buffer.CircularFifoBuffer
08-05 21:12:51.806: E/AndroidRuntime(1782): at com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.(WiFiLocationApp.java:182)
08-05 21:12:51.806: E/AndroidRuntime(1782): at com.jimmyc.summer.wificollection.WiFiLocationApp.onResume(WiFiLocationApp.java:1272)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.Activity.performResume(Activity.java:3823)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3143)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2684)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.os.Handler.dispatchMessage(Handler.java:99)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.os.Looper.loop(Looper.java:123)
08-05 21:12:51.806: E/AndroidRuntime(1782): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-05 21:12:51.806: E/AndroidRuntime(1782): at java.lang.reflect.Method.invokeNative(Native Method)
08-05 21:12:51.806: E/AndroidRuntime(1782): at java.lang.reflect.Method.invoke(Method.java:521)
08-05 21:12:51.806: E/AndroidRuntime(1782): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-05 21:12:51.806: E/AndroidRuntime(1782): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-05 21:12:51.806: E/AndroidRuntime(1782): at dalvik.system.NativeStart.main(Native Method)
08-05 21:12:51.814: W/ActivityManager(1291): Force finishing activity com.jimmyc.summer.wificollection/.WiFiLocationApp
08-05 21:12:52.009: D/dalvikvm(1291): GC_FOR_MALLOC freed 11331 objects / 567768 bytes in 76ms
08-05 21:12:52.314: W/ActivityManager(1291): Activity pause timeout for HistoryRecord{457131f0 com.jimmyc.summer.wificollection/.WiFiLocationApp}
08-05 21:12:52.314: D/Sensors(1291): using MMA7660FC Accelerometer (name=MMA7660FC Accelerometer)
08-05 21:12:52.321: D/Sensors(1291): get_orientation portait device
08-05 21:12:52.431: V/LocationManagerService(1291): _requestLocationUpdates: listener = Receiver{45711848 Listener android.os.BinderProxy#45a461c8}
08-05 21:12:52.840: I//system/bin/batteryd(1189): 1570480 v_bat 3.678 (3.677), i_supply 0.500, i_demand 0.282 => v_bat_idle 3.649 (3.649), level 41% (41%, 41%), state 5
public class test () {
CircularFifoBuffer f1 = null;
CircularFifoBuffer f2 = null;
public test () {
Log.v (TAG, "Starting...");
try {
f1 = new CircularFifoBuffer(4);
f2 = new CircularFifoBuffer(4);
} catch (Exception e) {
e.printStackTrace();
Log.v (TAG, "Error: " +e);
}
}
}
From the logcat output, it looks like the class is not being included in your apk:
08-05 21:12:51.782: E/dalvikvm(1782): Could not find class 'org.apache.commons.collections.buffer.CircularFifoBuffer', referenced from method com.jimmyc.summer.wificollection.WiFiLocationApp$wifiMode.<init>
Add would say your best bet would be to get the source, include it in your project and have it recompiled in your build environment.
Check for jar dependencies of your libraries. You may be missing something. (Doubtful as you say you've tested it outside of Android).
You may need to build from source to get it to work as the jar may be built with a different version of Java (Android supports Java 6 not 7).

Categories