New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 667257 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

problems with sample project at developer.chrome.com/multidevice/webview/gettingstarted

Reported by intel...@yahoo.com, Nov 21 2016

Issue description

THIS TEMPLATE IS FOR FILING BUGS ON THE ANDROID SYSTEM WEBVIEW. GENERAL WEB
BUGS SHOULD BE FILED USING A DIFFERENT TEMPLATE!

Hello

I want to report some problems with the sample project mentioned in the title. I don't think this is the appropriate template, sorry but I couldn't find a better way to do it.
I used it last month to develop an app that you can see at

https://play.google.com/store/apps/details?id=com.a50webs.intelnav.worldtime

Now the issues:
1. It doesn't compile on the current Android Studio version. As it is, it requires 0.3.2 . Which fortunately I could find, to check that it does result in a functional app.
   But this app compiled with 0.3.2 cannot be used publicly. The Studio version is too old and has security issues, as I found. It looks too unsafe to ship it to the general public, probably wouldn't make it to Google Play. After a few days of pretty hard work I was able to port it to Android Studio 2.1.3 .
   Bottom line, the project is good but it would need porting to the current Studio version.
2. Some features are missing that I'd say should definitely be there by default. Namely, the standard zoom in-out and a way to refresh the current page. I added them to my app (for refresh I provide a menu item). It wasn't particularly hard but as I said I think they should be there from the beginning, it's standard behavior.

Anyway, I want to thank you for the project, with its few shortcomings it still provided a way for me to reasonably quickly develop my simple Web app.
As a thank you gesture, I plan to provide my project to the programming world free of charge. I'll do it in the coming days if everything goes as planned. (I'll use the same CC-By 3.0 license and of course I'll mention your project as a source, don't worry.) I'd just want to ask you if you intend to do these corrections / improvements yourselves in a reasonable amount of time. If you do, obviously there's no point for me to do the same thing.

Regards
V. Simionescu
programmer
Bucharest, Romania

 
Cc: torne@chromium.org
Thanks for your feedback :).

1. what compilation errors do you get here? Have you tried just creating the project from scratch in Android Studio 2.1.3?

2. The developer.chrome.com/multidevice/webview/gettingstarted is an example project (to show developers how to use WebView) and is not intended (as far as I can tell) to include all features a full-fledged app would have. But as you point out it might be good to include other useful features in the example :).

Torne, do you know how to change / add stuff to the example project at
https://developer.chrome.com/multidevice/webview/gettingstarted
?
(do we think doing so is worth it?)
Labels: Needs-Feedback

Comment 3 by torne@chromium.org, Nov 21 2016

We should talk to devrel; I'm not sure who wrote this. Updating it to current versions of tools is probably worth it if the current version can't trivially load the old project, but I don't think we want to add functionality, the purpose is to be a simple API demonstration, not an actual usable application/browser.

Also, I'm not sure what you mean by "the standard zoom in-out" - if you mean the zoom buttons those are deprecated and rarely used with webview in modern apps.

Comment 4 by intel...@yahoo.com, Nov 22 2016

Glad to see you took on my issue so quickly.

I can't answer right away what the compilation errors were for 2.1.3 . In the meantime I moved on to other things and it would take a while to be able to do another compilation. (And, sadly, I can't remember any of those errors specifically. I think there were some mismatches to the toolkit API or something.) It should be easier for you guys. My guess is if you just take the project as it is and try to build it on 2.1.3, you'll get a few errors yourselves. I noted that I got around 5 of them so I'd be very surprised if at your place it works like a charm.
Moreover, it's not just compilation errors. You'll get one or 2 of those too, but there are also mismatches to the instructions on the Web page. The UI of Studio has changed a bit in the meantime. So you should put on a novice's hat and try to follow your own instructions.

I can tell you what I mean by standard zoom. I believe it's called multitouch zoom. Basically, that gesture of touching the screen with more fingers (3 at least) and enlarging or shrinking the touch area to zoom in or out.
You can see a talk about it here:

http://stackoverflow.com/questions/5125851/enable-disable-zoom-in-android-webview

