I am developing a GPS enabled application on Android. There is no problem with the map display, but I want to test how my code would react to the situation in which the user enters a room, basement or a cave, so that the device would stop receiving any signal. My question is whether I can simulate this programatically or by using the DDMS, and if so, then how?
P.S. The point is to test it all on the emulator, not a real device.
Thank you.
Fixes only come into the emulator when you push them over (e.g., via the Emulator Control tab). If you don't want the emulator to receive fixes, don't send them.
Related
I got a small project. Company will provide android phones to their employees and company do not want them to access camera and shut down their phone and also they should not be able to disable GPS or Mobile data.
I'm new to android development. Would you please tell me if this is possible. Few reference on how to do that (If possible) :).
Thank you so much for your help.
Nothing will stop them from shutting down their phones. If nothing else they can always remove the battery.
Some of the other stuff can be done via Device Owner permissions and android's device policy manager, which is made for enterprise control of devices.
I am writing an android app that will interface with a Sony SmartEyeGass. I want to detect the presence and connection of the device, prior to the user starting functions that use the glasses.
Unfortunately, I am having trouble reliably detecting if the device is present or not. Watching for the START, STOP, etc events is not solving my problems because I often get START events received by the ExtensionReciever when I start the application and the ExtensionService, despite having the glasses powered off. Running the ControlExtension that shows stuff on the glasses has no problems drawing onto nothing.
How can I get information from the SmartEyeglassAPI indicating whether the device is present or not? I have not been able to find this digging through their online documentation nor in the samples.
There is no API as part of SmartExtensions to check whether the glasses are connected or not. You should be able to detect whether the glasses are connected by listening for connecting Bluetooth devices and checking the device name.
This API may work for you:
http://developer.android.com/reference/android/bluetooth/BluetoothHeadset.html#getConnectedDevices()
I have the following problem:
My phones USB port is broken and I have no way of running app on the phone other than sending it over bluetooth and install it every time I make changes to the code. So every time I make changes, I gotta spend min+ to see them in action. I don't want to use emulator.
Is there a way I can make eclipse run my app on the phone over the internet when I build/run the app the same way it does over USB? Thanks!
I'm doing project on android chat application with both friends and anonymous. we finished with the design phase. now we need to create a network between two emulators present in two system so that we can do chat in two different systems. But in emulator wifi is not getting turned on. I tried with the F8 button still the wifi is not getting on. I'll be grateful for any help in regard of this.if wifi cant be turned on how to simulate the chat application in emulators.we have written server and client side program in java, but don know how to connect server and client Thanks in advance
Use real device, because emulators don't support Wifi functionality afaik.
First,thank you for your attention to my question
I'm planning to design an Android GPS locating application
here are my difficulties and situations
(1)my computer hardware has been out of date for a long time and running an android emulator for debugging is really time-costing,thus i bought a real device(android cellphone) one week ago,in the aim of replacing emulator during debugging
(2)i know how to send location datas to an emulator via "DDMS/Emulator Control/Location Controls",but it is disabled for a real device
(3)i am programming indoor,thus using physical gps locating function is not acceptable(even if i turn on "a-gps")
(4)i have found another topic here: Android mock location on device?
however,i can't open the detail links,like "Andrews link"," http://dehuysser.appspot.com/blog/android-developer-shell-released"
I guess these web sites are forbidden by my country......
Here are my questions:
(A)i have found some codes of making mock loation datas ,but these codes can not activate "onLocationChanged" function
However, i wonder if there is a way to send locating datas from PC to real device via USB port(i'm in USB debugging mode), just like sending locations from DDMS to emulator?
(B)i've got the information that, it is possible to send "geo fix" command to emulator as well as to a real device, by "telnet localhost ", but how to check out the port number occupied by my real device?
i know that 5554 port is used for a emulator,but what about the real device?
i've tried to command "netstat" in terminal, but it's a shame to say that i don't know which port is for my android phone......
(C)If my (A)(B) question is not practical,then what's "settings/applications/development/allow mock location" used for?
Please help me, and thank you for your answer!
I have wrote an app exactly for this (this functionality is not available on phones by default) - it's open source and provides exactly the same interface as the emulator (telnet to :5554 and run "geo fix ..." or "geo nmea"): in app store MockGeoFix
The easiest way of using mock data is using the mock test location provider API. It's at the bottom of the documentation page. I've tried it out and location is received in the onLocationChanged callback. Here is some code that you can try out.
The port used by adb is usually 5037.