Wear OS 2.0 - Is there any way to process html, web page, programmatically? - android-webview

I can't seem to find ANY information on Android Wear OS and html. My end goal is just to show a simple web page with buttons for IOT control. I have all the backend already. I know I can use other views but my backend dynamically creates a page of buttons. I'm open to other ideas for dynamically building an interface. I know webview isn't supported. I found crosswalk-project but it's no longer maintained and seem too complex for my needs.

GeckoView might be a good starting point https://firefox-source-docs.mozilla.org/mobile/android/geckoview/consumer/geckoview-quick-start.html
https://searchfox.org/mozilla-central/source/mobile/android/geckoview_example
But it probably won't be a great experience.

Related

Feasibility of a desktop app that should overlay another app

I'm looking at developing a desktop app that should overlay Word on windows. I have looked into office plugins, but they are too limited in their functionality. Essentially, I want to achieve something like what is shown in the image below.
These highlighted text segments should move as the user scrolls etc., but do not have to be instant or could be shown when the user has been at one location in the document for more than a second, etc.
Is this possible? The overlay should not interfere with the word functionality, and what framework should one go for in the development Electron? Windows is the main platform where it should work but would be great with an easy port to Mac.
Any resources are much appreciated, and I was thinking it could be built kind of like Loom video. Have already looked at this and trying out this one.

Getting routes and turn-by-turn navigation in an iPhone app

I'm developing an app that will focus heavily on giving users routes and turn-by-turn directions while driving. It is important that they stay within the app during their drive, so I really don't want to make them leave the app and go to the built-in Maps app. I have been doing a lot of research lately on how to include this functionality, and it is widely known that it is not easy, since Apple doesn't include this functionality in the SDK out of the box. It looks like my options are:
For providing routes (and directions) from one place to another
Use a UIWebView and load some web-based maps with JavaScript, and use the JavaScript API to draw a route
Use MapKit or the Google Maps iOS SDK, query for the route sepaartely through an API, and manually draw some kind of path or polyline on top of it.
Use a library that costs money (like MTDirectionsKit)
For providing turn-by-turn navigation
Use a proprietary library that comes with its own maps (like CloudMade)
Is there anything I'm missing here? What are the pros and cons of each, and how should I pick a solution?
Your insight is greatly appreciated. Thanks!
You say that you don't want to "make" the user leave the app and use the built in software for turn by turn navigation as though this is a bad user experience. A bad user experience would be getting forced to use a turn by turn nav from a webView or some API which would not show up as routing information on my lock screen if I lock the phone or cut into other applications to display banners telling me a turn is coming up, for example, while I'm listening to music on my phone. I strongly suggest you launch Apple maps and let the system handle what it is meant to handle instead of trying to build your own turn by turn navigation and heavily limiting the user from the freedom of exiting the application during a drive.
While on the subject of commercial libraries you might what to take a look at other options:
skobbler/telenav sdk - in-app routing and turn-by-turn navigation based on OpenStreetMap (same maps used by Cloudmade and Mapquest). Check out the demos and the licensing plans and figure out if it's the correct solution for you
(they have a Free Tier that might be good enough for your app - and if you go above that tier I think you should be considering monetizing you app)
and that's about it for the time being (besides the options already named): keep an eye out for Mapbox as they could provide an iOS sdk in the near future - with routing and navigation
I agree with Kris' response. Turn-by-turn navigation is probably best handled by the built-in app. However, for displaying a route and ETA on a 2D map, I think I'm going to go with the Mapquest iOS API, which offers this functionality for free. I didn't know this solution was available until today.

What are the pitfalls when implementing a web page like app?

I'm planning to implement some app that performs similar functions as some website does. An app should be able to post, get and view some data. Most viewing data is available only after login. Payments. The webservices are .NET asmx XML services.
So, I'm planning to use UIKit, drag and drop some text fiels. For posting the data, I will do some manual input validation, assemble input into a string, post it to the server. Also, some parsing will be done after getting info form a webserver. Now, I haven't done any website app before, so I'm just curious what are the potencial problems that I might run into.
I guess you are asking about potential technical issues. The ones I faced recently working on an app of this type and workarounds are:
Maintaining your session with the server if you are combining native UI screens together with UIWebView's of your website.
XML Parsing can be hairy at times, so JSON is the best option depending on your preference. The other solution is to output XML in the PLIST format which is easier to code against. On the server side PHP has some PLIST generating libraries. Am not aware of what is available on .NET.
On the iOS side the ASIHTTP library helps make it easier to post to websites, particularly when you are using binaries etc.
Depending on your use case you may also consider a pure web based UI version which resides inside a UI webview. If you are planning on going this route JQueryMobile is a pretty good solution for rendering iOS like UIs. This saves you quite a lot of effort on the communicating with the webservice and parsing etc.
Thats all I can think of for now.
Biggest problem might be getting it approved by Apple if they think it should be just a website and not an app. They might cite: "Limited Functionality". see : https://developer.apple.com/appstore/resources/approval/guidelines.html
I can also reccomend www.sudzc.com
Your UI will certainly not be as responsive as a native app.
Your users won't be able to use your app without an Internet connection/flaky connection
You'll have to rebuild all native controllers yourself if you wan't your app to look like a native iPhone app.
You'll have to rely on libraries like PhoneGap to use most of the hardware/non HTML supported functions (like geolocation, camera, etc.)
Etc.

