how to track vehicle from php side - php

I'm working on a php and android base project. From php side we will be giving a route to follow to android side with google map link(to make it easy)
when the android user start driving the car we have to track whether he is following the route that we gave how to do it from php side this route is given by providing a link to google map marked with the route.
Now to track vehicle i'm confused how to start any help will be good

It's easy...
The android app have to send the GPS coordinates (with precision) with a http-request to the php-script periodically.
After that the PHP script checks the GPS coordinates + the precision and see if it's still on the marked road (this might be tricky)
Try to split up the tasks in as small pieces as possible (and use classes/functions!)
Good Luck!

Do you know about google direction api. It have an direction service which can help you show directions on map.And for tracking location status in php application your android app need to be send device co-ordinates to your php server/application contentiously.
For getting co-ordinates you can use device GPS and android Location Manager Class and Location Service,You can also try googles geo-location api.
But remember it is must that your android app send his co-ordinates to php application according that you can show pointer for device location.

Related

Possible to track location via android mobile gps using Google API?

I have developed fleet management using PHP. Here i plan to track vehicle in real-time and store the locations in my database.
My question is: Possible to track location via android mobile gps using Google API?
If it is possible please give me a way to create this.
Thanks in advance...!
PHP, which is a server-side language, can't query the device's location, instead the client application should get GPS location coordinates via Android's API and send it to the PHP server (for example via a POST request), then the server can handle the data and store it into the database.

Real Time Database on Android with Google Maps

we have a android project that needs the following objectives:
*we also have a web application for this app that needs to communicate with the same database as the android application
what I have done so far:
a view of a map with a pinpoint on my current Location
mysql db containing information (including latitude and longtitude position)
registration and login
Real Time Database Objectives:
state that people are online or offline(updating a database).
Google Map Objectives:
When I press a button, the map will show other users who are online within a given radius so basically I need to view online people who are near me
Send a message to them [2 ways]
2.1 I send them a message by clicking their icon
2.2 I send everyone[online people within the radius] the message
Questions:
I am currently using php mysql for login/register. Can I use this for a real time database or is there any other way?
is Firebase somehow similar to a hosting site?
if there are other needed information needed, pls inform me, I may not have included information that could help with my questions :)
ill update my question too if I have more questions.
thank you.
I think for your requirements its is more appropriate to use Firebase as it fulfills all your expectations and provides additional features.

Develop a website that tracks phones using GPS

We are currently halfway developing our thesis and there's a certain module we are having a hard time with. It's about a module that locates the position of a mobile phone using GPS.
We are developing a port management website and we need that module to keep track of people getting in and out of a particular area. we just need to integrate the mobile phone's GPS and have it tracked on the website.
We are new to this technology so we apologize if the question is quite vague. we appreciate your answers! thank you!
We are developing this kind of applications for long and what I feel from your question is that you are trying to simply track the mobile phone! If it's an iOS, you can make an app and install it to send the GPS data to an web service (preferably RESTful) and again fetch the data on the web site from that same service to track the phone in real time. Most of the companies use this approach to track anything (Car, Person etc.) that carries a cell phone.
Explaining your end goal or sharing a bit more of your target may yield better replies.
You actually don't need to create an app.....
You could create a webpage and get the location of a device by using HTML5 Geolocation and send the location to server/webservice. However, this means that you need open the page with a browser to get it working.
As for keeping track of people getting in and out of a particular area, you could get the GPS co-ordinates of the two corners of the area, and well, after that, do the math to calculate if its within the bounds or outside.
create one android/IOS app that constantly updates it's co-ordinates (lang-lat) to database present on the webserver .
you will need following things
1)mobile app Android/IOS , it will send mobiles location using GPS to webservice
2)webservice that receives position from mobile apps and updates position of mobile in database.
3)website that will fetch data from that database and perform operation eg.suppose if user in certain area
if (location==chicago city) ##check the lang-lats for location from database
{ do this }

How can we use Google Play Service for back-end server validation?

