Smartphone web page to send user's GPS coordinates to server - gps

I'm a former professional developer from years ago, (VB.NET and old school ASP) but it's been a few years now I own a driving school so my skills are a bit out of date but still useful for my needs. For my driving school business I've created a scheduling application. It's a winforms application. It populates a database of course, which is used by web pages to display any instructor's daily schedule. Instructors view their schedules on their smartphones. Everything I just described either already works, or soon will.
Within the smartphone web page (which I refer to falsely as an "app" because I want it to be compatible with most smartphones) I would like to add the capability for the instructor to "Check in" to each appointment, and then to "check out" after each appointment by clicking ("touching") somewhere on the page.
The action of "checking in or out" would submit a web page request, which sends to my database a record that includes: Time of day, instructor ID, and GPS coordinates of the smartphone.
THE PURPOSE:
Reports can be generated from this data, revealing whether instructors arrive for lessons on time, and also confirming they did not finish a lesson early, and further confirming that when they "checked in" they were within a certain distance of the student's house. (This prevents them from "faking a check-in" while en-route but still far away.) Thus I can confirm my employees are providing appointments on-time, and giving lessons of appropriate length without need for installing GPS tracking devices in my cars. (Those things are expensive!)
FINALLY MY QUESTION:
I don't know how a web page can obtain the smartphone's current GPS coordinates such that they can be included within a subsequent web request. For example, a hidden field could be populated with longitude/latitude before the web request is submitted. Javascript is an acceptable approach if that works. I prefer a method that works for as many smartphones as reasonably possible. Can web pages on smartphones get this data? How?

Use HTML5 Geolocation that is supported my modern browsers. Use navigator.geolocation property via javascript and then send its coordinates through hidden fields, ajax or whatever you prefer. You can check how it works in your browser console:
navigator.geolocation.getCurrentPosition(function(position) {
alert(position.coords.longitude)
})
See more info here http://www.w3schools.com/html/html5_geolocation.asp

Related

Getting started creating a web form in Microsoft Teams

