Unfortunately Android App stopped - android

I/art: Background sticky concurrent mark sweep GC freed 2534(750KB) AllocSpace objects, 2(32KB) LOS objects, 16% free, 1439KB/1723KB, paused 1.210ms total 209.320ms
W/art: Suspending all threads took: 48.938ms
W/MainActivity: onResume
W/art: Suspending all threads took: 33.435ms
I/art: Background partial concurrent mark sweep GC freed 1004(119KB) AllocSpace objects, 0(0B) LOS objects, 41% free, 1448KB/2MB, paused 33.859ms total 111.039ms
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 09-02 18:38:14.477 2286: 2286 D/ ]
HostConnection::get() New Host Connection established 0x7f5d1785eac0, tid 2286
D/Atlas: Validating map...
E/AndroidRuntime: FATAL EXCEPTION: IntentService[]
Process: com.example.user.gcmexample, PID: 2286
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
at com.google.android.gms.iid.zzd.zzdL(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.example.user.gcmexample.GCMRegistrationIntentService.registerGCM(GCMRegistrationIntentService.java:31)
at com.example.user.gcmexample.GCMRegistrationIntentService.onHandleIntent(GCMRegistrationIntentService.java:24)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Enabling debug mode 0
W/EGL_emulation: eglSurfaceAttrib not implemented
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f5d1a94d200, error=EGL_SUCCESS
W/MainActivity: onPause
I/Process: Sending signal. PID: 2286 SIG: 9
Application terminated.
I am working on google cloud messaging with Android. When I am running program, my app not launching and giving error message
Unfortunately "Application name " has stopped.

Related

Interceptor get stuck on it's creation, in POST request

I have a application that need to do a POST request for my server sending a list of item through JSON. But to perform this POST it needs a header configuration with a token auth. When I send the request from the app, on the logcat, it´s possible to see the interceptor instantiation get stuck.
Please, take a look on my code and the logcat debug:
public static Retrofit getServerClient(String token) {
Log.d("DEBUG 1 -> ","getServerClient");
OkHttpClient httpClient;
Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss")
.create();
Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(SERVER_BASE_URL)
.addConverterFactory(GsonConverterFactory.create(gson));
if (token!=null && !TextUtils.isEmpty(token)) {
Log.d("DEBUG 2 -> ","getServerClient needs add header");
httpClient = getHttpClientWithInterceptor(token);
Log.d("DEBUG 8 -> ","getServerClient with headers");
}else {
httpClient = getOkHttpClient();
}
builder.client(httpClient);
Log.d("DEBUG 9 -> ","Return server client");
return builder.build();
}
private static OkHttpClient getHttpClientWithInterceptor(final String token) {
Log.d("DEBUG 3 -> ","Instantiate interceptor");
Interceptor interceptor = new Interceptor() {
#Override
public Response intercept(Chain chain) {
try {
Log.d("DEBUG 4 -> ","Add headers START");
final Request request = chain.request().newBuilder()
.addHeader("Authorization", "Bearer "+token)
.addHeader("Content-Type", "application/json")
.build();
Log.d("DEBUG 5 -> ","Add headers END");
return chain.proceed(request);
}catch (Exception e){
Log.d("DEBUG 6 -> ","Failure on request build");
e.printStackTrace();
return null;
}
}
};
OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
httpClient.addNetworkInterceptor(interceptor);
Log.d("DEBUG 7 -> ","Return client with interceptor");
return httpClient.build();
}
What is weird in the GET request it works as you can see:
10-30 09:40:16.081 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 1 ->: getServerClient
10-30 09:40:16.097 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 2 ->: getServerClient needs add header
10-30 09:40:16.097 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 3 ->: Instantiate interceptor
10-30 09:40:16.103 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 7 ->: Return client with interceptor
10-30 09:40:16.104 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 8 ->: getServerClient with headers
10-30 09:40:16.104 8379-8379/br.com.vegait.android.hotelexperience D/DEBUG 9 ->: Return server client
10-30 09:40:16.193 8379-8425/br.com.vegait.android.hotelexperience D/EGL_emulation: eglMakeCurrent: 0xa39a67a0: ver 2 0 (tinfo 0xa39ef300)
10-30 09:40:16.256 8379-8455/br.com.vegait.android.hotelexperience D/DEBUG 4 ->: Add headers START
10-30 09:40:16.256 8379-8455/br.com.vegait.android.hotelexperience D/DEBUG 5 ->: Add headers END
But on the POST it drops on a loops as the follow log:
10-30 09:45:56.882 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 1 ->: getServerClient
10-30 09:45:56.897 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 2 ->: getServerClient needs add header
10-30 09:45:56.897 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 3 ->: Instantiate interceptor
10-30 09:45:56.901 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 7 ->: Return client with interceptor
10-30 09:45:56.902 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 8 ->: getServerClient with headers
10-30 09:45:56.902 12054-12054/br.com.vegait.android.hotelexperience D/DEBUG 9 ->: Return server client
10-30 09:45:56.920 12054-12059/br.com.vegait.android.hotelexperience I/art: Do partial code cache collection, code=30KB, data=26KB
10-30 09:45:56.921 12054-12059/br.com.vegait.android.hotelexperience I/art: After code cache collection, code=29KB, data=26KB
10-30 09:45:56.921 12054-12059/br.com.vegait.android.hotelexperience I/art: Increasing code cache capacity to 128KB
10-30 09:45:56.994 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.348ms
10-30 09:45:57.005 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.870ms
10-30 09:45:57.412 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 47547(884KB) AllocSpace objects, 6(120KB) LOS objects, 3% free, 18MB/19MB, paused 5.274ms total 17.663ms
10-30 09:45:57.928 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.320ms
10-30 09:45:57.934 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 175307(3MB) AllocSpace objects, 22(576KB) LOS objects, 16% free, 15MB/18MB, paused 6.735ms total 28.375ms
10-30 09:45:58.380 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.855ms
10-30 09:45:58.388 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 149517(2MB) AllocSpace objects, 18(572KB) LOS objects, 18% free, 17MB/21MB, paused 9.750ms total 35.467ms
10-30 09:45:58.493 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.182ms
10-30 09:45:58.555 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.622ms
10-30 09:45:58.563 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 180086(3MB) AllocSpace objects, 17(548KB) LOS objects, 14% free, 18MB/21MB, paused 9.906ms total 36.522ms
10-30 09:45:58.569 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.073ms
10-30 09:45:58.718 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 8.127ms
10-30 09:45:58.726 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 151954(2MB) AllocSpace objects, 17(604KB) LOS objects, 17% free, 19MB/23MB, paused 9.878ms total 43.588ms
10-30 09:45:58.732 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.808ms
10-30 09:45:58.995 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.158ms
10-30 09:45:59.277 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.132ms
10-30 09:45:59.640 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.369ms
10-30 09:45:59.981 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.514ms
10-30 09:45:59.994 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 186259(3MB) AllocSpace objects, 13(572KB) LOS objects, 10% free, 24MB/27MB, paused 14.243ms total 54.366ms
10-30 09:46:00.003 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.053ms
10-30 09:46:00.190 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.135ms
10-30 09:46:00.397 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 8.317ms
10-30 09:46:00.508 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.196ms
10-30 09:46:00.576 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 5.746ms
10-30 09:46:00.763 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.054ms
10-30 09:46:00.936 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.152ms
10-30 09:46:01.014 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.358ms
10-30 09:46:01.207 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 173843(3MB) AllocSpace objects, 11(572KB) LOS objects, 10% free, 29MB/32MB, paused 3.833ms total 120.445ms
10-30 09:46:01.499 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 176026(3MB) AllocSpace objects, 13(676KB) LOS objects, 11% free, 29MB/33MB, paused 7.948ms total 158.936ms
10-30 09:46:01.513 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.086ms
10-30 09:46:01.768 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 183401(3MB) AllocSpace objects, 10(540KB) LOS objects, 8% free, 30MB/33MB, paused 6.976ms total 55.042ms
10-30 09:46:01.782 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.141ms
10-30 09:46:02.091 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 83.993ms
10-30 09:46:02.119 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 146812(2MB) AllocSpace objects, 10(556KB) LOS objects, 11% free, 31MB/35MB, paused 4.086ms total 148.374ms
10-30 09:46:02.132 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.503ms
10-30 09:46:02.355 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 10.725ms
10-30 09:46:02.538 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.960ms
10-30 09:46:02.551 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 179103(3MB) AllocSpace objects, 8(448KB) LOS objects, 5% free, 33MB/35MB, paused 16.906ms total 86.519ms
10-30 09:46:02.561 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.621ms
10-30 09:46:02.713 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.718ms
10-30 09:46:02.730 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 176741(3MB) AllocSpace objects, 13(744KB) LOS objects, 10% free, 33MB/37MB, paused 17.026ms total 105.761ms
10-30 09:46:02.740 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.648ms
10-30 09:46:02.919 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.148ms
10-30 09:46:03.093 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.640ms
10-30 09:46:03.278 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 8.964ms
10-30 09:46:03.466 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.234ms
10-30 09:46:03.523 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.985ms
10-30 09:46:03.622 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.846ms
10-30 09:46:03.749 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.134ms
10-30 09:46:03.911 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.538ms
10-30 09:46:04.108 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 10.659ms
10-30 09:46:04.264 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.444ms
10-30 09:46:04.429 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.430ms
10-30 09:46:04.446 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 177011(3MB) AllocSpace objects, 13(860KB) LOS objects, 8% free, 40MB/44MB, paused 20.255ms total 121.688ms
10-30 09:46:04.461 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.013ms
10-30 09:46:04.530 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 6.298ms
10-30 09:46:04.670 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.041ms
10-30 09:46:04.839 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.578ms
10-30 09:46:05.030 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 7.919ms
10-30 09:46:05.242 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.381ms
10-30 09:46:05.400 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.841ms
10-30 09:46:05.537 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.684ms
10-30 09:46:05.735 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.828ms
10-30 09:46:05.755 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 191824(3MB) AllocSpace objects, 12(860KB) LOS objects, 8% free, 45MB/49MB, paused 19.760ms total 154.848ms
10-30 09:46:05.770 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.253ms
10-30 09:46:05.953 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.552ms
10-30 09:46:06.044 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 9.720ms
10-30 09:46:06.138 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.542ms
10-30 09:46:06.284 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.762ms
10-30 09:46:06.464 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 194534(3MB) AllocSpace objects, 13(968KB) LOS objects, 7% free, 48MB/52MB, paused 3.728ms total 127.593ms
10-30 09:46:06.476 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.657ms
10-30 09:46:06.550 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.106ms
10-30 09:46:06.664 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 13.684ms
10-30 09:46:06.821 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.076ms
10-30 09:46:07.000 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.330ms
10-30 09:46:07.016 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 202163(3MB) AllocSpace objects, 11(836KB) LOS objects, 7% free, 51MB/55MB, paused 19.939ms total 136.394ms
10-30 09:46:07.028 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.080ms
10-30 09:46:07.227 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.434ms
10-30 09:46:07.395 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.207ms
10-30 09:46:07.525 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.650ms
10-30 09:46:07.713 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 214425(3MB) AllocSpace objects, 12(948KB) LOS objects, 6% free, 53MB/57MB, paused 4.599ms total 122.695ms
10-30 09:46:07.725 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.268ms
10-30 09:46:07.928 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.880ms
10-30 09:46:08.080 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 20.240ms
10-30 09:46:08.094 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 160556(2MB) AllocSpace objects, 5(400KB) LOS objects, 3% free, 55MB/57MB, paused 24.451ms total 71.926ms
10-30 09:46:08.113 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.642ms
10-30 09:46:08.305 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 212686(3MB) AllocSpace objects, 11(880KB) LOS objects, 6% free, 55MB/59MB, paused 5.110ms total 134.449ms
10-30 09:46:08.319 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 14.065ms
10-30 09:46:08.535 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 15.462ms
10-30 09:46:08.712 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.943ms
10-30 09:46:08.907 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 19.325ms
10-30 09:46:08.930 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 219521(3MB) AllocSpace objects, 12(1004KB) LOS objects, 6% free, 58MB/62MB, paused 24.278ms total 157.949ms
10-30 09:46:08.948 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.521ms
10-30 09:46:09.067 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.066ms
10-30 09:46:09.170 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.647ms
10-30 09:46:09.361 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 19.054ms
10-30 09:46:09.583 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 25.753ms
10-30 09:46:09.619 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.583ms
10-30 09:46:09.634 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 228847(4MB) AllocSpace objects, 11(924KB) LOS objects, 6% free, 61MB/65MB, paused 22.781ms total 182.292ms
10-30 09:46:09.645 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 11.615ms
10-30 09:46:09.922 12054-12065/br.com.vegait.android.hotelexperience I/art: Background sticky concurrent mark sweep GC freed 209342(3MB) AllocSpace objects, 6(528KB) LOS objects, 4% free, 62MB/65MB, paused 5.230ms total 98.012ms
10-30 09:46:09.943 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 21.805ms
10-30 09:46:10.175 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 114.591ms
10-30 09:46:10.206 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 157725(2MB) AllocSpace objects, 10(876KB) LOS objects, 6% free, 62MB/66MB, paused 4.308ms total 153.014ms
10-30 09:46:10.223 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 17.394ms
10-30 09:46:10.460 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 18.833ms
10-30 09:46:10.579 12054-12061/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 16.845ms
10-30 09:46:10.739 12054-12065/br.com.vegait.android.hotelexperience I/art: Background partial concurrent mark sweep GC freed 278135(4MB) AllocSpace objects, 11(968KB) LOS objects, 5% free, 64MB/68MB, paused 4.272ms total 179.332ms
10-30 09:46:10.752 12054-12065/br.com.vegait.android.hotelexperience W/art: Suspending all threads took: 12.981ms
And keep like this until crash. What I am doing wrong?
it´s me again.
Just to leave a feedback about my issue. I found the problem.
The object I was sending on request was different from the one mapped to be send.
Idk why it stuck de interceptor, but when I just change the object it worked like a charm. I will leave this here for someone else that might have the same problem.
Thank you any way.
First of all you have to add crash log. But anyway log that you provide means that you're using memory, then it's being freed by the GC But seems like you do to much work and GC can't provide tp you enought memory and your app shot down with OutOfMemory exception. So first of all in this case you have to use Singleton pattern to avoid creation all of this Objects like (HttpClient, Gson, Interceptor ect..)So let's pretend this class entitled HttpClient. Then you need something like NetManager that will be a singleton..
public class NetManager {
private static NetManager instance;
private HttpClient httpClient;
private NetManager() {
httpClient = new HttpClient();
}
public static NetManager() {
if (instance == null) {
instance = new NetManager();
}
return instance;
}
public HttpClient getHttpClient() {
return httpClient;
}
}
And user your httpClient through this manager.
But in general it's a very very VERY bad to make network requests in a loop.

Crash when switching between activities on Smartphone but works fine on an Emulator

So I'm using Android Studio on my PC and im testing the app in an emulator which works totally fine.
But when i try to use my smartphone connected to the pc, the app always crashes, when i try to switch the activity.
Everything else seems to work fine.
Anyone knows why this could be happening?
Thats the exception, that i get when the app chrashes:
[ 01-08 16:31:19.455 2922: 2922 E/ ]
process stopped due to unexpected signal 13
E/HAL: load: id=gralloc != hmi->id=gralloc
I/OpenGLRenderer: Initialized EGL, version 1.4
I/HwSecImmHelper: mSecurityInputMethodService is null
I/HwSecImmHelper: mSecurityInputMethodService is null
I/System: core_booster, getBoosterConfig = false
I/System: core_booster, getBoosterConfig = false
I/art: Starting a blocking GC Alloc
I/art: Starting a blocking GC Alloc
I/art: Starting a blocking GC Alloc
I/art: Alloc partial concurrent mark sweep GC freed 20(944B) AllocSpace objects, 0(0B) LOS objects, 4% free, 240MB/252MB, paused 251us total 9.704ms
I/art: Starting a blocking GC Alloc
I/art: Alloc concurrent mark sweep GC freed 11(12KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 240MB/252MB, paused 252us total 16.452ms
I/art: Forcing collection of SoftReferences for 91MB allocation
I/art: Starting a blocking GC Alloc
I/art: Alloc concurrent mark sweep GC freed 11(352B) AllocSpace objects, 0(0B) LOS objects, 4% free, 240MB/252MB, paused 343us total 16.178ms
W/art: Throwing OutOfMemoryError "Failed to allocate a 96412692 byte allocation with 12582912 free bytes and 15MB until OOM"

Azure Mobile App: Android .get() causes app to freeze

I have a class User that has several attributes and a String called ID so that it matches my DB table called User. At the moment my table User is empty.
Whenever I try:
mClient.getTable(User.class).insert(myUser).get();
or
mClient.getTable(User.class).execute().get();
My app freezes on a white screen and console shows no error. The stackTrace or prints that i do in my catch clause never show up.
The only errors I get are:
06-08 23:23:35.287 28469-28469/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
Here is the code I use in my onCreate Method for :
User myUser = new User();
// fill in myUser's fields but Id.
new Runnable() {
#Override
public void run() {
try {
User myUser2 = mClient.getTable(User.class).insert(myUser).get();
System.out.println("Successfully added the user !");
} catch (Exception e) {
e.printStackTrace();
}
}
}.run();
I am new to azure and I couldn't find any help with my friend google. Thanks in advance.
EDIT: Here is the whole logcat:
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 06-08 23:19:29.602 24915:24915 D/ ]
HostConnection::get() New Host Connection established 0xabead140, tid 24915
[ 06-08 23:19:29.665 24915:24962 D/ ]
HostConnection::get() New Host Connection established 0xa313a110, tid 24962
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cee100, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 06-08 23:21:25.518 26595:26595 D/ ]
HostConnection::get() New Host Connection established 0xabead0c0, tid 26595
[ 06-08 23:21:25.587 26595:26642 D/ ]
HostConnection::get() New Host Connection established 0xa3134130, tid 26642
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/art: Suspending all threads took: 11.368ms
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabea8b30
t2g.com.travel2gather I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa36a0480, error=EGL_SUCCESS
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2971570
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa227e720, error=EGL_SUCCESS
t2g.com.travel2gather W/art: Suspending all threads took: 10.473ms
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 8584(1343KB) AllocSpace objects, 5(1600KB) LOS objects, 39% free, 3MB/6MB, paused 1.655ms total 226.868ms
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 06-08 23:22:25.364 27456:27456 D/ ]
HostConnection::get() New Host Connection established 0xab6d42e0, tid 27456
t2g.com.travel2gather W/art: Verification of void com.squareup.okhttp.internal.http.HttpEngine.readResponse() took 169.113ms
[ 06-08 23:22:25.428 27456:27508 D/ ]
HostConnection::get() New Host Connection established 0xab6d48c0, tid 27508
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa37d7c80, error=EGL_SUCCESS
t2g.com.travel2gather W/art: Verification of okio.Source com.squareup.okhttp.internal.http.HttpConnection.newChunkedSource(com.squareup.okhttp.internal.http.HttpEngine) took 157.042ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 107958(3MB) AllocSpace objects, 1(240KB) LOS objects, 40% free, 4MB/6MB, paused 9.332ms total 199.896ms
t2g.com.travel2gather W/art: Suspending all threads took: 5.557ms
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 70224(2MB) AllocSpace objects, 6(364KB) LOS objects, 0% free, 7MB/7MB, paused 7.961ms total 76.058ms
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 11587(629KB) AllocSpace objects, 5(2040KB) LOS objects, 39% free, 5MB/8MB, paused 5.417ms total 20.421ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 14786(1156KB) AllocSpace objects, 1(20KB) LOS objects, 72% free, 1024KB/3MB, paused 19.184ms total 31.942ms
t2g.com.travel2gather W/art: Suspending all threads took: 5.952ms
t2g.com.travel2gather W/art: Suspending all threads took: 6.214ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: WaitForGcToComplete blocked for 5.428ms for cause Background
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 164(34KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 666KB/856KB, paused 8.272ms total 38.306ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 6278(406KB) AllocSpace objects, 0(0B) LOS objects, 13% free, 1497KB/1729KB, paused 5.499ms total 20.437ms
Azure Mobile App: Android .get() causes app to freeze
Because calling .run() as a method instead of passing Runnable to Thread.
Create a Thread:
Runnable mRunnable=new Runnable()
{
// your code here
};
and pass mRunnable object to it:
Thread thread = new Thread(mRunnable);
thread.start();

android emulator keeps crashing when i attempt to change tab

i have no errors in my application but when i switch tabs it freezes and closes the application in the emulator and i'm new to the android studio and android development in general. i do not have a clue what to do next.
here is my logcat
03-23 11:56:05.749 2417-2417/com.example.hp_user.shoutfinal28 I/art: Not late-enabling -Xcheck:jni (already on)
03-23 11:56:05.994 2417-2417/com.example.hp_user.shoutfinal28 W/System: ClassLoader referenced unknown path: /data/app/com.example.hp_user.shoutfinal28-1/lib/x86
03-23 11:56:06.021 2417-2417/com.example.hp_user.shoutfinal28 I/GMPM: App measurement is starting up, version: 8487
03-23 11:56:06.021 2417-2417/com.example.hp_user.shoutfinal28 I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
03-23 11:56:06.032 2417-2417/com.example.hp_user.shoutfinal28 E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
03-23 11:56:06.032 2417-2417/com.example.hp_user.shoutfinal28 E/GMPM: Scheduler not set. Not logging error/warn.
03-23 11:56:06.209 2417-2433/com.example.hp_user.shoutfinal28 E/GMPM: Uploading is not possible. App measurement disabled
03-23 11:56:06.741 2417-2435/com.example.hp_user.shoutfinal28 D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
03-23 11:56:07.233 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 42.830ms
03-23 11:56:07.507 2417-2435/com.example.hp_user.shoutfinal28 I/OpenGLRenderer: Initialized EGL, version 1.4
03-23 11:56:07.670 2417-2435/com.example.hp_user.shoutfinal28 W/EGL_emulation: eglSurfaceAttrib not implemented
03-23 11:56:07.670 2417-2435/com.example.hp_user.shoutfinal28 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad92f000, error=EGL_SUCCESS
03-23 11:56:07.874 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
03-23 11:56:09.040 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 67 frames! The application may be doing too much work on its main thread.
03-23 11:56:14.016 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.772ms
03-23 11:56:16.753 2417-2433/com.example.hp_user.shoutfinal28 I/GMPM: Tag Manager is not found and thus will not be used
03-23 11:56:16.910 2417-2422/com.example.hp_user.shoutfinal28 I/art: Thread[2,tid=2422,WaitingInMainSignalCatcherLoop,Thread*=0xad90ed00,peer=0x12c7a0a0,"Signal Catcher"]: reacting to signal 3
03-23 11:56:17.048 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 46.962ms
03-23 11:56:17.211 2417-2422/com.example.hp_user.shoutfinal28 I/art: Wrote stack traces to '/data/anr/traces.txt'
03-23 11:56:22.415 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.324ms
03-23 11:56:33.717 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.067ms
03-23 11:56:39.211 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 17.079ms
03-23 11:57:13.188 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.698ms
03-23 11:57:15.690 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.155ms
03-23 11:57:19.158 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.179ms
03-23 11:57:21.138 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.996ms
03-23 11:57:40.748 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.140ms
03-23 11:57:46.163 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.413ms
03-23 11:57:57.981 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 8.603ms
03-23 11:58:00.909 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.863ms
03-23 11:58:04.638 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.404ms
03-23 11:58:18.369 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.777ms
03-23 11:58:24.334 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 31.972ms
03-23 11:58:24.769 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.558ms
03-23 11:58:25.399 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.461ms
03-23 11:58:35.213 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.951ms
03-23 11:58:38.694 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.319ms
03-23 11:58:51.712 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.430ms
03-23 11:59:08.130 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.958ms
03-23 11:59:16.520 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 12.715ms
03-23 11:59:28.920 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 31.685ms
03-23 11:59:29.423 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 15.909ms
03-23 11:59:30.402 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.648ms
03-23 11:59:30.923 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 16.189ms
03-23 11:59:57.004 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.171ms
03-23 12:00:04.514 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.080ms
03-23 12:00:05.500 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 21.063ms
03-23 12:00:09.465 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.965ms
03-23 12:00:19.918 2417-2423/com.example.hp_user.shoutfinal28 W/art:
Suspending all threads took: 9.964ms
03-23 12:00:21.427 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 17.293ms
03-23 12:00:30.382 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 13.516ms
03-23 12:01:20.767 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.766ms
03-23 12:01:32.806 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 26.784ms
03-23 12:01:33.904 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 36.950ms
03-23 12:02:18.777 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 6.365ms
03-23 12:02:39.284 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 14.412ms
03-23 12:03:00.297 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 25.732ms
03-23 12:03:01.280 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 8.056ms
03-23 12:03:12.798 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.714ms
03-23 12:03:17.801 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 8.841ms
03-23 12:03:23.760 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.779ms
03-23 12:03:44.725 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 13.453ms
03-23 12:03:52.812 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 66.320ms
03-23 12:03:57.738 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.062ms
03-23 12:04:12.258 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.525ms
03-23 12:04:14.760 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.565ms
03-23 12:04:16.782 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 19.185ms
03-23 12:04:23.730 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.169ms
03-23 12:04:31.254 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.048ms
03-23 12:04:38.743 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 10.787ms
03-23 12:05:00.175 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 106.406ms
03-23 12:05:02.590 2417-2435/com.example.hp_user.shoutfinal28 W/EGL_emulation: eglSurfaceAttrib not implemented
03-23 12:05:02.590 2417-2435/com.example.hp_user.shoutfinal28 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa21045c0, error=EGL_SUCCESS
03-23 12:05:04.016 2417-2435/com.example.hp_user.shoutfinal28 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabfe4d10
03-23 12:05:06.035 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 15606(1053KB) AllocSpace objects, 6(120KB) LOS objects, 37% free, 2MB/3MB, paused 19.193ms total 246.150ms
03-23 12:05:06.076 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 16.765ms
03-23 12:05:06.509 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 1885(1770KB) AllocSpace objects, 1(24KB) LOS objects, 39% free, 3MB/6MB, paused 24.099ms total 241.046ms
03-23 12:05:06.553 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.531ms
03-23 12:05:06.767 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 20.589ms
03-23 12:05:06.918 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 1034(2MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 5MB/6MB, paused 129.285ms total 303.506ms
03-23 12:05:06.929 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 9.437ms
03-23 12:05:07.075 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 39.477ms
03-23 12:05:07.086 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.998ms
03-23 12:05:07.187 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 464(1401KB) AllocSpace objects, 0(0B) LOS objects, 10% free, 5MB/6MB, paused 65.404ms total 239.195ms
03-23 12:05:07.220 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 31.710ms
03-23 12:05:07.510 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 517(1538KB) AllocSpace objects, 0(0B) LOS objects, 36% free, 7MB/11MB, paused 29.730ms total 245.372ms
03-23 12:05:07.865 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 810(3MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 8MB/11MB, paused 60.048ms total 195.013ms
03-23 12:05:08.085 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.930ms
03-23 12:05:08.097 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 558(2MB) AllocSpace objects, 0(0B) LOS objects, 2% free, 10MB/11MB, paused 57.680ms total 199.141ms
03-23 12:05:08.372 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 330(1634KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 11MB/11MB, paused 45.586ms total 260.298ms
03-23 12:05:08.593 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.991ms
03-23 12:05:08.599 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 474(2MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 12MB/16MB, paused 52.037ms total 213.333ms
03-23 12:05:08.871 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 13.742ms
03-23 12:05:08.973 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 1030(5MB) AllocSpace objects, 0(0B) LOS objects, 8% free, 15MB/16MB, paused 136.535ms total 320.111ms
03-23 12:05:09.127 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 61.076ms
03-23 12:05:09.133 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.412ms
03-23 12:05:09.227 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 366(1835KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 17MB/17MB, paused 69.814ms total 225.055ms
03-23 12:05:09.546 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 19.416ms
03-23 12:05:09.556 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 639(2MB) AllocSpace objects, 29(464KB) LOS objects, 17% free, 18MB/22MB, paused 70.188ms total 317.219ms
03-23 12:05:09.576 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 19.102ms
03-23 12:05:09.976 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 555(2MB) AllocSpace objects, 183(2MB) LOS objects, 10% free, 20MB/22MB, paused 79.907ms total 322.037ms
03-23 12:05:09.989 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 11.923ms
03-23 12:05:10.486 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 427(1679KB) AllocSpace objects, 140(2MB) LOS objects, 14% free, 23MB/27MB, paused 72.435ms total 402.265ms
03-23 12:05:10.875 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 501(2005KB) AllocSpace objects, 165(2MB) LOS objects, 7% free, 25MB/27MB, paused 81.908ms total 324.161ms
03-23 12:05:10.884 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.802ms
03-23 12:05:11.172 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 165.365ms
03-23 12:05:11.288 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 273(1063KB) AllocSpace objects, 89(1424KB) LOS objects, 12% free, 27MB/31MB, paused 75.815ms total 355.692ms
03-23 12:05:11.747 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 230.989ms
03-23 12:05:11.778 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 5.070ms
03-23 12:05:11.905 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 447(1787KB) AllocSpace objects, 147(2MB) LOS objects, 12% free, 27MB/31MB, paused 121.279ms total 547.928ms
03-23 12:05:11.913 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.013ms
03-23 12:05:12.200 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 144.899ms
03-23 12:05:12.218 2417-2427/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 7.041ms
03-23 12:05:12.394 2417-2427/com.example.hp_user.shoutfinal28 I/art: Clamp target GC heap from 32MB to 32MB
03-23 12:05:12.394 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background partial concurrent mark sweep GC freed 303(1183KB) AllocSpace objects, 98(1952KB) LOS objects, 10% free, 28MB/32MB, paused 167.749ms total 431.021ms
03-23 12:05:12.555 2417-2417/com.example.hp_user.shoutfinal28 I/art: Waiting for a blocking GC Alloc
03-23 12:05:12.629 2417-2423/com.example.hp_user.shoutfinal28 W/art: Suspending all threads took: 147.707ms
03-23 12:05:12.730 2417-2427/com.example.hp_user.shoutfinal28 I/art: Background sticky concurrent mark sweep GC freed 242(978KB) AllocSpace objects, 80(1600KB) LOS objects, 7% free, 29MB/32MB, paused 86.419ms total 299.323ms
03-23 12:05:12.732 2417-2417/com.example.hp_user.shoutfinal28 I/art: WaitForGcToComplete blocked for 177.147ms for cause Alloc
03-23 12:05:12.733 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:12.769 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:12.769 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.069 2417-2417/com.example.hp_user.shoutfinal28 I/art: Clamp target GC heap from 34MB to 32MB
03-23 12:05:13.069 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc partial concurrent mark sweep GC freed 168(604KB) AllocSpace objects, 51(1020KB) LOS objects, 5% free, 30MB/32MB, paused 65.635ms total 298.511ms
03-23 12:05:13.101 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.102 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.321 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc sticky concurrent mark sweep GC freed 74(301KB) AllocSpace objects, 24(480KB) LOS objects, 4% free, 30MB/32MB, paused 62.666ms total 217.832ms
03-23 12:05:13.329 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.329 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.643 2417-2417/com.example.hp_user.shoutfinal28 I/art: Clamp target GC heap from 34MB to 32MB
03-23 12:05:13.643 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc partial concurrent mark sweep GC freed 48(145KB) AllocSpace objects, 14(280KB) LOS objects, 4% free, 30MB/32MB, paused 63.546ms total 312.988ms
03-23 12:05:13.660 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.661 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
03-23 12:05:13.870 2417-2417/com.example.hp_user.shoutfinal28 I/art: Alloc sticky concurrent mark sweep GC freed 31(37KB) AllocSpace objects, 26(468KB) LOS objects, 3% free, 30MB/32MB, paused 63.375ms total 208.351ms
03-23 12:05:13.877 2417-2417/com.example.hp_user.shoutfinal28 I/art: Starting a blocking GC Alloc
i believe this is the class causing it to crash, before i created this class and 4th tab my app ran fine but the other two classes are pretty much empty apart from the tabs.
package com.example.hp_user.shoutfinal28;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
public class FragmentShouts_Maps extends Fragment implements OnMapReadyCallback {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Get the view from fragment shouts.xml
View view = inflater.inflate(R.layout.fragmentshouts_maps, container, false);
SupportMapFragment fragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.maps);
if (fragment!= null) {
fragment.getMapAsync(this);
}
return view;
}
#Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
#Override
public void onMapReady (GoogleMap googleMap) {
}
}
here is my ViewPagerAdapter
public class ViewPagerAdapter extends FragmentPagerAdapter {
final int PAGE_COUNT = 4;
// Tab Titles
private String tabtitles[] = new String[] {"Home","Shouts","Maps","Shouters"};
Context context;
public ViewPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public int getCount() {
return PAGE_COUNT;
}
public Fragment getItem(int position) {
switch (position) {
// Open Fragment home.java
case 0:
FragmentHome fragmenthome = new FragmentHome();
return fragmenthome;
// Open Fragment shouters.java
case 1:
FragmentShouts fragmentshouts = new FragmentShouts();
return fragmentshouts;
case 2:
FragmentShouts_Maps fragmentshouts_maps = new FragmentShouts_Maps();
return fragmentshouts_maps;
case 3:
FragmentShouters fragmentshouters = new FragmentShouters();
return fragmentshouters;
}
return null;
}
#Override
public CharSequence getPageTitle(int position) {
return tabtitles[position];
}
here is my main activity class, i think i slightly agree with you, its a sliding tab strip which isnt natural for android, more commonly seen in ios devices and it worked smoothly before the implementation of the fourth tab but i noticed my toast would react slowly when user input was stored after a button was clicked
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Get the view from activity_main.xml
setContentView(R.layout.activity_main);
// Locate the viewpager in activity_main.xml
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
// Set the ViewPagerAdapter into ViewPager
viewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager()));
}
public void btnShout(View v) {
//allows for label to be changed to shouted once button is pressed
EditText txtInput = (EditText) findViewById(R.id.txtInput);
TextView lblShout = (TextView) findViewById(R.id.lblShout);
lblShout.setText("Shouted! ");
//allows for toast to be displayed once button is clicked
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0);
toast.makeText(MainActivity.this, txtInput.getText() + " Has Been Shouted.", toast.LENGTH_SHORT).show();
}
}
You're doing too much work on the main thread.
03-23 11:56:07.874 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread.
03-23 11:56:09.040 2417-2417/com.example.hp_user.shoutfinal28 I/Choreographer: Skipped 67 frames! The application may be doing too much work on its main thread.
If you are in need of executing long-running code, you should take a look at Android's threading tools (http://developer.android.com/guide/components/processes-and-threads.html and http://developer.android.com/training/multiple-threads/index.html). AsyncTask (http://developer.android.com/reference/android/os/AsyncTask.html) is your friend =)

