Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:25:34+00:00 2026-06-03T20:25:34+00:00

I have a problem with my Windows Phone app. The app uses all the

  • 0

I have a problem with my Windows Phone app.

The app uses all the device sensors: gps, accelerometer and compass

When I run it in the emulator it’s fine and when I debug it on the phone it’s fine.

But when I remove the USB cable from the device and start the app again it crashes very soon and I dont know how to find out why because the debugger is not attached.

How can I debug such a problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:25:36+00:00Added an answer on June 3, 2026 at 8:25 pm

    There are a number of reasons that this can happen. It’s hard to pinpoint precisely what’s going on without some debug output, but here is a brief run down of the likely culprits:

    Most Likely…

    The most likely thing that’s causing your app to crash in non-debug mode is poor start up time. I suspect you may be encountering what this S.O. question is all about. When the debugger is attached, the runtime bypasses the operating system’s function of killing any app that takes longer than 10 seconds to load. This is an easy thing to test for, simply remove all the code that’s being executed when the app starts up (I’m assuming you’re hooking into GPS stuff at that moment, just comment that stuff out).

    But Additionally…

    While the above might solve your problem, you have to be wary of a few other issues you may also encounter:

    When you access the GPS / Accelerometer / Compass you must check first to see if those sensors are actually accessible and provided by the phone. Not all windows phones are required to provide the compass. Take a look at the Hardware Specifications for Windows Phone. If you are trying to access the compass, and your device does not support the compass, then that could be your problem right there. More details on this here. The following code is an example of how you might check for the presence of the Compass on the device (note that the IsSupported will return true even if your device has the compass off).

    using Microsoft.Device.Sensors;
    
    public partial class MainPage : PhoneApplicationPage
    {
        Compass compass;
    
        public MainPage()
        {
            if (Compass.IsSupported)
            {
                // awesome. you have a compass
            }
            else
            {
                // uh oh… you have a crappy phone, no compass for you :(
            }
        }
    }
    

    Have You Tried Turning It On And Off Again?

    One of the other things you have to consider is that the device you are using has the GPS turned off (greater developers than you I am certain have made more foolish mistakes). If your GPS is turned off, or disabled, or the user (you, there, holding the device) has not authorized the app to use GPS data. See this article for dealing with the location considerations alone (a must-read if you’re developing GPS enabled WP7 apps anyways).

    Declare Your Intentions Sir

    Lastly, there can be issues if you don’t declare the things you’re accessing from the device in the application manifest file. Basically, if you don’t declare those as items your app uses, you can run into problems. The reason you need to declare what you’re app uses is so that Microsoft can appropriately filter/warn/inform users who are downloading your app from the marketplace of the information your app requires to operate.

    Battery Saver Mode

    When a Windows Phone is in battery saver mode some of the sensors will be turned off to save battery life (things like… GPS, Compass, and Accelerometer). This could easily happen if your device isn’t actually charging when it’s plugged into your dev machine.

    In Summary:

    • Check to see if your app is taking longer than 10 seconds to load
    • Make sure the device actually supports the sensors you are trying to access
    • Make sure that the data returned by the sensors is not causing your code to crash (for instance GPS may be on, but give a lat/long that is, according to your code errant, causing it to crash).
    • Make sure you declare usages in the application manifest file
    • Make sure your sensors are ON and you’re not in battery saver mode

    Hopefully one or all of the above helps you diagnose your problem. Lemme know if you find out that it’s something else, would be curious to know what else could be causing this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please assist with MVVM design/understanding problem. Given that we have a Windows Phone app
I have a strange problem with a Windows Phone (7.1/Mango) app. My understanding is
i have a problem with the stopping of a windows phone xna game. i
I have a problem after i setup windows 7 all old projects in c#
We're developing a Windows Phone 7 app and have a TextBlock defined like so:
I have a problem, I have written a simple Media Player for Windows Phone
I have been working fine with MVVM Light on a silverlight 4 Windows Phone
I have a problem with a class which extends ListBox in Windows Phone 7
I have built a windows phone 7 app with a sign in with google
For my Windows Phone 7 app, I have a main panorama page which opens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.