Android EditBox responses slow when entering data - java

I am testing my android application on Galaxy S3. I have a form having views like Edit Box, radios, drop down.. When I edit any EditText the keyboard responses slow. When I run the form separately it performs fine.
Here is logs of LogCat
07-26 12:39:46.925: D/SensorManager(3165): unregisterListener:: Trklfufi 9 budiwrd5mrfo5WirfulblrwuFmfulTrklfufi$KfukwiFmfulTrklfufiRvht#,*b(a+e8
07-26 12:39:46.925: I/SensorManager(3165): Set min delay = 200000
07-26 12:39:46.925: I/SensorManager(3165): Before sending... delay = 200000
07-26 12:39:46.925: D/Sensors(3165): Remain listener = android.view.OrientationEventListener$SensorEventListenerImpl#419e6320
07-26 12:39:46.925: I/Sensors(3165): sendDelay --- 200000000
07-26 12:39:46.955: D/SensorManager(3165): JNI - sendDelay
07-26 12:39:46.985: D/SensorManager(3165): registerListener :: handle = 0 name= MPU-6050 Accelerometer delay= 200000 Trklfufi 9 budiwrd5mrfo5WirfulblrwuFmfulTrklfufi$KfukwiFmfulTrklfufiRvht#,))b..,8
07-26 12:39:47.015: W/IInputConnectionWrapper(3165): getSelectedText on inactive InputConnection
07-26 12:39:47.045: W/IInputConnectionWrapper(3165): setComposingText on inactive InputConnection
07-26 12:39:47.045: W/IInputConnectionWrapper(3165): getExtractedText on inactive InputConnection
07-26 12:39:48.446: D/dalvikvm(3165): GC_CONCURRENT freed 1974K, 17% free 17467K/20999K, paused 3ms+56ms, total 175ms
07-26 12:39:50.428: D/dalvikvm(3165): GC_CONCURRENT freed 2035K, 17% free 17440K/20999K, paused 3ms+54ms, total 174ms
07-26 12:39:52.590: D/dalvikvm(3165): GC_CONCURRENT freed 2003K, 17% free 17442K/20999K, paused 15ms+32ms, total 166ms
07-26 12:39:55.843: D/dalvikvm(3165): GC_CONCURRENT freed 1998K, 17% free 17455K/20999K, paused 13ms+48ms, total 181ms

TabActivity is deprecated in android jelly bean that is cause of slowness of keyboard. so I have removed it works fine than.

Related

Strange Android memory consumption before even before first Activity starts

