Android: How to know where the app is running
-
There is some way to know if my Android app is running on debugger or on a phone?. I want to check some variable, property, or something like that to know where the app is running to prevent some crash when I call some 3rd applications (not available on debugging time) Thanks and sorry for my poor english
-
Answer:
You might want to look into http://developer.android.com/guide/developing/debugging/ddms.html You can access logs, threads and heap information. also check running apps and services. You can also simulate phone behaviours on the emulator, like an incoming call, as an example. Well, I would also recommend reading all the information in the http://developer.android.com/guide/developing/debugging/index.html section, there are a lot of useful tools available for Android developers.
Mark Comix at Stack Overflow Visit the source
Other answers
You mean detecting the emulator? Because you can run under debugger also on your device. Use this to detect the emulator (worked for me a while ago): "google_sdk".equals(Build.MODEL)
Peter Knego
Related Q & A:
- Android::How to Create an app for a book?Best solution by Stack Overflow
- How to check if application is still running on Android?Best solution by Stack Overflow
- How can I make my nose stop running?Best solution by Yahoo! Answers
- Do you know where (how) can I find Kabyles living in the UK?Best solution by Yahoo! Answers
- Does anyone know good online app games for iPod?Best solution by 148apps.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.