Yes.... please provide me complete details about the web services Android? And I am also expert in nyc app design.. how can I help you?
A
Andreas Fötschl
said
over 7 years ago
Can you please describe the issue in more detail? The dummy-POI service used in the SDK sample application returns random POIs close to a given position, e.g. https://example.wikitude.com/GetSamplePois/?lat=33.06068&lon=-97.50336&nrPois=1 when you implement your own service you can do something similar. The "ERR_CONNECTION_REFUSED" error is not reproducible on the dummy POI service, so I guess your own server-service encountered an issue.
Best regards
k
kinjo beti
said
over 7 years ago
i'm having ERR_CONNECTION_REFUSED
A
Antonio Mendoza
said
over 8 years ago
It was the localhost... :v
thank you very much for the help, it worked.
A
Andreas Fötschl
said
over 8 years ago
Hi Antonio!
I guess this was unintentional, but using "localhost" as a server-IP will not work, except you deployed your POI server on your Android device ;-)
Please use LAN IP instead and give it another try. Also note that this forum is targeting AR-specific questions, pls. use e.g. stackoverflow for jQuery or JSON server related questions.
Best regards, Andreas
A
Antonio Mendoza
said
over 8 years ago
Hi, I could implement the Web service tutorial instance, but when I try to use my own web service I get the error:
"invalid web-service response"
In debug mode, the message is this
"Failed to load resource: net::ERR_CONNECTION_REFUSED"
The code:
// information about server communication. This sample webservice is provided by Wikitude and returns random dummy places near given location var ServerInformation = { POIDATA_SERVER: "http://localhost:8094/app-prueba/index.php/ws/Usuario/", POIDATA_SERVER_ARG_LAT: "lat", POIDATA_SERVER_ARG_LON: "lon", POIDATA_SERVER_ARG_NR_POIS: "nrPois" };
// implementation of AR-Experience (aka "World") var World = { // you may request new data from server periodically, however: in this sample data is only requested once isRequestingData: false,
// true once data was fetched initiallyLoadedData: false,
// different POI-Marker assets markerDrawable_idle: null, markerDrawable_selected: null, markerDrawable_directionIndicator: null,
// list of AR.GeoObjects that are currently shown in the scene / World markerList: ,
// The last selected marker currentMarker: null,
// called to inject new POI data loadPoisFromJsonData: function loadPoisFromJsonDataFn(poiData) {
// empty list of visible markers World.markerList = ;
// start loading marker assets World.markerDrawable_idle = new AR.ImageResource("assets/marker_idle.png"); World.markerDrawable_selected = new AR.ImageResource("assets/marker_selected.png"); World.markerDrawable_directionIndicator = new AR.ImageResource("assets/indi.png");
// loop through POI-information and create an AR.GeoObject (=Marker) per POI for (var currentPlaceNr = 0; currentPlaceNr < poiData.length; currentPlaceNr++) { var singlePoi = { "id": poiData.id, "latitude": parseFloat(poiData.latitude), "longitude": parseFloat(poiData.longitude), "altitude": parseFloat(poiData.altitude), "title": poiData.name, "description": poiData.description };
// location updates, fired every time you call architectView.setLocation() in native environment // Note: You may set 'AR.context.onLocationChanged = null' to no longer receive location updates in World.locationChanged. locationChanged: function locationChangedFn(lat, lon, alt, acc) {
// request data if not already present if (!World.initiallyLoadedData) { World.requestDataFromServer(lat, lon); World.initiallyLoadedData = true; } },
// fired when user pressed maker in cam onMarkerSelected: function onMarkerSelectedFn(marker) {
// deselect previous marker if (World.currentMarker) { if (World.currentMarker.poiData.id == marker.poiData.id) { return; } World.currentMarker.setDeselected(World.currentMarker); }
// highlight current one marker.setSelected(marker); World.currentMarker = marker; },
// screen was clicked but no geo-object was hit onScreenClick: function onScreenClickFn() { if (World.currentMarker) { World.currentMarker.setDeselected(World.currentMarker); } World.currentMarker = null; },
/* JQuery provides a number of tools to load data from a remote origin. It is highly recommended to use the JSON format for POI information. Requesting and parsing is done in a few lines of code. Use e.g. 'AR.context.onLocationChanged = World.locationChanged;' to define the method invoked on location updates. In this sample POI information is requested after the very first location update.
This sample uses a test-service of Wikitude which randomly delivers geo-location data around the passed latitude/longitude user location. You have to update 'ServerInformation' data to use your own own server. Also ensure the JSON format is same as in previous sample's 'myJsonData.js'-file. */ // request POI data requestDataFromServer: function requestDataFromServerFn(lat, lon) {
// set helper var to avoid requesting places while loading World.isRequestingData = true; World.updateStatusMessage('Requesting places from web-service');
Antonio Mendoza
1 person has this problem