android sdk detecting emulator mode in java - android

Is there something I can code to skip the license check when running on the emulator? i don't want to comment out as I may forget to re-enable the check when releasing to the play store. i already have a check for "isDeviceOnline()" but this call receives TRUE.
(for some reason I always get a network error in my licensing check code when running on the emulator)

If your problem is emulator is not connected to network, causing network error. May be should restart emulator and make sure you have network connection.
I generally use Genymotion's emulator and they are pretty reliable and fast.

Related

Missing network param from emulator

I try to change the network type from android emulator. From the official android documentation (https://developer.android.com/studio/run/emulator-commandline.html), i want to use network to change LTE/UMTS/GPRS network type. I create a new emulator from the last Android Studio 2.2 and connect with telnet. I run the help command (after authentication) and I get :
Android console command help:
help|h|? print a list of commands
crash crash the emulator instance
kill kill the emulator instance
quit|exit quit control session
redir manage port redirections
power power related commands
event simulate hardware events
avd control virtual device execution
finger manage emulator fingerprint
geo Geo-location commands
sms SMS related commands
cdma CDMA related commands
gsm GSM related commands
rotate rotate the screen by 90 degrees
I don't see network as explain in the documentation and when I try to run a network command, I get an error... Anybody have already met this issue ? Any idea how to solve it ?
Ok, seems to be delete in last versions of the emulator. I hope the android team will implement this feature soon.
https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=emulator%20network%20unknown&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=-id%20-stars&id=204888

Why do i get time out in bluemix sample app?

I have followed the tutorial of bluemix that is called bluelist. See here: http://www.ibm.com/developerworks/library/mo-android-mobiledata-app/#N1021F
I have installed all required libs and i have installed everything in the bluemix side.
I get error IBMBLUEMIX-0554E: timeout expired before connection could be established.
any solutions?
This could be caused by a couple issues.
You could be attempting to access an internal test zone (AKA stage1) without being in the internal network. Make sure there is not stage1 present in your app route.
Your phone/emulator may not be connected to a network properly. Please be sure that your test device is connected to the internet via data service or local connection. You can try running a speed test on that device if in doubt. Some custom created emulators can also have issues of their own. Try using a physical device if possible.
You may be on a network using a proxy server. I have heard of timeout issues when using a proxy. You may need to use a network that does not utilize a proxy.
This issue comes intermittently some times due to network/connectivity issue.Also you need to Verify that your applicationId, applicationSecret, and applicationRoute are correct.You can go to the Overview of your Mobile Cloud Service application on ACE to find your applicationId and Route. The applicationSecret is on the MAS portion of the ACE UI for your application.
Similar issue was reported already:
https://developer.ibm.com/answers/questions/26821/getting-time-out-error-while-conencting-to-mobile-cloud-bluemix-application.html

Android TV SDK : Setting Proxy for the Emulator?

I have installed the Android TV SDK Developer preview for Windows. I am in a corporate intranet environment. I can start the Emulator, but the main screen endlessly loops with the "Preparing Recommendations" animation. I can navigate to the Settings and see that there is no network (no wired and no ethernet).
I suspect this might be a proxy issue. I have tried launching the Emulator with the following command:
C:\Eclipse_w_Android\adt-bundle-windows-x86-20140624\sdk\tools>emulator -avd AVD_for_Android_TV_1080p_by_Google_X86 -http-proxy http://MY_PROXY_IP:8080
(MY_PROXY_IP is replaced with my company's IP address)
It launches the Emulator but doesn't seem to have any effect on the network.
Has anyone else been able to get the Android TV Emulator to fully load in a heavily firewalled / proxied environment?
I thought I was experiencing this issue as well (and had originally commented as such), but I later realized that there was no actually connectivity problem. Two things to note:
"Preparing Recommendations" will appear indefinitely, and I presume this is simply because there are no apps by default feeding recommendations to populate this screen.
Both the Ethernet and Wireless items will show that they are not connected. However, if you run an app that uses the network (a simple WebView is sufficient as long as the app has INTERNET permissions), you'll see that it connects just fine.
I would suggest trying a test app to check connectivity, as there is no other indicator I can find suggesting that it is working properly. I suspect you'll find that all is well.
you probably forgot the first part username password # server port
your company probably has the ip setup with username password

Android emulator loses internet connection after a period of time (inactive or active)

I know that many people asked this before I do, but I can't find any answer so got to repost it here.
So when I start the android emulator, everything is fine. But after a while, like 5 minutes, then it'll lose the internet connection, which means I can't access to the internet via browser, or my app. The only thing I can do is to restart the emulator by close it and start it again.
Any response is appreciated.
This is due to a bug in the emulator code. Basically it doesn't close UDP sockets which in turn causes "socket leak". If you monitor socket connections for the emulator-x86.exe process on your host (Winows), you will notice that the number of connections keep going up as you visit new sites on a browser for example. When the count goes beyond a point (around 100), the emulator fails to open new network connections. I have the same issue and did not find any solution so far.
I've had success using emulators that don't have the Google APIs, so maybe there is something in the pre-loaded Google API junk that is calling home using UDP sockets like #user3361886 described.
Unfortunately they have not provide an image without Google APIs for the latest (API 25). So do as much testing as possible using older versions without Google APIs, and then just test with Google APIs when you specifically need to test Google play services and/or verify your app works properly in API 25 or higher.
Try with Network type > Full and Signal Strength > Great
It worked for me

Restart device after installation

Is there a way using which I can request Android OS to reboot after installing an application...?
I guess the answer is no you can't. Android hasn't given that facility keeping in mind the security and many other purposes. So, you can do some like that when your Application is installed you can request the user to Reboot the Device before using your Application when he tries to execute your Application`.
UPDATE
You can check this thread for having further information about it.
AFAIK , there is no such API in android for auto reboot. you need to display a message in diaglogbox for restart the device.

Categories

Resources