Emulator doesn't feel like emulating if I ignore it - android

I'm curious if anyone else is experiencing this problem or if it's just me. If I don't upload to the emulator for a few hours it seems to lose all interest in participating in today's activities until I close it and relaunch it. Android Studio shows it running in the Choose Device dialog when I hit Run, it's state is Online but when I hit ok it never launches in the emulator. I even get the "Session 'app': running" popup in the bottom corner of AS. When I close the emulator I get "Error accepting connection, aborting" in the Run panel. If I run again and launch a new device everything will be fine and I can upload as much as I want until I leave it for an undetermined amount of time.
Is there a fix for this? It's not a huge deal to restart the emulator, it's just kind of annoying.

you can directly use your android smart phone to run your application. There is no need to launch any emulator. its faster too. Just make sure that while attaching your smart phone to your Laptop/Desktop, you need to have phone driver in your Laptop/Desktop.

Related

Turn off phone debugging in Android Studio

I am using Android Studio 1.5.1 IDE.
I plugged up a Samsung phone to test with. Without even running the application I am testing, the LogCat constantly just scrolls data and it makes it difficult to focus on my app.
Is there a way to stop the console from showing phone debug logs and just show me my app when I am running it?
Yes, when running the application you are able to select your application in the dropdown highlighted in green here:
This causes only the output from that specific application to be shown during debugging/running.
If you're asking to never ever show the logs from your phone, I cannot help you with that.

Android Studio Freezes randomly while device is connected

I have a new installation of Android Studio, 1.3.2. I'm new to android programming so I haven't had this installed here before, but I did have the android SDK installed a long time ago so I could root my phone via adb. Still, presumably when I installed studio and downloaded the new sdk it should've overwritten any older files I had.
My problem is that about 30 to 40 percent of the time when I'm testing my app, the entire IDE just freezes. I hit the little Play icon on the header, it loads to my phone, the phone gets the app, I can test it. Most of the time it works, sometimes I lose all ability to interact with studio. The app on the phone works fine, but nothing brings studio back. Importantly, this is NOT a Windows style "not responding" bug. I can maximize and minimize the window and drag it around without it going grey, and task manager doesn't give me the "not responding error".
It stays like this until I unplug my phone, at which point it immediately executes all of the button presses that were queued up while I was trying to click places. This makes debugging rather difficult, as I can't actually see logcat and follow along.
I do get the following errors in the ADB Logs tab whenever I plug in either of my two phones
PropertyFetcher: AdbCommandRejectedException getting properties for device 44f76320: device offline
PropertyFetcher: AdbCommandRejectedException getting properties for device 44f76320: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
PropertyFetcher: AdbCommandRejectedException getting properties for device 44f76320: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
DeviceMonitor: ExecutionException getting info for device 44f76320
I've revoked the USB Debugging Authorizations on both phones and confirmed via the popup dialog that I want to trust this computer, but I don't know if these errors are involved in this problem or not.
One last thing that may or may not be related: sometimes even when it doesn't entirely freeze, logcat is ridiculously unresponsive. I'll crash my program on a null pointer, and it'll take upwards of 30 seconds for the stack trace to show up (this is not, by the way, a very large program if that matters). Sometimes it never shows up at all, even though things are connected and seem to be working, I just get nothing at all in logcat.
Thoughts? Even just ideas on what to try next would be most appreciated, I'm stuck and most of my googling seems to be bringing up very different issues than the ones I'm having.
Just in case anyone else runs into this, I eventually solved it after upgrading from Windows 8.1 to Windows 10. I didn't do a fresh install, I just ran the upgrade process. When I first launched Android Studio, it had to update a few things, and one of the things it updated was the Google USB Driver. I'm willing to wager that was my problem all along, and the OS upgrade wasn't at all necessary.
So if you have this problem, try updating your USB Driver.

How to close an android app from my phone after running from eclipse

I am trying to learn android development but after running my app through my phone it runs fine, but I can't close it. It doesn't even appear as a running app under apps on my phone settings. It doesn't appear anywhere on my phone but it is running. There doesn't seem to be any kind of stop button in eclipse.
How do I close the app on my phone/eclipse cleanly so I can carry on editing and re-run it?
The only thing I can think of is just unplugging the USB cable but I am afraid of breaking things. ADB feels fragile enough as it is.
I have searched a few answers on this site but they seem to be talking about something completely different.
You may use DDMS. Select process representing Your app on the list in top left window and click stop button You will see above.
Also, if you just re-install the app after some code change, it should re-run...even if you have the app open on your phone!
Hold down the home key until a list of running apps appears. Then just swipe it away :)
If you're truly interested in making an app go away completely then there's a FANTASTIC app called DevDrawer (https://play.google.com/store/apps/details?id=com.owentech.DevDrawer) that allows you to put package names of apps in it that you're currently developing. Trust me when I tell you that it will save you a LOT of time.

App won't launch on the device

No matter what app I try, it won't launch on the device. It works perfectly on emulator, but when I try to launch it on the device, it'll get uploaded & installed and then "Starting activity on device " appears and nothing happens - it just sits there and does nothing. When I repeat the process, eventually it will launch (but it has to be repeated like 5-10 times), but all those activity launching processes seem to remain active, which causes my phone to lag. I tried resetting adb, reinstalling Google USB drivers, nothing helps. I have a rooted phone, and custom ROM (it's called Darky's ROM 10.2) - could that be a problem maybe?
Sometimes it takes a long time to install and run, and ADB times out. Go to preferences in Eclipse, then to Android -> DDMS -> ADB connection time out (ms), and set it to something like 30000
You can try many things:
Compile and run a sample app on handset, does it run or not? If it doesnt then there may be a compilation environment (your PC) issue, signing or something else.
Download a free app from marketplace and see if you can run it.
Is this a standard Android phone or a rooted one? if its rooted then try on a standard handet.
Before installing do "adb kill-server" and then "adb start-server" to restart the adb. This may not be useful, but, just in case.
After installing the app, can you see it in Settings -> Applications -> Manage Applications menu?
Try a hard power cycle, by removing the data cable/charger and removing the battery for 10 seconds.
Also ensure that the emulator had the same screen dimensions as the handset you are testing on.
Attach Logcat and see what shows up there.
These tests will give you better idea of what is happening.

App Inventor app works in emulator, but not on my actual phone

I've got an app inventor app built and working pretty well in the emulator. When I put it on my phone none of the code runs. The app doesn't crash, but the code behind the objects doesn't do anything. I've got code which runs on screen load which doesn't fire, and my buttons don't do anything.
The drop downs show the menu item, but that's it.
Does anyone have any ideas?
Have you connected the phone with the Block Editor Open? Can u see live preview of the app being developed?
You need to install a small application "AppInventorPhoneApp" to the phone in-order to accomplishing this... Usually this will be installed when you connect the phone first time with your BlocksEditor...
Just connect the phone to the Blocks Editor. Blocks editor will automatically install this application. Then you can see the preview in Phone.
Click Download apk from app inventor. Then Click, Package for Phone--->Download To Connected Phone.
I hope this solves your issue.
Check if unknown Sources and Development options are turned on in the Application settings.... For an application to run without these, you have to sign it. (I am not sure about this)..

Categories

Resources