Simulate Mock Location on Android Device via DDMS - android

I have a GPS navigation application for Android 2.3.3 which I have been working on. I am currently trying to simulate locations via a GPX file through DDMS. While this works perfectly find on the android emulator, I am unable to get it working on an actual device.
I am able to see the device on the under the "Devices" tab, but I am unable to send any mock location data, or GPX data as the options are under "Emulation Control" tab are grayed out.
I have noticed that previous questions on StackOverflow mention that it is not possible, however the Google docs titled "Using DDMS" - http://developer.android.com/tools/debugging/ddms.html state the following (at the bottom of the page)
Setting the location of the phone
If your application depends on the location of the phone, you can have
DDMS send your device or AVD a mock location. This is useful if you
want to test different aspects of your application's location specific
features without physically moving. The following geolocation data
types are available to you:
I am just wondering how to send fake location data to a device via DDMS.
Thank you for your help in advance, and I really appreciate it.

Bilzac, your understanding is correct. Simply put, Android's documentation is misleading. Many developers have been confused by this. You cannot load a gpx file and send to device like you do on the emulator contrary to what the documentation suggests.

Possible if you activate mock locations on your device.
Than add ACCESS_MOCK_LOCATION permission to your manifest.
You can write now your own MockLocationManager which generates mocj locations.
Easiest way is to you use an app which generates mock lactions for you. GPS Route Simulator works quite fine. Possible to store kml files on the sdCard or defines own routes

Related

How to Edit GPS Location in a Rooted Android 7.1 Phone

I searched many solutions from web, like: using Magisk, using Xposed, FakeGPS, etc.
What I have tried is:
For FakeGPS, I install it as system app, enable developer mode and choose it as the GPU location provider. Result: no working, other apps still go through WIFI/GPS provider.
For Magisk, it requires installation through TWRP, but I am not allowed to rewrite recovery partition of my android phone. All I have is su command to get root access for system partition.
Any other solution that helps? I don't care how basic functionality the solution can support, as long as it really works for my case. I even accept the solution to dis-asm the critical library, change the value of Longitude/Latitude to hardcode values, re-compile and overwrite the corresponding library.
Mock GPS is an app you can you use with or without root.

Android app, Is there a way to get another device to access that url without having to type it manually by the user?

best regards from Venezuela, I am new to stackoverflow, and this is my first question on this site.
This question will be long because I am providing a lot of detail, so this question is as clear as possible.
Brief introduction.
I have created an app that runs on Android devices, this app allows you to share files between devices that are connected to the same WI-FI network. but with a different methodology to that used by apps that are intended to fulfill this same purpose.
On the device where my app is running (which we will named device one), a url similar to http://192.168.1.102:7898 is generated, and said url must be entered in a web browser installed on the device with which you want to share the files (which we will named device two).
The main purpose is to offer a way to share files between devices, using WI-FI. without the need for device two, my app has to be installed.
You can find more information in https://labs.xda-developers.com/store/app/com.tecnoelias.ipfiles
...
So far everything works fine. But, it is annoying that every time someone wants to share files using my app, on device two, they have to enter the url described above. keeping in mind that said url will change as the WI-FI router decides, and therefore, you should not use shortcuts to the url (bookmarks or navigation history).
Having said all this, the following question arises.
Is there a way to get device two to access that url without having to type it manually by the user?
To accomplish this, three ideas occurred to me.
1: Generate a QR code in the app. but this requires that on device two, an additional app is installed that can read QR codes. which violates my purpose.
2: Implement in the app, a mechanism that allows you to find other devices that my app is working on, and in this way, interact with those devices (through my app, similar to how other file transfer apps do). This is a good idea, but it nevertheless requires that my app be installed on both devices.
3: My third idea and the one I would like to implement is the following:
On device one, it will open my app and then activate it.
When the app is activated, the app will search for other devices that are connected to the same WI-FI network, until it finds device two.
If successful, a SOMEWHAT will be sent programmatically to the device two, that SOMEWHAT can be, a message, a bit, a data packet, or anything else that helps to realize this idea .
After device two receives that SOMEWHAT, it will show a notification or a pop-up window, which will allow access to the url generated in my app (on device one).
Consider two things. 1: NO additional app MUST be installed on device two. and 2: Because device two can be running any operating system, the SOMEWHAT will be a different mechanism for each operating system, (operating systems can be, Android, IOS, BlackBerry, Symbian, Windows Phone, Windows, Linux, Mac, among others).
If for example, device two, runs Android 10 (not rooted), and has the most common applications installed, which can be: WhatsApp, Facebook Messeinger, Google Play Services, other Google apps, and system applications.
My thought is that you should be able to use one of those apps, to receive the url, and after clicking on that url, the web browser will open, and then it will load the corresponding webpage (which in this case, is to access the files shared by device one, through my app).
Any ideas?
You can give me your opinion, some code, or you can just tell me that this can't be accomplished.
Any response or suggestion are appreciated.