Glad you mention the controls, because I'd like to be able to do it exactly as you say, have multitouch zoom without those controls. But it should work 99.99% of the times across all devices I want to target (4.4 and up). From the discussion above I saw there are issues with this so, instead of risking to have too many devices that can't zoom at all, I prefer to leave both setSupportZoom and setBuiltInZoomControls in the code and have the controls, they're not that annoying. Zooming in and out is crucial for my app, actually for my site, especially on mobile devices.

I can understand if you don't want to add this functionality to the sample. OTOH, I did add it to my app, it seems to be working fine, it's not that much functionality, just the absolute basics, so why not have a project that gives this for free to everybody (everybody who can write 3 lines of code that is). I'll gladly do it myself. (Just to pay back, so to speak, for the consistent good advice I got for free on the Net, first at all at StackOverflow, and for your sample project.) It will be on an as is basis, no guarantees of course. But it seems to work. Just tell me if you want to do it or not.

Regards
V. Sim.

Project Member

Comment 5 by sheriffbot@chromium.org, Nov 29 2016

Labels: -Needs-Feedback Needs-Review
Owner: gsennton@chromium.org
Thank you for providing more feedback. Adding requester "gsennton@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 6 by intel...@yahoo.com, Nov 29 2016

Actually, to be a little clearer. When I said "sample project" that was maybe a little misleading. There is no sample project as such, meaning some archive containing source and project files. There's just the Web page, which contains instructions on how to create a new project in Studio and a few snippets of code to add in certain places. Maybe I should have said "instructions page" instead.
Therefore, as I said, the bulk of the problems will be that the instructions don't match any more with the current Studio version. But I still remember some compilation errors at some point. I can't be more specific unfortunately. Anyway, as I said, if you want to fix it you'll have to execute it step by step.
Alright, I'll go through the project description with a recent version of Android Studio and note what steps fail to build / are incorrect for the new version.
I had a go at creating the example project in the current stable version of Android Studio: 2.2.2. I didn't get run into any build errors (except the straight-forward ones of not having imported a certain class - which the guide explains how to do early on). However several things were a bit unintuitive:

The folder structure is different - app/ vs. src/main/
The layout-xml file is different (different layout + there is a TextView by default in the new version of Android Studio).
The site tells me to remove some code that isn't there: "if(savedInstanceState == null)..."
The site doesn't always tell you where to add your code (this is straight-forward if you know what is going on but I believe this site is supposed to be targeting a beginner).
In the "Handling the Android Back Button" the example-code is badly indented.


So, in conclusion I would say the tutorial is not super intuitive but at least there isn't any obvious problem with the code itself.

Comment 9 by intel...@yahoo.com, Dec 1 2016

At point 2, "On the next page, enter your application name, package name and target SDKs, and click Next.", the current Studio UI doesn't remotely resemble this. You may think the differences are trivial but IMO if you're a novice and, as you say, don't know what's going on, it's easy to spoil things, especially since company domain isn't an exact match for package name. (I work with Studio 2.1.3; I assume the UI is more or less the same in 2.2.2 .)
Point 4 "select blank activity" - there is no such thing in 2.1.3 . There are 3 options that could, from a novice's point of view, be the ones to choose: no activity, basic activity and empty activity. IIRC I tried first no activity, then it looked too different and I went back and selected empty activity.
For me it's quite obvious the project would be much more useful if it was a close match to the current UI.

As for the problems with the code itself, I seem to remember that I couldn't do it with the most recent toolkit and had to install an older version for a certain component. But maybe it got fixed in 2.2.2 . I'm not going to try to replicate it since I got my job done and nobody else seems to have any problem, and it could be fixed anyway.
Ah, right, yeah I noticed the UI for setting up a project was quite different, we should probably update those instructions (especially the activity choice).
Great.

