app got FC in phone, but works in Emulator - Android Software Development

Hi there,
I wrote a small program for my phone, and it runs well on the android emulator. But when I install it on my phone, it got FC.
This program requires root authorization. My phone is rooted of course.
I just started learning the android programing. So wondering is there any method to debug on phone?
Thanks a lot.

geeti said:
Hi there,
I wrote a small program for my phone, and it runs well on the android emulator. But when I install it on my phone, it got FC.
This program requires root authorization. My phone is rooted of course.
I just started learning the android programing. So wondering is there any method to debug on phone?
Thanks a lot.
Click to expand...
Click to collapse
Logcat is your friend or try the tools from the SDK

First off, make sure the phone isn't just waiting for the debugger to attach... this has confused me in the past (and I've closed out before the FC thing went away).
Otherwise it might be a permission you forgot to give the app, something simple. (Usually it's the simple stuff, actually.)

You should be able to debug the app using eclipse.
Other than that logcat is really an invaluable tool for crashes. If you can't decipher it yourself, feel free to upload it here and we'll take a look.

geeti said:
Hi there,
So wondering is there any method to debug on phone?
Thanks a lot.
Click to expand...
Click to collapse
The debugger should work on your phone exactly the same way as it does in the emulator. Just make sure you have USB Debugging turned on.

The most common reason for FCs is that the app does not have the permission to do something. AFAIK the app does not require all the permissions when executed in the emulator. (e.g. vibration)

Related

how to become root user on android?

how can this be done so i can run certain apps?
anybody? come on guys ive searched everywhere, can it be done or not?
fixxxer2008 said:
anybody? come on guys ive searched everywhere, can it be done or not?
Click to expand...
Click to collapse
What exactly are you trying to run
clules94 said:
What exactly are you trying to run
Click to expand...
Click to collapse
screenshot and a cache cleaner. i do see there's a superuser permission app on my build but when i go to the terminal it says im still not root.
well i did alot of searching today and i don't think you can unlock this as technically we don't have a g1 or hero phone. we are running an image from a sd card. i still wonder how i can get root access to run certain apps? has anybody else addressed this issue because i can't find an answer.
fixxxer2008 said:
well i did alot of searching today and i don't think you can unlock this as technically we don't have a g1 or hero phone. we are running an image from a sd card. i still wonder how i can get root access to run certain apps? has anybody else addressed this issue because i can't find an answer.
Click to expand...
Click to collapse
umm.....open the terminal and type su?
zenulator said:
umm.....open the terminal and type su?
Click to expand...
Click to collapse
i did, it says permission denied!
well i think what im looking for is to become a superuser to be able to run certain market apps such as screenshot and a cache cleaner. ive searched everywhere here and on ppcgeeks with no luck. i did see something about a script that can allow certain apps at launch to run in superuser mode, is there anything like that at all? sorry if i keep asking but it's bugging me to no end and im sorta stuck. how did you guys get apps to run in root mode? is there a command i need to enter int he terminal? i do know i tried su and it said permission denied for me?
by the way what is the superuser permissions app i see on my build of cupcake? i launch it and it does nothing?
fixxxer2008 said:
i did, it says permission denied!
Click to expand...
Click to collapse
Using adb will always give you root access, for windows you need to install the adb drivers from my site. Remember we are using a read only root filesystem so apps that modify the root fs won't work. su in the ion build will also give you root.

Success rooting Bravo

Rooted my Bravo today with SuperOneClick, worked like a charm, and appears to be permanent (after several reboots). This is my first smart phone, so it's all new to me, but so far, so good.
New to smartphones myself. I was heavy in motomodding years back but this is new game for me. I still have yet to find a good noob tutorial (step by step) for installing non-markets (in particular sirius-xm app). I have rooted with S1C, but now what? I know , that's what the search forum button is for. I've done that, but all I find are mid-level talk, and not idiot(me)speak. I'll keep watching for examples. Thanks.
Once I got the phone rooted, I was relying on the SideLoad Wonder Machine I found on another site (lets you install .apk files through a point-and-click interface), but it failed to install several apps. Then I found out how to do it using ADB from the command line and so far, everthing I've tried has installed with no problem. I'm only semi-geeky, and I can grok what I've had to thus far. I started out at the command line in DOS 3.3 back in 1988, so delving into this has not been too hard. Kinda fun, actually.
Tomorrow I'll post up step by step instructions on how I did it the noon way. You have to buy an app called Root Explorer that gives you access to write on system files
Thanks alot. I will say the SWM program has worked great so far for installing nonmarkets. Very easy to use. Now I just need to learn how to remove all the dead weight and I'll be happy. I will say that the Sirius-xm app is VERY CPU intensive, so multitasking is difficult. Hoping removing uneeded processes will relieve some of the strain.
I'd love to be able to get rid of some of the bloatware apps that came with this phone, if for no other reason than to make it more 'mine.' The stock browser, Latitude, Mobile Video, Media Share, Social Networking (ack!) all gotta go.
hi Scrondar, could you post some basic instructions and links to superoneclick? i just got a bravo and would like to root it.
I have rooted and enabled non market apps via super one click 1.5.5. To get rid of bloatware I downloaded bloat freezer from the market. It does not totally remove them from the phone but freezes them from running in the back ground or appearing in the app drawer. It's 1.99 in the market I had to email the dev because it forced closed when I opened it but he was awesome about getting me a working version. Worth every penny. I wanted to freeze it because it gives you the option to defrost if you want. I think I read somewhere if you delete the stock apps from the phone it keeps you from updating to 2.2 or any other version of android in the future (if one is ever released for this phone). Although I may be wrong about that.
Chagla- You can find the link to rooting instructions on this site, but in a nutshell, I downloaded and installed the Moto USB drivers on my Win7 64-bit desktop machine, enabled USB Debugging on the Bravo (Settings->Applications->Development->USB Debugging (checked), downloaded and ran One Click Root (http://forum.xda-developers.com/showthread.php?t=739304), and that was it. Now, what I'd REALLY like to try is some custom ROMs on this phone, but as yet know of none that will safely work on it. Good luck!
why not z4root? did it not work?
cray1000 said:
why not z4root? did it not work?
Click to expand...
Click to collapse
Never got the chance to try it. By the time I was ready to try rooting, that app was no longer available on the Market, and then I found Super One-Click, which worked on my first attempt.

[Q] How to sideload apps without rooting or using a file manager app

Hey guys,
I've searched high and low in this forum and others for a solution to my problem, I have been unable to find one. I'm looking for a way to sideload apps onto a Kindle Fire so that, after the third party app has been installed, I can clear the Launcher data and the next time I start the device it boots to the setup and welcome screens like the very first boot.
The reason I want to avoid rooting or having to download a file manager app to the device is that I am planning to create a script for the process.
Any advice or links to a helpful guide?
lama1130 said:
Hey guys,
I've searched high and low in this forum and others for a solution to my problem, I have been unable to find one. I'm looking for a way to sideload apps onto a Kindle Fire so that, after the third party app has been installed, I can clear the Launcher data and the next time I start the device it boots to the setup and welcome screens like the very first boot.
The reason I want to avoid rooting or having to download a file manager app to the device is that I am planning to create a script for the process.
Any advice or links to a helpful guide?
Click to expand...
Click to collapse
Now I'm confused, on the Android Forums you said it was so you could give it to someone as a gift and you wanted to give them the "first-time use" experience. I really don't see anyone needing a script for something like this but I may be wrong.
It's more of a fun project for me than anything else, a Kindle Fire loaded with apps makes for a great and affordable gift and I have other family members who I intend to give the Kindle Fire to as a gift. But I don't want them to feel as though I've been mucking with it
lama1130 said:
It's more of a fun project for me than anything else, a Kindle Fire loaded with apps makes for a great and affordable gift and I have other family members who I intend to give the Kindle Fire to as a gift. But I don't want them to feel as though I've been mucking with it
Click to expand...
Click to collapse
I completely understand, I still think the easiest way would be to just use ES file explorer, or something similar, to install them and then just delete the app. Maybe someone here will have a different idea.
I may be confused, but couldn't youbjust build a rom with the apps loaded in and flash it?
Sent from my ADR6300 using XDA App
Twisted politiks said:
I may be confused, but couldn't youbjust build a rom with the apps loaded in and flash it?
Sent from my ADR6300 using XDA App
Click to expand...
Click to collapse
Perhaps. Can you link me to any guides on this?
Are you trying to make a script that will be run on a computer or on the Fire itself? If you're running the script on an actual device (terminal emulator, gscript, etc):
Code:
pm install /path/to/file.apk
In that case the .apk will need to be copied onto the device first. If you're running a script from a computer and have the device plugged in via USB you can use:
Code:
adb install /path/to/file.apk
...and for that one the .apk needs to be on your computer somewhere. I know 'adb install' doesn't require root. I don't remember if 'pm install' does, but I think it doesn't. Either way, you just need to get a copy of the .apks you want to install.
Cant you just reset the device to factory defaults from the settings?
iroctheworld said:
Cant you just reset the device to factory defaults from the settings?
Click to expand...
Click to collapse
That gets rid of your apps as well.
eldarerathis said:
Are you trying to make a script that will be run on a computer or on the Fire itself? If you're running the script on an actual device (terminal emulator, gscript, etc):
Code:
pm install /path/to/file.apk
In that case the .apk will need to be copied onto the device first. If you're running a script from a computer and have the device plugged in via USB you can use:
Code:
adb install /path/to/file.apk
...and for that one the .apk needs to be on your computer somewhere. I know 'adb install' doesn't require root. I don't remember if 'pm install' does, but I think it doesn't. Either way, you just need to get a copy of the .apks you want to install.
Click to expand...
Click to collapse
I don't have any experience using adb, but I'll start looking into it.

kjrnl.nb

Hi,
The file kjrnl.nb was seeking root access from SuperSU today. I granted it and it proceeded to make changes to iptables. Anyone know what this file is? Upon entering super SU gui I was asked to update the super su binary.
Sent from my iPad using Tapatalk
cantenna said:
Hi,
The file kjrnl.nb was seeking root access from SuperSU today. I granted it and it proceeded to make changes to iptables. Anyone know what this file is? Upon entering super SU gui I was asked to update the super su binary.
Sent from my iPad using Tapatalk
Click to expand...
Click to collapse
If I were you I would immediately do a full wipe of your system and reflash your rom. Sound like a virus/trojan etc.
If you don't know what it is then DO NOT give it root acces. If you don't know what it is, then you don't need it.
Thanks, it hasn't popes back up. Since my restored nand droid. I've narrowed it down to 20 or so possible apps. When I have more time I may try to pin poi t the app. Wish there was an app I found run in the background that would log in detail.
,...................
cantenna said:
Thanks, it hasn't popes back up. Since my restored nand droid. I've narrowed it down to 20 or so possible apps. When I have more time I may try to pin poi t the app. Wish there was an app I found run in the background that would log in detail.
Click to expand...
Click to collapse
Hi, have you found the origin of this file? It runs only when I boot the phone (n910c) and I can't find the file kjrnl.nb but it shows running with "busybox ps". It might be something that gets uncompressed realtime during boot. I have always to kill the PID after boot.
Thanks for any insight.

[Q] Writing an app, works in emulator, crashes on device

Hi Folks, Hopefully this is the right place for this thread. I don't get over here very often so I'm guessing right now.
I wrote an app for my phone (Sprint Galaxy SIII) in Eclipse to control a IOIO (not terribly important to know for this question). I run the app in the emulator and it fires up just fine, but when I run it on my phone (with supposedly the same settings as the emulator--Android version, AP level, etc) it crashes on startup, saying "Unfortunately, <My App> has stopped".
Since it works in the emulator I can't track LogCat to check for errors, so I have no idea where to start looking for the cause. It only crashes on my actual device. My questions are as follows:
1) What would cause an app to work in the emulator but fail to start up in a device with (supposedly) the same settings?
2) Where can I go to look for errors on my phone (if possible) that might point me to the problem?
Thanks!
Matt
DerStrom8 said:
Hi Folks, Hopefully this is the right place for this thread. I don't get over here very often so I'm guessing right now.
I wrote an app for my phone (Sprint Galaxy SIII) in Eclipse to control a IOIO (not terribly important to know for this question). I run the app in the emulator and it fires up just fine, but when I run it on my phone (with supposedly the same settings as the emulator--Android version, AP level, etc) it crashes on startup, saying "Unfortunately, <My App> has stopped".
Since it works in the emulator I can't track LogCat to check for errors, so I have no idea where to start looking for the cause. It only crashes on my actual device. My questions are as follows:
1) What would cause an app to work in the emulator but fail to start up in a device with (supposedly) the same settings?
2) Where can I go to look for errors on my phone (if possible) that might point me to the problem?
Thanks!
Matt
Click to expand...
Click to collapse
Only log could tell you the possible reasons.
Install catalog and look for the error log
Sent from my A0001 using Tapatalk 2
Vivek_Neel said:
Only log could tell you the possible reasons.
Install catalog and look for the error log
Sent from my A0001 using Tapatalk 2
Click to expand...
Click to collapse
Thanks Vivek_Neel. I tried a couple of log viewer apps but they all require superuser access for use on Android 4.1+. I forgot to add it to my profile, but I currently have a Galaxy SIII running Android 4.4.2.
Any other suggestions? I'd rather not root my phone if I don't have to.
Thanks,
Matt
DerStrom8 said:
Thanks Vivek_Neel. I tried a couple of log viewer apps but they all require superuser access for use on Android 4.1+. I forgot to add it to my profile, but I currently have a Galaxy SIII running Android 4.4.2.
Any other suggestions? I'd rather not root my phone if I don't have to.
Thanks,
Matt
Click to expand...
Click to collapse
Running the app on your phone with it plugged in to a pc and eclipse open should mean that eclipse catches the log, no root access needed, you would need to allow adb debugging though. If it doesn't work with eclipse I know for definite that it works with Android Studio.
Jonny said:
Running the app on your phone with it plugged in to a pc and eclipse open should mean that eclipse catches the log, no root access needed, you would need to allow adb debugging though. If it doesn't work with eclipse I know for definite that it works with Android Studio.
Click to expand...
Click to collapse
Eclipse doesn't seem to recognize my phone. It only brings up the emulator as an available device. Perhaps I should dig more into the cause of that first. You're saying if I load the app on my phone while connected to the PC it'll still show up in the logcat? That would be a huge help if that's the case!
DerStrom8 said:
Eclipse doesn't seem to recognize my phone. It only brings up the emulator as an available device. Perhaps I should dig more into the cause of that first. You're saying if I load the app on my phone while connected to the PC it'll still show up in the logcat? That would be a huge help if that's the case!
Click to expand...
Click to collapse
It should do - worked this way around a year ago when I was using eclipse myself before jumping ship to AS.
You might want to handle uncaught exceptions and either debug, write to a file or what ever is the best way for you.
You can see an implementation example for handling uncaught exceptions here: http://stackoverflow.com/questions/8943288/how-to-implement-uncaughtexception-android.
Please note that some crashes are not caught using this technique so you'll need to use the above mentioned methods to view logcat.
If you have root on your device, install a logcat viewer application. most likely that filtering the display by your package name (or parts of it) we'll lead you to the error cause.
Thanks everyone for the help, I have found the solution. Eclipse wasn't recognizing my phone because apparently the driver was no longer installed (I thought I had installed it a long time ago, but that must have been on my laptop--I'm on my desktop now). I installed it and Eclipse found the phone no problem. I loaded the app while watching LogCat and found the following:
java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10211 nor current process has android.permission.BLUETOOTH.
Click to expand...
Click to collapse
Well that was embarrassing! Added the Bluetooth permissions to the app et voila! The app works just fine.
Thanks for your time!
Matt
DerStrom8 said:
Thanks everyone for the help, I have found the solution. Eclipse wasn't recognizing my phone because apparently the driver was no longer installed (I thought I had installed it a long time ago, but that must have been on my laptop--I'm on my desktop now). I installed it and Eclipse found the phone no problem. I loaded the app while watching LogCat and found the following:
Well that was embarrassing! Added the Bluetooth permissions to the app et voila! The app works just fine.
Thanks for your time!
Matt
Click to expand...
Click to collapse
:laugh::laugh:
Haha glad you got it sorted!

Categories

Resources