I dont know where to begin. Do I need to create an app? Do I need to use bots? I have tried finding docs online but don't know where to start. Any help with be appreciated.
I am trying to create a small form in a teams channel that my users will fill out.
User enters #projects
Web server responds with
User clicks submit and data gets posted to my web server.
You're correct that there are a few different kinds of applications in Teams, so finding the one that suits your needs can be a little confusing at first. For what you're trying to do, I would recommend a Bot, and when it received a message (which it will do when it receives your #mention), it can respond with an Adaptive Cards. Adaptive Cards, if you've not used them, are like small embedded forms inside the chat. The user can complete the card and click a button, and it will send the payload back to your bot to do whatever it needs.
Bots, incidentally, are basically just web services, so your bot can do whatever it needs once it received the payload, such as calling another API in turn.
You haven't mentioned what language you might want to work in, but here are some good starting point nevertheless:
https://dev.botframework.com/
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/57.teams-conversation-bot (I've linked the C# version - you should know that Teams bots use the same Microsoft framework as -all- bots build for the Microsoft world, such as web chat bot or a Skype bot. As a result, you have to ensure that anything you look at is applicable to Teams as some content/samples are not)
https://adaptivecards.io/ (as with Bots, Adaptive Cards have a life outside of Teams, so some articles/content/etc. might not be applicable to your scenario)

Waze, notification when someone pin traffic accident

my client has a small fleet of vehicles and he asked me to figure out how to get waze accident data sent to his phone. He said someone who is a competitor has alerts set up when there is an accident reported to waze within a certain mile radius, they get a notification that shows them a list of all the accidents and addresses.
Can someone please point me in the right direction on how this can be done? Thanks
The only legal way of retrieving the alerts information from Waze would be through the Waze for Cities program. The Waze for Cities program is completely free and allows organisations to obtain certain types of information from Waze (alerts, traffic jams, unusual traffic notifications, ...). In return, these organisations are expected to give certain types of information back to Waze (road closures, alerts, ...). But as the name implies, this program is meant for public instances, not private companies. The past couple of years, Waze has no longer allowed any private companies to access this information as those companies generally give little in return for the data.
An illegal way of retrieving these alerts for you would be to scrape the data from the Waze livemap. I'm sure you'll understand why I'm not going to give any further details on how to do that though.
It's a long shot, but Waze also has a bunch of Twitter accounts that send unusual traffic alerts in their area. There aren't that many accounts though, so this is quite unlikely to work for you.
I know it won't help with creating alerts, but just for being as complete as possible in my answer I'd like to mention the ability to embed the Waze livemap on a web page. it is possible to generate the code for this via the livemap, but manually changing the parameters isn't that hard:
<iframe src="https://embed.waze.com/iframe?zoom=15&lat=51.493194&lon=-0.013390&ct=livemap" width="600" height="450" allowfullscreen></iframe>

Logic for parking payment

I want to create an app for faster payment of parking.
This question is more about logic of my app, and what tools I need to use about creating it.
At this point, I use a parking place every day and I pay for it through the web page.
I do it like this.
Login to page.
click on the menu and it redirects me to www.parkingexample.page/payments
there is a search menu and I enter my car plate number if my car is found it returns me how much I need to pay, and "Pay" Button appears.
I click "Pay" buttons and then it's all done.
So my goal is to create an app that when I start it will automatically connect to the page and will search for my plate and if found and payment is needed there would be just one button "Pay"
So I think I should do it like this, but as I haven't created any web app(I'm 100% back-end developer) I ask you is my thought process is correct.
And also I don't want to use WebView as I think it's not necessary for me.
When I start my app it sends "POST" request to page to login.
Then I send 'GET' request to www.parkingexample.page/payments with params = 'mycarspaltenumber'
Somehow I need to click on PAY button on page when it appears so I think it's probably again 'POST' request, but at this point, I'm not sure.
So a QUESTION is, is my logic valid? or it can be done in some other way?
UPDATE. ADDED SCREENSHOTS
First Screen shoot this is the menu after I logged in with the search bar where I need to enter my card plate.
Second screen is where I found my car(Entered plate number and clicked search)
and now the page is updated with sum I have to pay and there is a button "PAID" in the bottom right corner I need to click.
And that's all i need.
To validate whether your suggested sequence is correct I would start by capturing your typical browser session between yourself and your parking provider with something like Fiddler. Then I would use HTTP client library of choice (for C# it would be something like HttpClient) and emulate the same flow with correct headers, query parameters and such like.
Looknig at your screenshots it seems the application is ASP.NET Web Forms, which can get a bit painful to emulate due to way its state management works: you will likely need to decode View state object (to ensure you're passing it back correctly) and locate all dynamic field ids that it uses for postbacks. This however is very doable.
If you discover that the above is too hard to emulate (or there's javascript involved) it might be easier to explore Remote Selenium WebDriver coupled with a headless browser like PhantomJS. You'd then have your PhantomJS interact with the page on your server, and you'll drive it with your mobile app. Basically you'll reduce the complexity of your parking provider page to a well documented API.
Hopefully that gives you a starting point
In your application, all that you will need is services call and the security part of logging a new user everytime to check for payment.
So It will be a simple spring-boot application, where you can use the security part for logging, and you can exactly use the simple way , for example you don't need to have a database, just to redirect your page, and if you are not familiar to front-end framework, you can use a basic html-css pages for client side.
Another important point, you should start by designing your application, before coding, because it's very important to know all the ideas behind your application.
Enjoy your doing time!

personal nest api access

I've had a Nest thermostat for a little over a year and it works well. I also have many other Home Automation devices. I'm a Software Engineer and I enjoy making my life easier by programming my own, personalized, solutions to Home Automation issues. For example, I have my own weather station which reports information to Weather Underground using my own custom software. I also have my own, home grown, web interface which integrates both the X10 devices in my house and also the Wink devices, on one page.
I would like to gather temperature readings from my Nest thermostat and integrate that information into my home temperature information, in order to get a better idea of what is happening in my house. I signed up to be a Nest Developer and jumped through all of the hoops to get an access token in order to use the REST API. They turned me down!
So, it sounds as if Nest is not allowing their customers to access the information from your own thermostat in your own house! I find this closed system unacceptable! If Nest will not allow me access, then I guess my only alternative is to replace my thermostat with some other model which is more open and accessible?
Have others run into this closed system? Is there a way to deal with it, or is Nest simply saying, "we want your personal temperature information history, but we're not allowing you to have it, yourself."
Apparently, you don't need to get approval. Just proceed with describing the program, etc., and get the pincode. It works fine for a small number of users (50, I think) without approvals.

Google Plus Share Button is not sharing on Business Page

Suppose I have an online shopping system and many users are registered to it. I want a feature that when I add a new product or there's a promotion for a particular product, my Google plus page gets updated in the sense that the details of the product are published there automatically. It will only be used for back-office purpose.
The problem is that I cannot share on the Business Page, it gets posted on my user profile.
How can I achieve posting on google plus page via a web application?
Currently, you would need to use a third party social media management tool to achieve this in an automated manner. I've tried Hootsuite and it appears to work with a standard account.
If the number of products that you add is not high in volume, you could manually share by using the https://plus.google.com site and switching to use your page as the poster.
Set the page free as a standalone account
Apparently Pages may now (since when I don't know) have their umbilical cords severed, and set free to stand on their own two feet.
The process involves setting a password for the Page (via the Page's settings) that allows it to be signed into and out of rather than simply managed.
This should allow Shares to be made (and other G+ actions such as +1ing) from around the web as the Page instead of as the profile that created it.
See an article on plusyourbusiness.com from Oct 2014 for some details, and an article on blogger-hints-and-tips.blogspot.de from Mar 2014 (cited by the former) for some more.
P.S. The "apparently" and "should" are due to my not having walked through the process myself yet.
P.P.S. (done it now) Easy and works.