I observed a strange behavior of Android just before my app starts. It seems that a lot of memory is allocated even before my app starts doing something. The GC tells me that only 90% percent of the heap are free. And at the moment the app starts even before the "onCreate" of my first activity has been called the JVM has only 4% free memory left. What happend here, and how can I prevent this from happening, because with only 4% of 64MB heap left my app cant operate.
03-09 21:00:16.517 1684-2249/? D/k: Processing package: de.ponysoft.backhome
03-09 21:00:16.549 1684-1684/? D/ChimeraCfgMgr: Loading module com.google.android.gms.vision from APK com.google.android.gms
03-09 21:00:16.587 1524-1524/? E/NetworkScheduler.SchedulerReceiver: Invalid parameter app
03-09 21:00:16.587 1524-1524/? E/NetworkScheduler.SchedulerReceiver: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
03-09 21:00:16.684 1684-2252/? I/PeopleContactsSync: triggerPendingContactsCleanup: no accounts
03-09 21:00:16.699 1684-2249/? D/GassUtils: Found app info for package de.ponysoft.backhome:3. Hash: 8514543eb70ddc4389765ad8baac5ba8cab5be6e67d756a46e474b3d85051122
03-09 21:00:16.700 1684-2249/? D/k: Found info for package de.ponysoft.backhome in db.
03-09 21:00:17.375 346-366/? W/VoiceInteractionManagerService: no available voice recognition services found for user 0
03-09 21:00:17.850 346-377/? I/art: Explicit concurrent mark sweep GC freed 12467(807KB) AllocSpace objects, 5(81KB) LOS objects, 26% free, 11MB/15MB, paused 13.482ms total 1.768s
03-09 21:00:17.925 1684-1795/? I/Icing: Indexing 6F97C46050CD983C7FFCEB53F6194D5AB9C51AB5 from com.google.android.gms
03-09 21:00:17.972 2224-2224/? D/AndroidRuntime: Shutting down VM
03-09 21:00:18.184 1684-1795/? I/Icing: Indexing done 6F97C46050CD983C7FFCEB53F6194D5AB9C51AB5
03-09 21:00:19.720 2260-2260/? D/AndroidRuntime: CheckJNI is ON
03-09 21:00:20.299 2260-2260/? E/memtrack: Couldn't load memtrack module (No such file or directory)
03-09 21:00:20.302 2260-2260/? E/android.os.Debug: failed to load memtrack module: -2
03-09 21:00:20.553 2260-2260/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
03-09 21:00:20.608 346-1270/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=de.ponysoft.backhome/.InitActivity} from uid 0 on display 0
03-09 21:00:20.780 2260-2260/? D/AndroidRuntime: Shutting down VM
03-09 21:00:20.968 2270-2270/? I/art: Not late-enabling -Xcheck:jni (already on)
03-09 21:00:21.005 346-930/? I/ActivityManager: Start proc de.ponysoft.backhome for activity de.ponysoft.backhome/.InitActivity: pid=2270 uid=10057 gids={50057, 9997, 3003, 1028, 1015} abi=armeabi-v7a
03-09 21:00:21.200 69-69/? I/art: Explicit concurrent mark sweep GC freed 706(30KB) AllocSpace objects, 0(0B) LOS objects, 90% free, 110KB/1134KB, paused 21.161ms total 146.487ms
03-09 21:00:21.261 346-367/? I/ActivityManager: Killing 1127:com.android.music/u0a36 (adj 15): empty for 1801s
03-09 21:00:21.336 346-411/? W/libprocessgroup: failed to open /acct/uid_10036/pid_1127/cgroup.procs: No such file or directory
03-09 21:00:21.388 69-69/? I/art: Explicit concurrent mark sweep GC freed 7(240B) AllocSpace objects, 0(0B) LOS objects, 90% free, 110KB/1134KB, paused 1.021ms total 179.966ms
03-09 21:00:21.491 69-69/? I/art: Explicit concurrent mark sweep GC freed 5(160B) AllocSpace objects, 0(0B) LOS objects, 90% free, 110KB/1134KB, paused 872us total 96.457ms
03-09 21:00:22.586 2270-2286/? I/GMPM: App measurement is starting up
03-09 21:00:22.662 2270-2270/? D/InitActivity: onCreate
03-09 21:00:22.817 2270-2270/? D/InitActivity: onStart
This high memory consuption also causes my app to crash with an OOM Exception
03-09 21:00:31.543 2270-2287/? I/art: Clamp target GC heap from 65MB to 64MB
03-09 21:00:31.543 2270-2287/? I/art: Alloc partial concurrent mark sweep GC freed 28(1312B) AllocSpace objects, 0(0B) LOS objects, 4% free, 61MB/64MB, paused 1.088ms total 25.705ms
03-09 21:00:31.613 2270-2287/? I/art: Clamp target GC heap from 65MB to 64MB
03-09 21:00:31.613 2270-2287/? I/art: Alloc concurrent mark sweep GC freed 8(12KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 61MB/64MB, paused 2.256ms total 67.540ms
03-09 21:00:31.613 2270-2287/? I/art: Forcing collection of SoftReferences for 8MB allocation
03-09 21:00:31.676 2270-2287/? I/art: Clamp target GC heap from 65MB to 64MB
03-09 21:00:31.676 2270-2287/? I/art: Alloc concurrent mark sweep GC freed 11(344B) AllocSpace objects, 0(0B) LOS objects, 4% free, 61MB/64MB, paused 1.077ms total 61.122ms
03-09 21:00:31.677 2270-2287/? E/art: Throwing OutOfMemoryError "Failed to allocate a 9060076 byte allocation with 2786284 free bytes and 2MB until OOM"
03-09 21:00:31.678 2270-2287/? D/skia: --- allocation failed for scaled bitmap
03-09 21:00:31.696 2270-2287/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: de.ponysoft.backhome, PID: 2270
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 9060076 byte allocation with 2786284 free bytes and 2MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:467)
at de.ponysoft.backhome.async.AsyncLoadImages.decodeSampledBitmapFromResource(AsyncLoadImages.java:186)
at de.ponysoft.backhome.async.AsyncLoadImages.doInBackground(AsyncLoadImages.java:91)
at de.ponysoft.backhome.async.AsyncLoadImages.doInBackground(AsyncLoadImages.java:27)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
at java.lang.Thread.run(Thread.java:818) 
03-09 21:00:31.702 346-1507/? W/ActivityManager: Force finishing activity de.ponysoft.backhome/.InitActivity
03-09 21:00:31.769 55-55/? E/EGL_emulation: tid 55: eglCreateSyncKHR(1237): error 0x3004 (EGL_BAD_ATTRIBUTE)
I ran this one in the emulator with API 21. But I also observed this behavior on older phones like the Samsung Galaxy S2. My release version of my app is 3.7MB in total. All assets are Full-HD. On newer phones there is no memory problem, only on older phones.

I want the user to pass my login requirement in order to sign in