Android - Create Launching Application

I need some guide and help from you guys, What i want is as follows:
Replace the device home screen with a customizable screen that limits users to selected applications only. This should allow the administrator to select the applications from available list of applications.
Specify a URL for device redirection (in case of browsing)
Create a whitelist of acceptable URLs (no other URLs will be accepted)
Enable/Disable native Samsung Android device following features.
Android Market (App Store)
Camera
WiFi
Bluetooth
Microphone
Access Point
Now can anybody guide me what to do and where to start in android?
Your help will be really appreciable.
Thanks
As mentioned by Evan, this is really the domain of Mobile Device Management (MDM) and involves a pretty heavy-handed control from the app.
There are a number of solutions already available such as Air-Watch or Good who specialize in exactly this sort of thing.
I think building your own from scratch would certainly not be trivial, though there is a lot of discussion which could help in getting you started (check here for instance).
Good luck!
To archive that, I think you must build your own Android ROM. If you only want to install your HOME app to a device, user can easily get back old home screen.

gps tracking on android

I want to make and android gps tracking application that will track other gps devices.
I will write you some of my things that I want but you can tell me if this is possible.
I want to make application in QT ( does QT have libraries for
connecting other gps devices
I want to use google maps ( if that is possible ) - so I can track
Is there any gps locator sdk? So I can buy device and connect it.
Can gps device send me some more information like fuel usage? For example I can make device that will read fuel usage and send me some sort of information to my server.
I need server for that? So I can only pay for some hosting? and maybe make php scripts that will handle me data?
That's probbably it, please respond so I can really see what is possible from all that.
Thank you.
1) While there a way to run Qt apps on Android (http://developer.qt.nokia.com/wiki/Necessitas), I expect it to be a world of pain, as is usually the case with ported frameworks. Plus, very few people are doing what you want to do, so the developer community is probably non-existent (so it would be hard to get help when you get stuck). I would go with "native" for Android Java code and libraries.
The rest of your questions assume you using Qt. If you go native, of course, you can use the Maps SDK, the Android location stuff, etc.
1) I don't know what QT is. I'm assuming it's an app builder of some sort. Don't like 'em. Can't do any cool stuff with them. (That's a personal opinion. Ignore it if you want.)
2) There's no problem using maps in an Android app. See the add on library.
3) Most phones have GPS built in. Why buy an external one?
4) The GPS built in just provides your current location. Stand alone GPS units that can provide fuel information are querying an external database. I don't think they will share. Interfacing to their device for commercial use is very illegal. You could do it only if you are the only one ever going to use it.
5) The Google add ons library has a USB api. If you can design a device, you can talk to it. See 4 about fuel information.
You are going to have to learn how to program an app using Google Maps with GPS, learn the USB api, and find a device that you can electronically understand and can communicate via USB. Then you need to find a site that will allow you to interface with their fuel price database. (There's no way you can personally gather fuel prices nationally in a timely manner.)
You need to refine your specs after you program a basic Maps app that uses GPS. Then at least look at the USP api. Also, if you are looking into building your own electronics device, Google 'Arduino'. (Research USB interfaces with it. Out of the box, it uses an RS232 serial interface.)

Better method of viewing "adb bugreport" output? `

Is there a better method of getting detailed information about an android phone than running "adb bugreport"? Running it produces a wall of text that could take an hour to sift through. Are there any desktop UI applications or Eclipse views that can can allow you to browse all this info?
Check out ChkBugReport, an open source tool written by Sony Developers.
Github link to source code is here
I personally use BugSense with my Android applications. It allows you to send detailed information about application crashes to your BugSense Dashboard. The reports contain OS information, device information, information about whether the user was connected to WiFi, Data, if GPS is turned on, a stack trace of the exception, and really nice graphs that show you various issues. The issue some might have about this is that it sends the crash information without any user input, so it might be something to prompt the user about before sending.
As far as using things in Eclipse the DDMS tool may help. It's built into the debug view in Eclipse if you have the ADT Plugin. If you'd rather not use it with Eclipse, it also comes installed by default in the Tools folder of your SDK path.
I'm not entirely sure the BugSense thing is what you're looking for, but I find it very useful. Other than that, DDMS is really the best tool that I know about. Hopefully you find this helpful.

Categories

Resources