How does the development of a mobile website differ from a normal one?

We are going to redevelop one website we developed as an ASP.NET website to be a mobile one.
So, I'm wondering how does the development of a mobile website differ from a normal one?
Also, what is the best approach to do this taken in consideration that this mobile website will be browsed mainly from iPhone?
There are a number of differences between a mobile device and a standard computer.
The screens are much smaller (fewer pixels to display your page). You should put fewer elements on each page.
They are typically viewed in portrait mode (narrow display - narrow page). You should plan on using the full width of the screen instead of setting a fixed page width like most people do on standard web pages.
People use finger gestures to manipulate the page instead of a mouse (buttons/links should be larger)
They can include additional features such as geo-location, telephone, etc. that you can incorporate into your app to be easier to use. There are some libraries available to help you use these, such as jQuery Mobile.
Users are concerned about battery life plus the CPU tends to be slower. Make sure you keep animations and client side processing to a minimum.
Users are concerned about data usage. Keep ajax calls to a minimum (don't ask the server for data every few seconds!) and use graphics sparingly (it's better to use html/CSS to make the page attractive).
Flash isn't supported on iPhone and is not well supported on other devices. However, most mobile devices have decent support for HTML5, so you can typically use that instead.
Users on smartphones are used a different experience.
In addition to Brian's answer I'd add:
Screens are not resized but scrolled, however sides scrolling is not generally a good experience
Screens orientations can change, but the same scrolling rules apply
Consumers are used App like behaviour and as such less information with backwards and forwards between pages is common and between sites
Consumers generally have data concerns so data traffic needs to be minimised
Controls/buttons/selections/data entry need to optimised for hand gestures - for example think of what happens with the keyboard pops up to allow data entry, how much screen is available - can the see all their input easily if they need to?
I suggest that for developing a mobile website is to use the target smartphone for a few weeks to understand how the device is used in the real world.
I'm afraid you cannot use current asp-View to mobile especially for iPhone. There's special control set for iphone development - componentone.
If you web application is based on MVC or MVP patterns then moving will be not difficult.
Recently we have developed a site for iphone users, we are using asp.net/sql for normal site.
But when you look at mobile sites, mobile normally have small screens and some time optimization problem.
We use jqtouch for mobile development. A JQuery plugin for mobile web development on the iPhone,Android, iPod Touch, and other forward-thinking devices.
Learning Video
Getting started
Establish the context for the mobile site: is there subset of information that is more relevant to your mobile users? Maybe your regular site has apps that are irrelevant on mobile devices? Either way, you should create your mobile site separately in a mobile folder! You can then use a sub-domain to reach it: for example, http://m.mysite.com
You can use a combination of CSS Media Queries and 51degrees.Mobi to detect browser features and render the correct size layout depending on which type of device the user has.
http://html5boilerplate.com/
http://www.modernizr.com/ (this is included in HTM5 Boilerplate)
http://51degrees.codeplex.com/
Do not make the stupid mistake of following current fads like "Responsive Web Design" which attempts to squeeze a desktop version of a website into a mobile screen. Above links should get you started.

How can I code an efficient mobile site like gmail's?

My web site has a different mobile version that's suited for iPhone/Android devices. The problem, however, seems to be in the site's performance. It's really slow and heavy, even though I'm not loading any images.
On the other hand, when I use Gmail's or YouTube's mobile version, they're so fast they almost perform like a native mobile application.
How do they do that?
Your help is much appreciated :)
See my comment. Also, if the slowness you perceive is when interacting with the site it could be that it lacks the ability to accept touch events. On mobile web, if you have not wired up the UI for js touch events the experience will seem slower because the device browser has to fall back to standard click and other mouseevents which are not optimal. Frameworks such as mootools and jquerymobile/jqtouch have these events baked in. Take a look at the mootools solution which has quite a good write up: http://davidwalsh.name/mootools-touch
They probably making use of local storage http://dev.w3.org/html5/webstorage/
Are your pages too large? Try to use gzip and/or reduce output
Your server's connection speed may also be responsible of slowness
Well, You don't need to include any javascript framework to make it fast clickable.
By implementing some JavaScript you can achieve that. Google has released a solution for that
https://developers.google.com/mobile/articles/fast_buttons
This will allow visitor to interact with application native way. From Android 4 (as far as I remember) version by setting viewport meta tag the browser will automatically apply the fast click functionality.
For the animation issue always use Hardware accelerated animation with a fall back for older mobile browser. Using hardware accelerated animation it will make your application smooth as silk.
Follow this guideline and you can make your application as fast as gmail / youtube mobile version.
http://www.html5rocks.com/en/tutorials/speed/html5/
Best of luck.
Your webapp is consuming too much RAM. Don't use so many libraries and don't attach so many event handlers.