I want the intent I have below to be passed only when the user has passed the login requirements. I tried to put an if statement, in the onClick Listener but it wasn't working out. Basically, once the username and password meets my requirements, I want to pass the intent. If the intent doesn't pass, then I want to pass an else statement saying "That user doesn't exist."
10-20 16:53:10.330 2138-2138/com.squarespace.atpublishing.officialworkoutapp
I/art: Not late-enabling -Xcheck:jni (already on)
10-20 16:53:11.510 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 220ms
10-20 16:53:11.640 2138-2150/com.squarespace.atpublishing.officialworkoutapp I/art: Background sticky concurrent mark sweep GC freed 1555(94KB) AllocSpace objects, 0(0B) LOS objects, 33% free, 417KB/623KB, paused 0 total 130ms
10-20 16:53:11.850 2138-2138/com.squarespace.atpublishing.officialworkoutapp W/art: Verification of boolean android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.onCreatePanelMenu(int, android.view.Menu) took 170ms
10-20 16:53:11.850 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 130ms
10-20 16:53:12.780 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 80ms
10-20 16:53:13.660 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 30ms
10-20 16:53:13.900 2138-2150/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 10ms
10-20 16:53:13.900 2138-2150/com.squarespace.atpublishing.officialworkoutapp I/art: Background sticky concurrent mark sweep GC freed 1031(117KB) AllocSpace objects, 0(0B) LOS objects, 23% free, 781KB/1017KB, paused 10ms total 60ms
10-20 16:53:14.340 2138-2150/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 10ms
10-20 16:53:14.340 2138-2150/com.squarespace.atpublishing.officialworkoutapp I/art: Background sticky concurrent mark sweep GC freed 282(24KB) AllocSpace objects, 0(0B) LOS objects, 13% free, 878KB/1017KB, paused 10ms total 80ms
10-20 16:53:14.460 2138-2150/com.squarespace.atpublishing.officialworkoutapp I/art: Background partial concurrent mark sweep GC freed 297(33KB) AllocSpace objects, 0(0B) LOS objects, 36% free, 885KB/1397KB, paused 0 total 120ms
10-20 16:53:14.630 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 20ms
10-20 16:53:14.900 2138-2229/com.squarespace.atpublishing.officialworkoutapp D/OpenGLRenderer: Render dirty regions requested: true
10-20 16:53:14.950 2138-2138/com.squarespace.atpublishing.officialworkoutapp D/: HostConnection::get() New Host Connection established 0x7fb36d6b8620, tid 2138
10-20 16:53:14.960 2138-2138/com.squarespace.atpublishing.officialworkoutapp D/Atlas: Validating map...
10-20 16:53:15.260 2138-2229/com.squarespace.atpublishing.officialworkoutapp D/: HostConnection::get() New Host Connection established 0x7fb36d6ec100, tid 2229
10-20 16:53:15.350 2138-2229/com.squarespace.atpublishing.officialworkoutapp I/OpenGLRenderer: Initialized EGL, version 1.4
10-20 16:53:15.430 2138-2229/com.squarespace.atpublishing.officialworkoutapp D/OpenGLRenderer: Enabling debug mode 0
10-20 16:53:15.440 2138-2229/com.squarespace.atpublishing.officialworkoutapp W/EGL_emulation: eglSurfaceAttrib not implemented
10-20 16:53:15.440 2138-2229/com.squarespace.atpublishing.officialworkoutapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fb36d6b7b00, error=EGL_SUCCESS
10-20 16:53:15.620 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 30ms
10-20 16:53:15.650 2138-2138/com.squarespace.atpublishing.officialworkoutapp I/Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread.
10-20 16:53:20.900 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 40ms
10-20 16:53:20.930 2138-2150/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 20ms
10-20 16:53:21.510 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 190ms
10-20 16:53:21.660 2138-2138/com.squarespace.atpublishing.officialworkoutapp I/Choreographer: Skipped 102 frames! The application may be doing too much work on its main thread.
10-20 12:53:24.100 2138-2150/com.squarespace.atpublishing.officialworkoutapp I/art: Background sticky concurrent mark sweep GC freed 278(36KB) AllocSpace objects, 0(0B) LOS objects, 11% free, 1242KB/1397KB, paused 0 total 190ms
10-20 12:53:25.100 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 70ms
10-20 12:53:26.510 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 30ms
10-20 12:53:27.000 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 20ms
10-20 12:53:27.330 2138-2138/com.squarespace.atpublishing.officialworkoutapp I/Choreographer: Skipped 149 frames! The application may be doing too much work on its main thread.
10-20 12:53:27.770 2138-2229/com.squarespace.atpublishing.officialworkoutapp W/EGL_emulation: eglSurfaceAttrib not implemented
10-20 12:53:27.770 2138-2229/com.squarespace.atpublishing.officialworkoutapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fb36d2e6900, error=EGL_SUCCESS
10-20 12:53:28.120 2138-2138/com.squarespace.atpublishing.officialworkoutapp I/Choreographer: Skipped 47 frames! The application may be doing too much work on its main thread.
10-20 12:53:28.220 2138-2229/com.squarespace.atpublishing.officialworkoutapp W/EGL_emulation: eglSurfaceAttrib not implemented
10-20 12:53:28.220 2138-2229/com.squarespace.atpublishing.officialworkoutapp W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fb36d2e69c0, error=EGL_SUCCESS
10-20 12:53:28.270 2138-2138/com.squarespace.atpublishing.officialworkoutapp W/View: requestLayout() improperly called by android.support.design.internal.NavigationMenuView{2c5956e4 VFED.VC. ......ID 0,0-384,800} during layout: running second layout pass
10-20 12:53:28.460 2138-2145/com.squarespace.atpublishing.officialworkoutapp W/art: Suspending all threads took: 20ms
10-20 12:53:29.040 2138-2138/com.squarespace.atpublishing.officialworkoutapp I/Choreographer: Skipped 38 frames! The application may be doing too much work on its main thread.
`
Button mEmailSignInButton = (Button)
findViewById(R.id.email_sign_in_button);
mEmailSignInButton.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View view) {
attemptLogin();
if (mPasswordView.getText().toString().isEmpty() && mEmailSignInButton.getText().toString().isEmpty()){
Snackbar.make(view, "You Didn't enter anything", Snackbar.LENGTH_LONG).setAction("Action", null);
} else {
Intent intent = new Intent(LoginActivity.this, DrawerActivity.class);
startActivity(intent);
}
Intent intent = new Intent(LoginActivity.this, DrawerActivity.class);
startActivity(intent);
}
});
/**
* Attempts to sign in or register the account specified by the login form.
* If there are form errors (invalid email, missing fields, etc.), the
* errors are presented and no actual login attempt is made.
*/
private void attemptLogin() {
if (mAuthTask != null) {
return;
}
// Reset errors.
mEmailView.setError(null);
mPasswordView.setError(null);
// Store values at the time of the login attempt.
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
// Check for a valid password, if the user entered one.
if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
mPasswordView.setError(getString(R.string.error_invalid_password));
focusView = mPasswordView;
cancel = true;
}
// Check for a valid email address.
if (TextUtils.isEmpty(email)) {
mEmailView.setError(getString(R.string.error_field_required));
focusView = mEmailView;
cancel = true;
} else if (!isEmailValid(email)) {
mEmailView.setError(getString(R.string.error_invalid_email));
focusView = mEmailView;
cancel = true;
}
if (cancel) {
// There was an error; don't attempt login and focus the first
// form field with an error.
focusView.requestFocus();
} else {
// Show a progress spinner, and kick off a background task to
// perform the user login attempt.
showProgress(true);
mAuthTask = new UserLoginTask(email, password);
mAuthTask.execute((Void) null)
}
}
Your attemptLogin(); needs to be called within the else { } of your if.
Currently, it's being called before your if, so it will attempt to login even if your email or password fields are empty.
This was probably just an oversight on your part. If not, you might want to brush on Java by doing the exercises on the following web site. http://codingbat.com/java

Android TodoApp with ListView - list don't show up

I am writing a simple todo-app and working on the listView. Following the tutorial http://www.vogella.com/tutorials/AndroidListView/article.html#tutorial_ownadapter
My problem is that the list of todos don't show up in the listView. I get no exception or error that indicates it is not working.
I am working with the android sqlite database. When I start the activity, I write objects to the database and read them out, print them in log. So this part is working, you can see in the log.
Then I add the object to my own adapter and set the adapter to the listView.
I don't know what goes wrong. Here is my Project: https://github.com/Visores/de.fhb.android.todoapp/tree/master/MyTodoApp
and here is the log after starting activity the app:
12-06 06:02:46.977: I/ActivityManager(1261): Start proc de.fhb.maus.android.mytodoapp for activity de.fhb.maus.android.mytodoapp/.activities.LoginActivity: pid=2576 uid=10064 gids={50064}
12-06 06:02:47.117: D/dalvikvm(2576): GC_FOR_ALLOC freed 36K, 4% free 3552K/3680K, paused 31ms, total 34ms
12-06 06:02:47.227: D/(2576): HostConnection::get() New Host Connection established 0xb7dc0a70, tid 2576
12-06 06:02:47.247: W/EGL_emulation(2576): eglSurfaceAttrib not implemented
12-06 06:02:47.257: D/OpenGLRenderer(2576): Enabling debug mode 0
12-06 06:02:47.567: I/ActivityManager(1261): Displayed de.fhb.maus.android.mytodoapp/.activities.LoginActivity: +609ms (total +7s839ms)
12-06 06:02:49.237: I/ActivityManager(1261): START u0 {cmp=de.fhb.maus.android.mytodoapp/.activities.TodoOverviewActivity} from pid 2576
12-06 06:02:49.277: D/dalvikvm(2576): GC_FOR_ALLOC freed 105K, 5% free 3960K/4140K, paused 2ms, total 3ms
12-06 06:02:49.287: D/dalvikvm(2576): GC_FOR_ALLOC freed 7K, 3% free 4264K/4368K, paused 2ms, total 2ms
12-06 06:02:49.297: I/dalvikvm-heap(2576): Grow heap (frag case) to 6.654MB for 2536932-byte allocation
12-06 06:02:49.317: D/dalvikvm(2576): GC_FOR_ALLOC freed 1K, 2% free 6740K/6848K, paused 18ms, total 18ms
12-06 06:02:49.387: D/Todos(2576): [Todo [id=1, name=one, description=one, isDone=false, isImportant=true, maturityDate=1231232], Todo [id=2, name=two, description=two, isDone=true, isImportant=true, maturityDate=1231232], Todo [id=3, name=three, description=three, isDone=true, isImportant=false, maturityDate=1231232], Todo [id=4, name=four, description=four, isDone=true, isImportant=true, maturityDate=1231232]]
12-06 06:02:49.427: W/EGL_emulation(2576): eglSurfaceAttrib not implemented
12-06 06:02:49.457: I/ActivityManager(1261): Displayed de.fhb.maus.android.mytodoapp/.activities.TodoOverviewActivity: +220ms
greetings Visores
activity: https://github.com/Visores/de.fhb.android.todoapp/blob/master/MyTodoApp/src/de/fhb/maus/android/mytodoapp/activities/TodoOverviewActivity.java
adapter:
https://github.com/Visores/de.fhb.android.todoapp/blob/master/MyTodoApp/src/de/fhb/maus/android/mytodoapp/adapter/TodoArrayAdapter.java
layout for list row:
https://github.com/Visores/de.fhb.android.todoapp/blob/master/MyTodoApp/res/layout/rowlayout.xml
layout of activity:
https://github.com/Visores/de.fhb.android.todoapp/blob/master/MyTodoApp/res/layout/todo_overview.xml
consider changing
super(context, R.layout.rowlayout);
to
super(context, R.layout.rowlayout,todos);
or override getCount method
#Override
public int getCount() {
// TODO Auto-generated method stub
return todos.size();
}

Facebook login crash with no error (Parse.com) android

My app crashes when I am trying to login with parse.com facebook login. I tried to debug and found out that the code never gets the callback, here is the login code:
ParseFacebookUtils.logIn(thisActivity, new LogInCallback() {
#Override
public void done(ParseUser user, ParseException err) {
if (user == null) { // the code never gets here
Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew()) {
Log.d("MyApp", "User signed up and logged in through Facebook!");
} else {
Log.d("MyApp", "User logged in through Facebook!");
}
}
});
here is the logcat (couldn't find any error):
06-24 21:04:39.760: D/dalvikvm(2634): GC_FOR_ALLOC freed 80K, 7% free 2612K/2796K, paused 26ms, total 28ms
06-24 21:04:39.760: I/dalvikvm-heap(2634): Grow heap (frag case) to 3.107MB for 480016-byte allocation
06-24 21:04:39.830: D/dalvikvm(2634): GC_FOR_ALLOC freed <1K, 6% free 3080K/3268K, paused 64ms, total 64ms
06-24 21:04:39.850: D/dalvikvm(2634): GC_CONCURRENT freed <1K, 6% free 3082K/3268K, paused 4ms+2ms, total 23ms
06-24 21:04:39.990: D/libEGL(2634): loaded /system/lib/egl/libEGL_tegra.so
06-24 21:04:39.990: E/(2634): file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!
06-24 21:04:39.990: I/(2634): Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl
06-24 21:04:40.000: I/(2634): Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl
06-24 21:04:40.000: D/libEGL(2634): loaded /system/lib/egl/libGLESv1_CM_tegra.so
06-24 21:04:40.000: D/libEGL(2634): loaded /system/lib/egl/libGLESv2_tegra.so
06-24 21:04:40.060: I/(2634): Loading GLESv2 implementation /system/lib//egl/libGLESv2_tegra_impl
06-24 21:04:40.060: D/OpenGLRenderer(2634): Enabling debug mode 0
06-24 21:04:40.390: D/dalvikvm(2634): GC_CONCURRENT freed 247K, 10% free 3257K/3608K, paused 4ms+3ms, total 25ms
06-24 21:04:40.940: D/TextView(2634): Constructor - Got Res id for appearance for textColorPrimaryInverse
06-24 21:04:40.940: W/ResourceType(2634): Skipping entry 0x1060001 in package table 0 because it is not complex!
06-24 21:04:40.940: D/TextView(2634): Constructor - Got appearance for textColorPrimaryInverse
06-24 21:04:40.940: D/TextView(2634): Constructor -- Got mEditTextBackgroundColor
06-24 21:04:40.970: D/TextView(2634): Constructor - Got Res id for appearance for textColorPrimaryInverse
06-24 21:04:40.970: W/ResourceType(2634): Skipping entry 0x1060001 in package table 0 because it is not complex!
06-24 21:04:40.970: D/TextView(2634): Constructor - Got appearance for textColorPrimaryInverse
06-24 21:04:40.970: D/TextView(2634): Constructor -- Got mEditTextBackgroundColor
06-24 21:04:40.990: D/dalvikvm(2634): GC_FOR_ALLOC freed 222K, 9% free 3381K/3708K, paused 21ms, total 21ms
06-24 21:04:40.990: I/dalvikvm-heap(2634): Grow heap (frag case) to 3.858MB for 480016-byte allocation
06-24 21:04:41.010: D/dalvikvm(2634): GC_FOR_ALLOC freed <1K, 8% free 3849K/4180K, paused 19ms, total 19ms
06-24 21:04:41.030: D/dalvikvm(2634): GC_CONCURRENT freed 32K, 9% free 3818K/4180K, paused 2ms+2ms, total 16ms
06-24 21:04:41.050: D/dalvikvm(2634): GC_FOR_ALLOC freed <1K, 9% free 3818K/4180K, paused 13ms, total 13ms
06-24 21:04:41.050: I/dalvikvm-heap(2634): Grow heap (frag case) to 4.285MB for 480016-byte allocation
06-24 21:04:41.060: D/dalvikvm(2634): GC_FOR_ALLOC freed 0K, 8% free 4287K/4652K, paused 16ms, total 16ms
06-24 21:04:41.080: D/dalvikvm(2634): GC_CONCURRENT freed <1K, 8% free 4287K/4652K, paused 1ms+1ms, total 15ms
EDIT
*EDIT:*
I think I found the source of the problem, when I am trying to access the declaration of logIn of ParseFacebookUtils I am getting this page: Class File editor (the jar of this class file belongs to container 'android dependencies' which does not allow modification to source attachments on its entries.).
Also I have updated my parse sdk version from 1.2.4 to 1.3 by deleting the old sdk from libs and adding the new one with it's content (total of 4 files and folder).
Why the app crashes? why there is no error?? Thanks for any help.
Try to clear logcat/clear project and restart eclipse, sometimes thats the reason that no error is being shown up
The problem was with my Manifest (some wrong properties).

SSID vs BSSID: Connecting to Wifi via Android Programatically / Using WifiManager to connect to a network

I hear some developers are unable to connect to wifi when specifiying the SSID:
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/di4gMhC0ZTY
However other developers are connecting via the SSID:
How do I connect to a specific Wi-Fi network in Android programmatically?
Which method should be used?
I currently cannot connect.
SOURCE:
import java.util.List;
import android.app.Activity;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.util.Log;
import android.content.Context;
public class Connect extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.connect);
String networkSSID = "ANDRE-PC_NETWORK";
String networkPass = "superman";
WifiConfiguration conf = new WifiConfiguration();
conf.SSID = "\"" + networkSSID + "\""; //ssid must be in quotes
conf.wepKeys[0] = "\"" + networkPass + "\"";
conf.wepTxKeyIndex = 0;
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
conf.preSharedKey = "\""+ networkPass +"\"";
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
WifiManager wifiManager = (WifiManager)getSystemService(WIFI_SERVICE);
wifiManager.addNetwork(conf);
List<WifiConfiguration> list = wifiManager.getConfiguredNetworks();
for( WifiConfiguration i : list ) {
if(i.SSID != null && i.SSID.equals("\"" + networkSSID + "\"")) {
wifiManager.disconnect();
wifiManager.enableNetwork(i.networkId, true);
wifiManager.reconnect();
break;
}
}
}}
LOGCAT:
04-04 12:05:11.843: I/ActivityManager(479): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.wifi.connect/.Connect} from pid 2785
04-04 12:05:11.873: D/Finsky(1555): [159] ConsumptionAppServiceConn.getDataFromService: retrieved 20 documents from [2]
04-04 12:05:11.923: D/dalvikvm(479): GC_FOR_ALLOC freed 2477K, 23% free 17481K/22424K, paused 59ms, total 60ms
04-04 12:05:11.943: D/AndroidRuntime(2785): Shutting down VM
04-04 12:05:11.953: D/dalvikvm(2795): Late-enabling CheckJNI
04-04 12:05:11.953: D/dalvikvm(2785): GC_CONCURRENT freed 96K, 17% free 500K/600K, paused 0ms+0ms, total 3ms
04-04 12:05:11.953: D/jdwp(2785): Got wake-up signal, bailing out of select
04-04 12:05:11.953: D/dalvikvm(2785): Debugger has detached; object registry had 1 entries
04-04 12:05:11.953: I/ActivityManager(479): Start proc com.wifi.connect for activity com.wifi.connect/.Connect: pid=2795 uid=10110 gids={50110, 3003, 1028}
04-04 12:05:12.073: D/dalvikvm(785): GC_FOR_ALLOC freed 2349K, 25% free 18097K/24032K, paused 40ms, total 40ms
04-04 12:05:12.073: D/Finsky(1555): [1] ConsumptionAppDataCache.setConsumptionAppData: data didn't change for backend=[2], ignoring!
04-04 12:05:12.093: D/dalvikvm(479): GC_CONCURRENT freed 2628K, 24% free 17135K/22424K, paused 3ms+24ms, total 171ms
04-04 12:05:12.143: D/dalvikvm(2795): GC_FOR_ALLOC freed 74K, 3% free 7379K/7580K, paused 19ms, total 19ms
04-04 12:05:12.163: I/dalvikvm-heap(2795): Grow heap (frag case) to 10.841MB for 3686416-byte allocation
04-04 12:05:12.193: D/dalvikvm(2795): GC_FOR_ALLOC freed 1K, 2% free 10977K/11184K, paused 30ms, total 30ms
04-04 12:05:12.233: D/dalvikvm(2795): GC_CONCURRENT freed <1K, 2% free 10977K/11184K, paused 4ms+3ms, total 41ms
04-04 12:05:12.363: D/dalvikvm(785): GC_FOR_ALLOC freed 2349K, 25% free 18097K/24032K, paused 49ms, total 49ms
04-04 12:05:12.393: D/dalvikvm(479): GC_CONCURRENT freed 2439K, 24% free 17143K/22424K, paused 14ms+13ms, total 184ms
04-04 12:05:12.503: D/dalvikvm(785): GC_FOR_ALLOC freed 2349K, 25% free 18097K/24032K, paused 28ms, total 28ms
04-04 12:05:12.533: D/dalvikvm(479): GC_CONCURRENT freed 2423K, 24% free 17098K/22424K, paused 3ms+9ms, total 100ms
04-04 12:05:12.533: D/dalvikvm(479): WAIT_FOR_CONCURRENT_GC blocked 1ms
04-04 12:05:12.543: D/dalvikvm(2795): GC_FOR_ALLOC freed <1K, 2% free 10977K/11184K, paused 18ms, total 18ms
04-04 12:05:12.563: I/dalvikvm-heap(2795): Grow heap (frag case) to 17.067MB for 6529744-byte allocation
04-04 12:05:12.583: D/dalvikvm(2795): GC_FOR_ALLOC freed 0K, 2% free 17353K/17564K, paused 19ms, total 19ms
04-04 12:05:12.613: D/dalvikvm(2795): GC_CONCURRENT freed <1K, 2% free 17353K/17564K, paused 4ms+12ms, total 37ms
04-04 12:05:12.623: D/dalvikvm(2333): GC_CONCURRENT freed 174K, 6% free 7846K/8304K, paused 10ms+37ms, total 71ms
04-04 12:05:12.633: D/dalvikvm(785): GC_FOR_ALLOC freed 2349K, 25% free 18097K/24032K, paused 37ms, total 37ms
04-04 12:05:12.643: D/dalvikvm(479): GC_CONCURRENT freed 2359K, 24% free 17093K/22424K, paused 4ms+10ms, total 97ms
04-04 12:05:12.663: I/ActivityManager(479): Start proc com.android.keychain for broadcast com.android.keychain/.KeyChainBroadcastReceiver: pid=2819 uid=1000 gids={41000, 1015, 1028, 3002, 3001, 3003, 3007}
04-04 12:05:12.703: W/ContextImpl(2819): Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1352 android.content.ContextWrapper.startService:450 android.content.ContextWrapper.startService:450 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:2376
04-04 12:05:12.753: I/ActivityManager(479): Start proc com.google.android.googlequicksearchbox for broadcast com.google.android.googlequicksearchbox/com.google.android.apps.sidekick.GmmLocationProviderImpl$GmmPackageWatcher: pid=2837 uid=10055 gids={50055, 3003, 1028, 1007, 3002, 1015, 1006}
04-04 12:05:12.793: I/ActivityManager(479): No longer want com.google.android.gms (pid 2258): empty #17
04-04 12:05:12.823: I/ActivityManager(479): Start proc com.google.android.partnersetup for content provider com.google.android.partnersetup/.RlzAppProvider: pid=2854 uid=10025 gids={50025, 3003, 1028}
04-04 12:05:12.853: D/GStaticConfiguration(2837): #loadConfiguration
04-04 12:05:12.873: D/GStaticConfiguration(2837): #loadConfiguration from preference
04-04 12:05:12.883: E/wpa_supplicant(594): Line 0: Invalid WEP key length 8 - this network block will be ignored
04-04 12:05:12.913: D/dalvikvm(2837): GC_CONCURRENT freed 233K, 5% free 7558K/7916K, paused 4ms+2ms, total 45ms
04-04 12:05:12.913: D/dalvikvm(2837): WAIT_FOR_CONCURRENT_GC blocked 8ms
04-04 12:05:12.913: D/dalvikvm(2837): WAIT_FOR_CONCURRENT_GC blocked 8ms
04-04 12:05:12.913: D/dalvikvm(2837): WAIT_FOR_CONCURRENT_GC blocked 9ms
04-04 12:05:12.913: W/GAV2(2837): Thread[main,5,main]: Connection to service failed 1
04-04 12:05:12.913: W/ActivityManager(479): Unable to start service Intent { act=com.google.android.gms.analytics.service.START (has extras) } U=0: not found
04-04 12:05:12.923: I/wpa_supplicant(594): wlan0: CTRL-EVENT-DISCONNECTED bssid=20:4e:7f:08:61:e6 reason=3 locally_generated=1
04-04 12:05:12.933: D/GStaticConfiguration(2837): Configuration loaded [70]
04-04 12:05:12.933: W/GAV2(2837): Thread[main,5,main]: Need to call initialize() and be in fallback mode to start dispatch.
04-04 12:05:12.933: D/CommandListener(123): Clearing all IP addresses on wlan0
04-04 12:05:12.943: D/ConnectivityService(479): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
04-04 12:05:12.943: D/ConnectivityService(479): Attempting to switch to BLUETOOTH_TETHER
04-04 12:05:12.943: D/ConnectivityService(479): Attempting to switch to ETHERNET
04-04 12:05:12.963: D/NetUtils(479): android_net_utils_resetConnections in env=0x68afd138 clazz=0x3e400001 iface=wlan0 mask=0x3
04-04 12:05:12.963: D/ConnectivityService(479): resetConnections(wlan0, 3)
04-04 12:05:12.973: W/Smack/Packet(898): notify conn break (IOEx), close connection
04-04 12:05:12.973: W/Sidekick_LocationOracleImpl(2837): Best location was null
04-04 12:05:12.973: I/ActivityManager(479): Start proc jp.co.omronsoft.iwnnime.ml for broadcast jp.co.omronsoft.iwnnime.ml/.UninstallReceiver: pid=2883 uid=10062 gids={50062, 1028}
04-04 12:05:12.993: D/ConnectivityService(479): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
04-04 12:05:12.993: D/ConnectivityService(479): Attempting to switch to BLUETOOTH_TETHER
04-04 12:05:12.993: D/ConnectivityService(479): Attempting to switch to ETHERNET
04-04 12:05:12.993: D/NetUtils(479): android_net_utils_resetConnections in env=0x68afd138 clazz=0x40a00001 iface=wlan0 mask=0x3
04-04 12:05:12.993: D/ConnectivityService(479): resetConnections(wlan0, 3)
04-04 12:05:12.993: I/ActivityManager(479): No longer want com.google.android.calendar (pid 2122): empty #17
04-04 12:05:12.993: I/ActivityManager(479): No longer want com.android.providers.calendar (pid 2142): empty #17
04-04 12:05:13.083: I/ActivityManager(479): No longer want com.google.android.talk (pid 2217): empty #17
04-04 12:05:13.113: I/ActivityManager(479): Start proc com.google.android.gms for broadcast com.google.android.gms/.common.receiver.SystemBroadcastReceiver: pid=2900 uid=10021 gids={50021, 3003, 1007, 1028, 1015, 2001, 3006}
04-04 12:05:13.113: I/ActivityManager(479): Displayed com.wifi.connect/.Connect: +1s174ms
04-04 12:05:13.123: I/qtaguid(898): Failed write_ctrl(u 50) res=-1 errno=22
04-04 12:05:13.123: I/qtaguid(898): Untagging socket 50 failed errno=-22
04-04 12:05:13.123: W/NetworkManagementSocketTagger(898): untagSocket(50) failed with errno -22
04-04 12:05:13.123: D/ConnectivityService(479): handleInetConditionChange: no active default network - ignore
04-04 12:05:13.193: D/dalvikvm(2900): Trying to load lib /data/app-lib/com.google.android.gms-2/libAppDataSearch.so 0x426085b0
04-04 12:05:13.203: D/dalvikvm(2900): Added shared lib /data/app-lib/com.google.android.gms-2/libAppDataSearch.so 0x426085b0
04-04 12:05:13.203: D/dalvikvm(2900): No JNI_OnLoad found in /data/app-lib/com.google.android.gms-2/libAppDataSearch.so 0x426085b0, skipping init
04-04 12:05:13.213: D/Icing(2900): Init last flush num docs 0 last docstore size 0
04-04 12:05:13.213: D/Icing(2900): Docid map file has no data, nothing to scan
04-04 12:05:13.213: D/Icing(2900): File /data/data/com.google.android.gms/files/AppDataSearch/main/cur/ds.perdocdata contains 0 records of size 6
04-04 12:05:13.213: D/Icing(2900): Init docstore ok num docs 0 bytes 0
04-04 12:05:13.263: V/Icing(2900): Lite index crc computed in 0.101ms
04-04 12:05:13.263: V/Icing(2900): Lite index init ok in 4.994ms
04-04 12:05:13.263: V/Icing(2900): Warming lite-index took 0.007ms
04-04 12:05:13.263: V/Icing(2900): Warming lexicon took 0.005ms
04-04 12:05:13.263: V/Icing(2900): Warming display mappings took 0.004ms
04-04 12:05:13.263: D/Icing(2900): Init index ok num docs 0
04-04 12:05:13.263: D/Icing(2900): Init done
P.S.
All I want to do is establish a connection to a specific wifi network. If anyone knows where to find a working copy of some source code which will do this which I can test - it may just resolve all my issues (the only post I've been able to find is the one shown above from S.O. and it isnt working)
You can try this way
conf.SSID = "\" + networkSSID + \""; //ssid must be in quotes
conf.wepKeys[0] = "\" + networkPass + \"";

Categories

Resources