I'm working on a Google Glass app that uses a webview.
In the standard Google Glass browser, you can place two fingers on the touchpad and move your head around to pan the webpage. It also overlays a crosshairs that can be used to select links.
I am trying to figure out if there is a way to programmatically enable the head controlled panning and display the cross hairs within a webview? Has anybody come across an api that allows this?
Any help will be most appreciated.
That's a feature of the built in browser. You can request that such a feature be available in the GDK here otherwise I would suggest simply sending an intent to the built in browser.
As said above, this is a feature of the built-in browser. The default WebView doesn't have the cross-hairs overlay, nor does it detect Gestures. You may have to implement a GestureListener and have it send Javascript events using loadUrl().
Here's a link to the SDK For GestureListeners:
https://developers.google.com/glass/develop/gdk/input/touch
Here is my workaround on how to do this: https://github.com/mikesmales/GoogleGlassCrosshairs
Related
I am trying to add a podcast and a youtube channel to my native Android app, but it seems it would be much easier if I just use HTML and access that media as it is on the web.
Is it possible to have an activity be HTML5 or a basic web view? If so, how can I do that?
Thanks!
Yes this is possible, have a look into WebView
http://developer.android.com/reference/android/webkit/WebView.html
A View that displays web pages. This class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.
You may find some performance/compatability issues but this is the easiest solution and one that I would do as a first step.
I have a website with mobile optimization (actually more like responsive optimization, but whatever).
On one page I have a Google Map with lots of custom markers. Since this map is in quite a small div (at least it appears quite small on smaller screens), it's not really friendly to use. Is there an easy way to open this exact map (with the same location AND all my custom markers) in the native iPhone/Android app? Maybe a JS-library of some sort, or even something directly developed by Google?
If this is not possible, is there maybe a trick to open it fullscreen, to at least get the native feel?
Thanks!
I haven't tried this but maybe you should take a look at these links
Launch custom android application from android browser
Make a link in the Android browser start up my app?
and try passing the longlat info within or parameters
Is there anything that I can use to mimic the UIPageControl in Android Phonegap? I've tried to research it but can't find any clue.
As far as I know in HTNL and Jquery i dont think you have any control to do such. You will have to implement it on your own. You will have to take an image tag in HTML with two buttons / handle the swipe event in jquery Mobile (http://jquerymobile.com/test/docs/api/events.html) and then upload a new image and call redraw on the page.
Some of the users of my website are telling me they find it annoying when they try to touch certain links and instead of activating the link it zooms into the link and associated metadata (which is made up of a few links).
So how many css pixels of separation are needed between the link and the associated data to stop this behaviour?
I also would like to know that, and eventually a js/css trick to disable it on demand.
You can also have a look at this question :
How to prevent google chrome android browser to display the magnifier when users click a button?
I experimenting with WebView in Android and I can't figure out how to make it work like the native browser.
I have an example for this:
Go to deviantART.com in native browser. Press Menu button. At the bottom of the menu there will be a link to disable mobile view and it works as expected. This exact same thing doesn't work in WebView. It simply turns the menu off and that is all, mobil CSS still stays intact.
I need to make users disable deviantART's mobile CSS, so I need the WebView to work like this.
JavaScript and DOMStorage are enabled.
I need the proper code or an workaround, but after hours of searching I didn't find anything that connected to this problem.
Thank you in advance.
If all you want is to turn off the mobile view you can set the user-agent string on the WebView using setUserAgentString (String ua).