I've got another difference for you. Straight from a novice (me). I'm trying to build a second app that closely resembles my first one but is generic, meaning it has a generic name, default icons etc. . So that I can set up that instructions page of my own I've been talking about. So, I created a new Android project with an empty activity. To my surprise, it created a MainActivity class that extends AppCompatActivity instead of Activity.
I suppose it's not a big problem and I can leave it like this, after searching the Net a little bit. Or I can just manually change it to Activity instead (which is what I'll probably do, since my first app does the same, I want as few differences as possible). But you know, for a novice it can be quite worrying. What if I did something wrong ?
I don't remember having this problem for my first app. But it's very possible that I forgot.

> Or I can just manually change it to Activity instead (which is what I'll probably do, since my first app does the same, I want as few differences as possible).

Actually, looks like that's not such a good idea. I've run into idiotic problems. Looks like I'm going to have to uninstall 2.1.3, install 2.2.2 with the latest for everything and try to build my app the most straightforward way possible. See what problems I get from there.

Comment 13 Deleted

Comment 14 by intel...@yahoo.com, Dec 13 2016

After some delay I finally got to do what I said I'd do, install 2.2.2 and try to build the app the most straightforward way possible.
So now I'm able to report the first compile problem. I don't remember if I had it in 1.2.1 also, I suppose I did but it doesn't matter.
So I created a new project, with an empty activity and backwards compatibility (for now I'll try to leave AppCompat there because it's the straightforward way; I expect it will work). The first thing it did, tried to sync gradle and failed. It gave the error:

CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running.

Of course, the novice that I am would never have known what to do with it. Luckily there's Google and StackOverflow. You can see the problem here:

http://stackoverflow.com/questions/37624369/android-studio-error-errorcreateprocess-error-216-this-version-of-1-is-not-c

Answer no.2, of Siva Prakash, did it for me. I had to decrease the memory usage as well, because I only have 1G of RAM. Set it to 500 something M and it worked.

Make no mistake, I only was able to do it because I'm not actually a novice. I am regarding Android, but generally I have some 15 years of programming experience so I mostly know my way around. A true novice probably would have had at least moderate trouble with it.

Comment 15 by intel...@yahoo.com, Dec 15 2016

OK, looks like after this everything went more or less smoothly (except for a few minor discrepancies). I now have a second functional app, built with Studio 2.2.2 .
I haven't added the zoom support and refresh menu item yet but these are of less interest to you, so I thought I'd let you know that it worked. These were all the problems on my system. (Also, it might depend on the minimum SDK chosen at begin; I used 4.4 KitKat.)

Comment 16 by intel...@yahoo.com, Jan 18 2017

Happy new year.

My updated project page, that has been tested in Studio 2.2.2, is here:

http://intelnav.50webs.com/app_project.html

As I said, I added instructions for multi-touch zoom support and a refresh menu item, so it's a practically usable Web app.

Maybe you could put a link to it on your own project page, so people know where to find it ? Or is it too much to ask ?
Cleaning up "Needs-Review" label as we are not using this label for triage. Ref  bug 684919 
Labels: -Needs-Review
Cc: gsennton@chromium.org
Owner: ----
Status: Available (was: Unconfirmed)
Sadly, I'm not sure whether we can add a link to your project - we would have to make sure that the link remains valid for a long time.

As Torne noted in comment #3 we probably don't want a full-fledged app as an example here - just a very basic example to show how to get started with WebView.

Comment 20 by intel...@yahoo.com, Jun 17 2017

Thanks for answering, even if somewhat belatedly.

Making sure the link remains valid isn't an issue. I can give you the project to put on a page on your own and then it will remain there as long as you'll want it there. The only issue is whether you'd like to have such a thing (of course you'll first make sure that it's OK).
I would want 2 things in return. First, naturally, you'd have to mention me as the author. Second, you'll have to leave in place the link to my app as an example. It's on Google Play. If for any reason at some point it will be removed, then of course you'd remove the link too.

So, it's your decision.
Project Member

Comment 21 by sheriffbot@chromium.org, Jun 18 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 22 by intel...@yahoo.com, Jun 19 2018

I would close it but I don't know how to do it. So if anybody else wants to do it, I'm OK with it.
Status: WontFix (was: Untriaged)

Sign in to add a comment