Great hint! Yes I'm pretty sure that that's the problem. The location listener in the SDKsamples is based on android locationprovider classes and it works good if you have a sim card inserted. with a sim card it uses the A-GPS capabilities of your device and also the wifi location provider works better when a sim is inserted. As i guess you are testing somewhere indoors you might not get a good or no GPS fix at all and therefore it may take very long until you get a location update. Google maps might also use an outdated position or uses other sources to get your location.
For your testing purposes you could just use a fake location via using ArchitectView.setLocation()-method and set a location in the vicinity of your AR.GeoObject.
Hope that helps,
Markus
R
Ramesh Krishnamoorthy
said
about 10 years ago
Markus,
Yes that was the problem. Once I inserted a SIM, the SDK sample and my sample both started working! But question is, how did Google Maps identify my location wihtout a SIM?
One more question: in one of your earlier replies you had suggested NOT to use the callJavaScript method and to use the ArchitectView class's setLocation method. Why is that? If that is the case, why is one of the SDK samples is using the callJavaScript method?
Thanks again for your timely help.
K. Ramesh
M
Markus Eder
said
about 10 years ago
Well i guess Google maps uses a little more sophisticated location provider or internal APIs to get position data. With the recently released Android version the Android SDK provides a more intelligent API to get position data from the user. You could have a look into that.
Concerning the callJavascript-call, well it actually doesn't make much difference how you call it, allthough with callJavascript you can inject anything you want into your Architect world. As this is a string that is then parsed in javascript, it is therefore a little more prone to errors due to possible syntactical mistakes, in contrast to the setLocation()-method which is specifically designed to inject location information into your architect world.
Markus
A
Anand Dersingh
said
about 10 years ago
I try the POI examples from the downloaded SDK (3.1) without modification on iOS and the markers show up properly. However, no markers shown on my Android device (Note 2 with Android 4.1.2).
Anand
R
Ramesh Krishnamoorthy
said
about 10 years ago
Markus,
One last question(hopefully) on this thread:
Everything is working fine in the sample I have created and the marker shows up correctly (using the poiwithlabel.js). But I still see an exception in the logcat which reads like this:
10-02 14:43:08.320: W/webview(9282): java.lang.Throwable: Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 10-02 14:43:08.320: W/webview(9282): at android.webkit.WebView.checkThread(WebView.java:15142) 10-02 14:43:08.320: W/webview(9282): at android.webkit.WebView.getSettings(WebView.java:5725) 10-02 14:43:08.320: W/webview(9282): at android.webkit.WebView.getVisibleTitleHeightImpl(WebView.java:2533) 10-02 14:43:08.320: W/webview(9282): at android.webkit.WebView.getViewHeight(WebView.java:2575) 10-02 14:43:08.320: W/webview(9282): at android.webkit.WebViewCore.setupViewport(WebViewCore.java:3741) 10-02 14:43:08.320: W/webview(9282): at android.webkit.WebViewCore.didFirstLayout(WebViewCore.java:3447)
What is this due to and how to remove this? I am using the ArchitectView class's setLocation method as you had suggested.
Thanks again
K. Ramesh
M
Markus Eder
said
about 10 years ago
Hi there!
Could you please confirm that you have read the whole thread and checked everything i mentioned previously. (Especially if you get a valid location)
thx,
Markus
M
Markus Eder
said
about 10 years ago
@Ramesh
Do you get this message only when you use ArchitectView.setLocation()-method or is it anytime you startup the application?
thx,
Markus
R
Ramesh Krishnamoorthy
said
about 10 years ago
Markus,
I believe the exception is thrown everytime setLocation is called, but I am not able to confirm it because the exception disappears during debugging. It seems to happen only when I am NOT debugging. If I am able figure out, I will update in this thread.
Thx
K. Ramesh
R
Ramesh Krishnamoorthy
said
about 10 years ago
Markus,
I have come back! Sorry to resurrect this thread, but the issue has come back to haunt me!
So, I got a brand new test phone, another Karbon Titanium S5. I have installed the SDK sample as well as my sample. When I try the Browsing POIs in SDK sample and click on the 'Presenting POI Details', it says 'JSON objects loaded properly', but no POI marker shows up. I have tried this with SIM and withot SIM. When I try my sample with the poiwithlable.js, I put alert statements in the script in multiple places in the 'createMarkerAtLocation' method from beginning to end. All these alert statements show up properly, but no marker in camera view!
One more update on the SIM use: earlier, I had told you that the samples started working in my Samsug DUOS device when I inserted a SIM. The samples continue to work in that device now ever AFTER REMOVING the sim!
So, I am not sure what to think of this whole solution. Is this issue isolated to me and my devices?
Sorry to be bothering you with this, but I need a solution! Please help.
Thx
K. Ramesh
A
Andreas Fötschl
said
about 10 years ago
Hi Ramesh,
We'll soon provide updated sample-application which handles altitude handling in a better way. Could you please let me know if you see dots in the radar of the "Browsing POIs" sample? I guess it is related to aan inaccurate altitude value of your device, compare this post.
Kind regards, Andreas
R
Ramesh Krishnamoorthy
said
about 10 years ago
Andreas,
Thanks for the very quick response. Yes, I see dots in the radar. If it is an altitude issue, how will it work in my other device? How can altitude value depend on the device? How do I fix it?
Thx
K. Ramesh
A
Andreas Fötschl
said
about 10 years ago
Hi again!
You may ether set the altitude of the marker to "AR.CONST.UNKNOWN_ALTITUDE" or adjust the locationManager so altitude value of user is never passed over to architectView. Both approaches will cause rendering your markers on user's altitude level as fallback.
Kind regards, Andreas
R
Ramesh Krishnamoorthy
said
about 10 years ago
Andreas,
Thanks. I will try your suggestion. In the meantime, I had tried the poicircle.js to see if the circle showed up. Even that is not working. This is the code:
onLocationChanged: function onLocationChangedFn(latitude, longitude, altitude, accuracy) {
//alert(markerDrawable);
var myGeoLocation = new AR.RelativeLocation(null, 10, 0, 0); var myCircle = new AR.Circle(1, {style: {fillColor: '#FFC100'}});
var poiHTMLdrawable = new AR.HtmlDrawable({uri:"marker.html"}, 4, {viewportWidth: 512, scale:1, updateRate:AR.HtmlDrawable.UPDATE_RATE.STATIC}) var myGeoObject = new AR.GeoObject(myGeoLocation, {drawables: {cam: myCircle}}); //AR.context.onLocationChanged = null; }
Is there an altitude issue here as well?
K. Ramesh
R
Ramesh Krishnamoorthy
said
about 10 years ago
I tried the AR.CONST.UNKNOWN_ALTITUDE suggestion. It didn't work!
The same code continues to work in my other Samsung DUOS device.
A
Andreas Fötschl
said
about 10 years ago
Hi again,
I guess location service is the issue of your phone. Some devices do not fire location events if no SIM is inserted...
Please try using a Fake GPS Tool (e.g. this one), which spoofs your location and fires location events frequently.
Ramesh Krishnamoorthy