I was following these articles: Verifying Back-End Calls from Android Apps and Stopping Vampires using License Verification Library (from 24:57 to 25:34) to implement an In-App Purchase verification system for our Android apps.
I am a bit confused about how this works end-to-end and what we can assume about the generated token from calling GoogleAuthUtil.getToken() with the first email address found--when AccountManager returns more than one account. My questions are as follows:
Should we assume that any e-mail address used by the user to buy our
app will generate the same token (i.e., same user + app ==> same
token)?
If the answer to question 1 is no, is there a way to launch in-app
purchase for a particular account/email?
It looks like Google is picking the first e-mail address returned by
AccountManager for its in-app purchase dialog. Can we assume that
this won't be changed by the user after in-app purchase dialog is
launched? How do we find out if this changed after the in-app
purchase returns?
What should we store in our database to identify this user? Is email
address and/or token allowed? When does the token expire?
The java-client library looks very promising and powerful at first
read. But, a number of things remains confusing. Is there an article
that describes the end-to-end scenario--from an app initiating a
call to a back-end server through launching the in-app purchase
dialog, getting the result and closing with commits on the server?
What articles are the most useful for accomplishing this on Android?
The main issue we are trying to solve is to to get the full picture.
We've gotten the idea that we can avoid requiring userid/password by using the java client features and using tokens. We have registers our project (both the web app and android app on the same project) per the instructions for Google API Console. We have the php java-client for Google Play Service on our back-end server. We got our Android app to generate a token using the first email address and then call the in-app purchase dialog and handle the user response at the end of the dialog. We've got the parts. Now, we need to glue everything together. We are at the point of integrating with the back-end server. E.g., What is Redirect URi supposed to point to in our server? We've got a php url that we do http post messages to for our server app. We've included the code example for Google API client example--with client-id, secret, simple api key, etc. filled in--as an include to our php. But, what should we put in the redirect uri (we are missing a usage instruction for the example code)?
Also, we want to avoid having the e-mail used for the in-app purchase be different from what we log on our server database as the address the user used to buy our app; if the address is the correct thing to track, we want it to be the same as what was used for the purchase. This could be frustrating for our user if we make this mistake and prevent them from the features they paid for. We don't want to make this mistake and need some clarification on how Google Play Service works. If we initiated the server part of the workflow to get app Nonce / Payload / Credentials for the first e-mail address on the Android device, we would want that address to be used throughout the workflow. If the user changed this along the line, we want to be aware of this and gracefully recover. So far the articles have been helpful but incomplete. Any insight/suggestion is appreciated.

Is it Possible to get itunes like xml/json data from android market for each App

Itunes provide URL or all apps in App-store like to get details in JSON/XML Format
http://itunes.apple.com/lookup?id=[appid]
There is no any API for android market i have got online. i tried to get details from these html pages using java script by fetching android market query
https://market.android.com/details?id=com.[companyname].[app name]
but it is not getting fetch all the relevant data as iTunes. Is there any way i can fetch all data from android market app page html code or any API available for this?
May be it's help to you http://code.google.com/p/android-market-api/
By the way, last rumors, Google has renamed Android Market to Google Play.
To expand on devzorg's answer, - yes http://code.google.com/p/android-market-api/ will give you the application data you seek. And no - the format isn't (quite) valid JSON, although it is close afaik. The example snippet below (from an AppsResponse using the Android Market Library) won't pass JSON validation on jsonlint.com until you add quotes to all the variables and a set of external parens.
app {
id: "v2:com.geodesic.munduTV:1:30818"
title: "Mundu TV- Mobile TV, Live TV"
appType: APPLICATION
creator: "Geodesic"
version: "3.4.4"
rating: "3.6129606"
ratingsCount: 2253
..
}
Unfortunately Google Play (previously known as Android Market) does not expose an API like the Apple App Store, officially named iTunes Search API.
To get the data you need, you could develop your own HTML crawler, parse the page and extract the app meta-data you need. This topic has been covered in other questions, for instance here.
If you don't want to implement all that by yourself, you could use a third-party service to access Android apps meta-data through a JSON-based API.
For instance, 42matters.com (the company I work for) offers an API for both Android and iOS, here more details:
https://42matters.com/app-market-data
The endpoints range from "lookup" (to get one app's meta-data, probably what you need) to "search", but we also expose "rank history" and other stats from the leading app stores. We have extensive documentation for all supported features, you find them in the left panel: https://42matters.com/docs/overview
I hope this helps, otherwise feel free to get in touch with me. I know this industry quite well and can point you in the right direction.
Regards,
Andrea

Categories