application failure on similar devices - android

I debug with a Samsung Galaxy SII, running 2.3.6. I created an app that runs fine, every time, even under stress, on this device. I uploaded for a colleague in another state, using a device with 2.3.7 (I believe it's a Nexus One).
On his device, the app gives a "Not responding - Force Close or Wait" dialog when clicking a button that switches a ListView's adapter between 2 DB Cursors.
I tried on the emulator. Literally an hour and 45 minutes later (most of this time was spent converting JSON from a remote server to a local SQLite DB on the device, which happens only once during install, and I don't believe has any bearing on the issue I'm describing), I was able to recreate the problem, but nothing was reported in logcat.
Any ideas why I'm seeing this different results? My device works every time, his fails every time. I've tried targetting 2.1 and 2.2 - both have the same results on both devices and the emulator.
TYIA

I have similar problem in the past. My app is failing on the HTC device and working fine on google experience phone and emulators. Fortunately for me, both devices are mine and I was able to track down the problem after some digging. The cause is some differences in implementation of UI(HTC sense) and a few basic applications. My app fails because surprisingly, HTC is doing a good job of tightening up some loose code.It is a bit of a corner case. So, you need to have access to that device or give him a special build with writing Log to a file and send you back the file for you to debug.

apparently the devices had different SQLite implementations. The issue was resolved by adding a missing index to one of the SQLite tables.

Related

Persistent error on Samsung Galaxy Note 5

Persistent error on Samsung Galaxy Note 5
this is a weird issue that i am having for almost a year now, i'll try to be brief.
background story (What i think happened)
I own a Chinese aftermarket car infotainment system, running android 4.4. So, being the obsolete piece of **** that it is, i started digging around, and found out that it has something called Device link or something along those lines.
you have to download an app called EasyConnection from the play store, enable developer mode, and enable usb debugging, i know that's not the safest thing to do with Chinese stuff, but that's the only option i have at my disposal, so i have to manage.
anyway, it worked flawlessly for a year or so, then suddenly it refused to connect, with an endless connecting message. and my phone started giving me the Attention message, this was a year ago, and never worked since.
Attention
The connected device is unable to access data on this device. Reconnect the USB cable and try again.
Android File Transfer or Samsung Smart Switch must be installed on Mac OS X devices. To download Android File Transfer, go to https://www.android.com/filetransfer, or to download Samsung Smart Switch, go to https://www.samsung.com/smartswitch.
Phone behavior
Since then, whenever i connect my phone to my PC, either running windows or linux, it displays the Attention message. i can access files on my phone no problem, and it is not driver related, as this happens regardless of what driver is installed, or in the case of linux, no driver is required.
Android development
Now, a couple of months back, i decided to dabble in android development , as i have a couple of sysadmin years under my belt, and a beginner level knowledge of a couple of programming languages, so i thought android development would be fun, but here is the problem.
While my device is hooked up to android studio, i get this aforementioned error on random long intervals, but i am able to run my apps from android studio to my phone no problem. So i started to link everything together, and thought to seek help here on reddit after some fruitless internet diving.
note
I did a factory reset for my phone a month or so ago, so the only step remaining in my mind right now is to re-flash the stock firmware (i'm on stock for security reasons), but i am reluctant to do so because of the hassle of re-configuring my device again.
I'm hoping to accomplish the following :
Resolve the cause of the error.
See if my car system works with my phone after the error is resolved
Any help would be greatly appreciated.

Could I recover my list from suddenly vanished GO Note android widget?

I've Samsung S3 (GT-I9300) with Omega v60 ROM (Android 4.3) and Boeffla Kernal 5.8 (3.0.101).
I was using SuperSU and in the one of it's updates, it messed with the ROOT so my device now went from ROOTED to NON-ROOTED.
My device was working normally today, and sometimes when it's loaded, the phone feels like it restarted when actually it didn't restart, and Boeffla notification says that I'm missing root which is obvious for sure.
I didn't wait for the phone to finish it's frozen status and make this restart-like thing, so I forced restart it by long-pressing the power button.
The device was stuck at the loading screen for two times until I removed the battery for like 5 minutes and then re-inserted it and powered on the phone to see that it's behaving like I've installed a new fresh ROM.
I had a long list of To-do in my GO Note widget and now I'm not able to recover this list.
Is there any way to restore the GO Note widget list ?
I was thinking that since I did't format or anything, I may access that list in a form of RAW data.
When I try to add an account as maybe I had cloud backup or something, it gives me an 403 error with disallowed_useragent error so maybe I can work my way from there.
Thanks in advance.

Custom apps wont turn on after reboot

I have written some basic apps for both iOS (using Swift) and android (using Xamarin). I am often bugged by a problem on both platforms: When I try to run my app from the device (that my IDE installed for me on the device) after a while, it just wont turn on (usually crashes without an error message within the first second of loading). Everything is always fine upon recompiling. With android, this happens usually whenever I haven't recompiled since last reboot. With iOS, it seems pretty independent on reboots, but usually happens within hours, sometimes days.
Why is that? Is there any way to prevent this (Preferably one that wouldn't drastically increase installing time, like posting my app on store or at least creating an installation package and installing it manually)?

How to debug when application works fine in emulator but fails in actual phones?

How can i debug when application works without error in emulator but force closes while doing SQLite operations on some screens?
Connect your phone to your dev machine
Make sure the emulator is not running
Open a command prompt and run adb logcat
Use application on your phone and trigger the error
Review the resulting stack trace in the logcat output
You can also view the logcat output in Eclipse via the debug or DDMS perspective.
You should connect the phone to your development machine and look at Logcat (or use the debugger) to see what is going on in the stack trace. You can also install an app (like CatLog) on the phone to view the log.
You just connect you phone and use debugger. When it is open just choose your phone...you can use and logcat too...
Everyone else commented about the technical tools available, so I'll try to explain the process we have with our app. Our app is pretty widely used, so we have a bunch of different devices to consider.
Create a beta group. There are a lot of devices, and it's impossible to test on all of them yourself unless your company has very deep pockets and you have a lot of time to test. Get a group of users together who are ok with things breaking, and ask them to beta test.
Look at what's different. This one seems obvious, but it's surprising how often this trips us up. If an app isn't working on certain devices, what's different about those devices? We once had a bug that only occurred when the app was in landscape mode, so we saw it mostly on devices that default to landscape mode. When you're trying to find the cause of a bug, ask yourself what the difference is between the scenario where the app doesn't work and the scenario where the app does work.
Use the tech available. Sometimes, the last two don't catch all the problems. Sometimes, you get a weird edge case. We had 2.3 devices that didn't implement a deprecated method-- even though the method was deprecated in 3.0. For whatever reason, they didn't implement the method and left us without its replacement, so we had to use a backwards compatibility package. But the only reason this came to light was because we got access to the logcat reports from users who experienced the bug. Moral of the story: manufacturers do weird stuff.
You're not going to be able to catch everything. There are just too many subtle and non-sensical differences. But (especially with beta testing) you should be able to catch 99.99% of the problems before they happen.

Reasons why my Android App would crash on my phone consistently, but not on my emulator

I have an app that uses quite a few graphics in it.
When I open and close my app repeatedly on my emulator (1.5 - 2.2) it runs fine and by checking the heap I can see everything is being cleaned and gc'd properly.
However, when I run my app on an HTC Aria phone (2.1) the app crashes every time I try to re-open it. When I look at the heap I can see that objects are NOT being cleaned up like they are in the emulator.
Does anyone know why this behavior could be happening? I did try it on another HTC Aria (a friends) and it crashed the same way as on my phone so I think it's not just isolated to my particular phone.
Any thoughts or ideas would be really appreciated on why things are cleaning up properly on the emulator, but not on my phone. One thing to note, is that I DID have it working and gc'ing fine on my phone a few days ago and I didn't change much and now it's not working on my phone so it's a bit of a mystery to me.
Thanks!
Note:
The crash is caused by an OutOfMemory Exception. I'm pre-loading a handful of graphics, and there's not enough memory for two instances of the application to be running at the same time so it's crashing because the 1st instance of the application was not cleaned up properly.
You have several emulators, all running just this app, closing it and start it again.
Your Android device has several processes running the same time, like background sync, Facebook notification, Twitter notification, Calendar sync, Contacts sync and the like.
One way to look at this is to try to mimic your Android device state on your different emulators, and see if you can get the same error on the emulators. Use some apps that sync in the background and others who use a lot of memory. Then you have a testing environment that mimics the real world, and you can change your app up to a state where it doesn't crash. Maybe downsize the images as much as you can to ease memory usage.
Remember, you can never force the Garbace Collector to start. You can only tell the system that it is possible to collect this garbage.

Categories

Resources