This week's book giveaway is in the Spring forum.
We're giving away four copies of Java Persistence with Spring Data and Hibernate and have Cătălin Tudose on-line!
See this thread for details.
Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Android app force closes on a real device but works on emulator

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My app has an action bar with tabs with 3 fragments (1-list fragment with the list of running processes, 2-battery and memory info, 3-just some text). It works fine, with no errors on the emulator, but on a real device it starts ok, I go through the tabs several times(I left the phone to go into sleep mode and back and the app still worked) and then it unexpectedly force closes. My phone isn't seen among the adb devices, so I don't know if there are any errors in the logcat(the one in eclipse).
I installed a LogCat app to my phone and I think these are the errors, but I'm not sure they are related to my app, because I've uninstalled the app several hours ago and the errors occured just now according to the timestamps:

Please help me!!!

So, I finally managed to make my phone visible and here are the errors




and the code for the class Battery


 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to do a better job of tracking down the error message. If the phone doesn't show up in Eclipse then turn on development tools and reconnect the phone. The error message doesn't really look like it is related to your error - but it is hard to tell. You should also be aware that the on-phone logcat apps really only work on phones that have been rooted (so if you didn't root your phone, the app is useless).
 
Katrinna Smith
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Steve Luke wrote:You have to do a better job of tracking down the error message. If the phone doesn't show up in Eclipse then turn on development tools and reconnect the phone. The error message doesn't really look like it is related to your error - but it is hard to tell. You should also be aware that the on-phone logcat apps really only work on phones that have been rooted (so if you didn't root your phone, the app is useless).



I tried to turn the debugging on , tried other things from the internet yet I still can't get my phone to be seen, so that's why I installed the logcat app on my phone
As for the logcat app, I didn't know the phone had to be rooted. I don't want to root my phone, so is there any other way to find the problem?
 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you should be doing is diving in to why you cant see your phone in ADB. Without that the best you can do is guess about what is happening. And we arent even equipped to do that since we know nothing about your app.
 
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A frequent issue why ADB does not work out of the box on Windows is incorrect or no USB drivers. The Android developer site has a lengthy article on how to resolve that. It can be tricky.

Once you have the right drivers, try the different ways Windows offers to connect - for one device I had to choose "camera" instead of "USB storage".

And, of course, make sure "USB Debugging" is enabled on the device.
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic