Real time traffic data - java

I don't know if this is the place to ask the question but I 'll give it a go anyway. I'm looking for a web based service that can replace TMC over FM. I'm currently working on distance matrix between multiple points (>1000) and would like to take in account the real time traffic data. I know that google maps and tom tom have the data but I'm looking for other serviceses as well (open source would be lovelly). I hope you guy's can help me out.

Related

Salesforce: Which API to use without Login required?

I'm currently working on a native Android app for my company and ran into some problems with Salesforce lately.
I hope I can find some help here.
What I want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)
The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.
The problem I'm facing is that I can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?
It would be so awesome if anybody could help me with this problem.
What I tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication() i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method peekUnauthenticatedRestClient(), but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practical for my Use-case.
I feel like I read nearly all docs about salesforce API, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  
would a salesforce-apex method which would select all records inside a set radius around the user's location to be accessible without authentication?
Thanks for your help in advance!
Roman
Try asking on salesforce.stackexchange.com. Your question is more about licensing model than a particular programming problem. It might even be the case that you don't really need Salesforce for your project, you'd be better off on Heroku (even free tier) if the login piece is an issue...
All Salesforce APIs require some form of authentication. If you're positive you don't want to hardcode "Integration user" credentials in the app and you don't want to pay for (self-)registered user licenses in your org...
Try to read about these:
Site - piece of Visualforce running under specific "guest user", letting you view & interact with SF data without having to log in. You expose SF data to the world but that means it's your job to handle security (if any) and craft the API. You want to really display the data to human? Or just return JSON content or what...
Sites are meant to be displayin some incentive to contact you. Your product catalog / basic order form. Some map of nearby locations. Maybe a "contact us" form. There's limit on the traffic so eventually they'll explode as your app gets popular:
Customer Community - typically you need named licenses (even if they're fairly cheap) to let your customers log in to your SF. You create a Contact, click magic button - boom, this Contact now has a real matching User record with its own license. Think of it as some kind of step up from Sites - it'll still have some limits but will offer more than just raw API access and you'll have better control on what's going on.

Tips for new Android app - maps, directions, transit

I'm not asking for anyone to build me an app.
I just need some tips on getting started.
So what I wanted to do:
be able to map some routes/directions, similar to what Google Maps already has regarding the local transit in a city.
Why? Because Google's database is a bit outdated, first. Second, because I want to create a local database with the routes and with the stations. Unfortunately, I can't really do that using Google Maps and I think Leaflet could help me with this much better. This would've been a web app, where someone with an account could add/edit/delete the routes.
create an Android app that :
a) sees the routes, allows an user to find the closest path to get from point A to B using only the routes I have in my database, sort by tram/bus etc
b) allows the user to mark a location and say something like "bus no 37 was here at hour:minute:second" - this would appear for anyone else that is using the app, similar to what another app lets you do this for police cars and traffic jams
c) extra: allow users to input some data so that my app could also give predictions; for example, someone inputs it took 10m50s to get from point X to point Y on route Z. That remains in a database and then someone else inputs some data for the same path...i would create some algorithm that could get predictions on where would a bus be now if someone marked it at Station 'bla' 5 minutes ago. I know, I know, this might be pretty hard, and it would be pretty inaccurate, I should consider the time of day, but it would just be something small, as an extra. Also, would be cool if this stuff could be added automatically: like the user sets the route he's on, starts "recording", then stops it when he gets off the vehicle and the time and locations are automatically taken into consideration.
Hope you understand what I have in my mind.
Thing is, what would you recommend?
I know Java, Spring MVC and a bit of Android. JavaScript, HTML and CSS won't be a problem. I need to combine these. If I will use Leaflet, as far as I can find, I won't really be able to use it in an Android APP, I would have to create a web app. At the same time, Google Maps doesn't really let me do what I want for my "personal" database. I can't even create decent custom routes by adding waypoints because parts of the Tramway Line aren't on streets with car access. ALso, would you think this is easier/better to do as an Android app or as a web app? I'm kinda new to Android.
I hope this isn't an unsuitable thing to ask on stackoverflow.
I'm open to any ideas.
allows an user to find the closest path to get from point A to B using only the routes I have in my database, sort by tram/bus etc
Routing is hard. Multi-modal routing (tram+bus+car+walking+cycle) even more so. See pgRouting and Valhalla. If you're going to do anything with public transport, then you'll have to deal with GTFS too.
Research into OpenTripPlanner also, as there are several actors developing some similar platforms.
I hope this isn't an unsuitable thing to ask on stackoverflow.
I'm afraid it kinda is - see https://stackoverflow.com/help/on-topic, point 4.

Working with data in java

I've been using a formula for some time to try to find value in spreads for sports betting and done this by basically creating my own spread and comparing to what bookies offer and would like to automate the process.
I've written some code in java which will do the maths on the data I give it and I'm looking for a way to populate the input data either from a database or from an xml file I create but i'm quite new to programming.
Say for example if I pick two teams to compare. For each team I need a list of the teams they played, how many points each team scored in total, how many points each team conceded in total and how many games each team played so I can run the maths on those figures and I have no idea where to start. Could anyone help me or point me in the right direction?
It sounds like you've defined your problem (how to start), and also listed the information you need to get started (compare two teams, points, previous games, conceded points, etc). Are you sure you don't know how to start?
For a point in the right direction - I recommend creating a test case where you select two teams, give them some sample data for their previous games, points scored and conceded, and start working on the structure of your program.
This question lends itself too much to personal opinion and personal experience, and that makes it difficult to give you definitive answers without looking at any code or a program layout.
Give it your best effort and reply back with what you come up with, that will be much easier to critique and offer suggestions to.

Network Topology using Graphs

First of all hello everyone, this is my first post here. I am asking for your help, I'm designing a network topology for access points, but to make it more creative I want to do some coding on java. I want to code it using Graph data structure but what i may have a problem is like the following, i want to point some access points on the most frequent places. But whats the best algorithm to find the best places to put the AP's. Also is there any possible choice I could do double graph, one pair of graphs for people, and the other pair for AP's ? I would really appreciate your help cos I'm pretty lost here.

Coding a simulation model

I have to do this simulation model but I don't know how to start it and where to start it. i asked my supervisor about this , he also not have a clue about this. so I'm asking your opinion.
Here is what I have to do.
I have to simulate GSM signal strength from area to area in a simple map model.
I have to show the user location and when changing the user location from one place to another which tower gives the mobile client the GSM signals it require
I'm not asking to code this or something guys, I'm just asking to show me the way to do this?
Any tutorials regarding this, your knowledge to sort out the things would be very helpful.
I have a knowledge in Java also.
Regards,
Rangana
If it's just a simulation, it can be faked quite easily (unless I'm misunderstanding what's required).
Create your map model in whichever format you need to. This might be using Google/Bing maps API, or a custom map.
Create a list of GPS coordinates and traverse through them to simulate the user moving around the map.
Calculate the distance between the user and each tower (could use the Euclidean distance) and determine the strength of the the GSM at an given point. I'm not going to explain how you could calculate such a value, but it should be pretty easy.
Without more specific information, it's pretty difficult to give any more detail. Is this part of a university project?

Categories