Using Picasso inside Volley is giving me a bad frame-rate and crashing my app

To make a long story short, I'm using Picasso inside Volley's onResponse() method to populate a listview with images.
The code is working, but I'm getting a bad frame-rate, and the app is crashing with no memory if I scroll through the list view too quickly.
Where is the bad performance coming from? I thought the asynchronous stuff would take care of everything.
Picasso and Volley work just find until I stick them inside of each-other.
I think the problem might be that I'm sticking an asynchronous class inside another asynchronous class. Maybe this explains the threading errors I get e.g. all threads took?
Here is how I use Picasso inside Volley:
RequestQueue requestQueue = Volley.newRequestQueue(ctx1);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(url, new Response.Listener<JSONObject>() {
#Override
public void onResponse(JSONObject response) {
// If there is a response, do this
if (response != null) {
// Get the number of JSON objects on the web-page
int resultCount = response.optInt("resultCount");
// If there is a JSON object on the web-page, do this
if (resultCount > 0) {
// Get a gson object
Gson gson = new Gson();
// Get a JSONArray from the results
JSONArray jsonArray = response.optJSONArray("results");
// If the array exists, do this
if (jsonArray != null) {
JSONObjectsList = gson.fromJson(jsonArray.toString(), SongInfo[].class);
Picasso.with(ctx2)
.load(String.valueOf(JSONObjectsList[0].artworkUrl30))
.transform(new CircleTransform())
.placeholder(R.drawable.blackcircle)
.into(iv);
}
}
}
}
}, new Response.ErrorListener() {
#Override
public void onErrorResponse(VolleyError error) {
Log.e("LOG", error.toString());
}
});
requestQueue.add(jsonObjectRequest);
}
The last bit of the error log
11-27 01:25:21.482 32167-32182/ I/art: Background sticky concurrent mark sweep GC freed 157894(7MB) AllocSpace objects, 62(5MB) LOS objects, 9% free, 63MB/69MB, paused 9.954ms total 196.412ms
11-27 01:25:21.502 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:21.602 32167-32182/ W/art: Suspending all threads took: 8.316ms
11-27 01:25:21.662 32167-32182/ I/art: Background partial concurrent mark sweep GC freed 160421(7MB) AllocSpace objects, 36(3MB) LOS objects, 22% free, 55MB/71MB, paused 16.171ms total 156.768ms
11-27 01:25:21.672 32167-32182/ W/art: Suspending all threads took: 5.037ms
11-27 01:25:21.712 32167-32174/ W/art: Suspending all threads took: 36.212ms
11-27 01:25:21.732 32167-32182/ I/art: Background sticky concurrent mark sweep GC freed 6365(305KB) AllocSpace objects, 6(372KB) LOS objects, 12% free, 55MB/63MB, paused 11.009ms total 55.466ms
11-27 01:25:21.772 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:21.862 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:22.062 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:22.102 32167-32182/ I/art: Background partial concurrent mark sweep GC freed 134151(6MB) AllocSpace objects, 47(4MB) LOS objects, 22% free, 55MB/71MB, paused 11.466ms total 128.496ms
11-27 01:25:22.362 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:22.652 32167-32182/ I/art: Background sticky concurrent mark sweep GC freed 171943(7MB) AllocSpace objects, 86(7MB) LOS objects, 11% free, 59MB/67MB, paused 6.646ms total 90.801ms
11-27 01:25:22.662 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:22.712 32167-32174/ W/art: Suspending all threads took: 33.982ms
11-27 01:25:22.742 32167-32182/ I/art: Background partial concurrent mark sweep GC freed 124437(6MB) AllocSpace objects, 24(2MB) LOS objects, 23% free, 52MB/68MB, paused 12.255ms total 87.884ms
11-27 01:25:22.932 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:23.192 32167-32167/ D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
11-27 01:25:23.192 32167-32167/ I/Choreographer: Skipped 127 frames! The application may be doing too much work on its main thread.
11-27 01:25:23.342 32167-32182/ I/art: Background sticky concurrent mark sweep GC freed 152008(7MB) AllocSpace objects, 69(6MB) LOS objects, 12% free, 57MB/65MB, paused 11.857ms total 124.020ms
11-27 01:25:23.702 32167-32174/ W/art: Suspending all threads took: 29.615ms
11-27 01:25:23.772 32167-32182/ I/art: Background partial concurrent mark sweep GC freed 165355(7MB) AllocSpace objects, 26(3MB) LOS objects, 21% free, 56MB/72MB, paused 10.798ms total 159.423ms
11-27 01:25:23.852 32167-32182/ I/art: Background sticky concurrent mark sweep GC freed 16824(674KB) AllocSpace objects, 1(150KB) LOS objects, 12% free, 57MB/65MB, paused 7.395ms total 66.835ms
11-27 01:25:24.182 32167-32174/ W/art: Suspending all threads took: 10.983ms
11-27 01:25:24.562 32167-32182/ I/art: Background partial concurrent mark sweep GC freed 60495(2MB) AllocSpace objects, 15(2MB) LOS objects, 20% free, 62MB/78MB, paused 12.542ms total 196.419ms
11-27 01:25:24.632 32167-32182/ I/art: Background sticky concurrent mark sweep GC freed 6414(236KB) AllocSpace objects, 0(0B) LOS objects, 11% free, 63MB/71MB, paused 10.624ms total 67.043ms
11-27 01:25:24.932 32167-32167/ W/libc: pthread_create failed: couldn't allocate 1064960-byte stack: Out of memory
11-27 01:25:24.932 32167-32167/ E/art: Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again"
11-27 01:25:24.932 32167-32167/ D/AndroidRuntime: Shutting down VM
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: FATAL EXCEPTION: main
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: Process: , PID: 32167
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at java.lang.Thread.nativeCreate(Native Method)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at java.lang.Thread.start(Thread.java:1063)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at com.android.volley.RequestQueue.start(RequestQueue.java:145)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:79)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:105)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:115)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at .ServiceHandler.runVolley(ServiceHandler.java:41)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at .MyListAdapterTracks.getView(MyListAdapterTracks.java:119)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.widget.AbsListView.obtainView(AbsListView.java:2825)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.widget.ListView.makeAndAddView(ListView.java:1884)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.widget.ListView.fillDown(ListView.java:713)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.widget.ListView.fillGap(ListView.java:677)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.widget.AbsListView.trackMotionScroll(AbsListView.java:7043)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:6481)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:590)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:559)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.os.Looper.loop(Looper.java:145)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5944)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
11-27 01:25:24.932 32167-32167/ E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
11-27 01:25:25.062 32167-2055/ A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 2055 (Thread-8342)
You can see( Link ) the comparison between the bests image loading libraries till date Picasso and Glide.The tutorial covers memory usages,quality etc all the things you want to know about both the libraries.
So, after going through the tuts you get the point when using picasso resizing is considerable to get rid from memory issues.
Use Either resize() or fit() with picasso
Picasso.with(this)
.load("http://nuuneoi.com/uploads/source/playstore/cover.jpg")
.resize(100, 100)//fit()
.into(ivImgPicasso);
I took out the Picasso code snippet and I realized I still had the same bad frame-rate. In conclusion, the problem was Volley! Now, I have to understand why.

Categories

Resources