HTML A Name attribute on android browser - android

I have a web page with about 150 HTML <a name="blah"></a> elements, plus 26 more that group these by letter, like <a name="lettera"></a>.
The page passes W3C HTML validation and renders and operates correctly in desktop browsers. Trying two different Android browsers and an emulator, the letter index does not work. When any letter is selected, the page only moves to the lettera tag. The location bar correctly shows <site>page.htm#letterx as the current location, but the display has not moved.
Other pages on the same site with a smaller number of name tags work correctly. I found one web reference saying that some browsers did not like to see two name tags in a row and suggesting placing the nonsense tag in between them to break them up, but this did not help. Any suggestions?

Answering my own question in case it helps someone else someday, it appears there needs to be actual renderable content between two successive name tags for the android browser (a comment alone didn't do it). When I added some all worked as intended.

Related

Android : Html.fromHtml() not showing output same as web

I have attached screenshots for web and app.
In web
Inside textview
Html.fromHtml() isn't supporting all HTML tags, check out supported list in HERE and THIS SO topic. its very basic implementation which doesn't supported e.g. nested <span tags (looks like) - closing tag </span> is closing ALL opened previously spans, not only last one (so your red background breaks after first span-styled letter, when orange-coloring-span is closed)
if you want full support of HTML content - use WebView and loadData method

Android accessibility in Edit text box text not reading properly/Expect After Talk back on

I am creating app for blind people. there, when blind people after entered the zip code on that profile registration Edit Text box, like 45987. It reading as Fourty Five Thousand and Nine hundred eighty seven.
But, I want to read an Four Five Nine Eight Seven. 4 5 9 8 7.
Note: when i tried for the same in TexView, its reading as correctly. only problem with EditText.
My Sample Code: zipCode_EditText.setContentDescription("4 5 9 8 7");
I have referred these link:
Android Acccessibility: How do I change the text read out loud for an EditText View
How to make TalkBack read TextView error message automatically?
Thanks Advance
In general, you don't want to force a screen reader to read something a specific way. Unfortunately, screen reader users are used to the way things are read. If your input field has a properly associated label with it, such as "zipcode", then when they hear "zipcode Fourty Five Thousand and Nine hundred eighty seven", they will understand what it is. Screen reader users can navigate elements by character so they can read each number separately if they want.
The important part is that you have a label associated with the input field. I know you're writing specifically for Android (which I'm not familiar with), but if I compare what you're doing to html, in html you'd want something like:
<label for="zip">zipcode:</label>
<input id="zip">
There are ways (in html) to force what a screen reader says, but it typically messes things up for braille users. Any "hidden" text you add to force the screen reader speech is physically displayed on braille devices.
For html, the autocomplete attribute can be used as a "hint" to screen readers on the type of information that is in a field. Screen reading software can use that hint to change the way it reads the contents of the field (such as autocomplete="postal-code"), but support for this hint is not widely supported yet. Again, I know that's for html and you're writing specifically for android, but perhaps there's a similar "hint" concept for android.
It is best to not force Talk Back to do this. My recommendation would actually be to just stop doing this altogether. As a blind person it is actually easier to parse a single number than individual ones. 45,500 is easier to remember than 4, 5, 5, 0, 0. Covering "forty-five thousand nine-hundred eighty-seven" mentally to a zip code becomes second nature. And if there's a number long enough such that it requires inspection one number at a time, TalkBack has modes to support that. You can switch TalkBack to character mode and explore it like that manually.
This requirement really just comes from sighted individuals thinking like a sighted individuals and solving problems blind individuals don't have.
And since another user brought it up, the best way to code an edit text in Android is
TextView label = ....
EditText editBox = .....
label.setLabeFor(editBox);

how do i stop random characters from appearing on android webpages?

i am wondering why these characters appear on certain pages on android devices and how to remove them. at first i thought they were appearing on :before :after selectors because of content:""; on .clearfix and .col- etc in the bootstrap css. but im stumped so i thought id post here. some devices they show up as little boxes with "x" inside and some with "?" inside but only on android devices..
the links below are screenshots taken from browserstack:
https://www.dropbox.com/s/7hm00z4bkt8m9i3/Screen%20Shot%202015-12-15%20at%202.17.21%20PM.png?dl=0
https://www.dropbox.com/s/qn4a934kos5kdww/Screen%20Shot%202015-12-15%20at%202.17.05%20PM.png?dl=0

Wrong focus area of form elements in android 4 (ICS) WebView

I have a form in a Right To Left html page and I have a WebView that shows it. Html input fields of my page can't get focus when I tap exactly on them but when I try tapping somewhere beside of correct area, it becomes focused.
My issue occurs just when the phone is in portrait mode, while I don't face it in landscape mode.
Here are screenshots of aforementioned issue:
Any help will be appreciated.
The problem caused by adding dir attribute with rtl value to html or body tag.
Your html or body should not have this:
dir="rtl"
According to the W3C spec, http://www.w3.org/TR/html401/struct/dirlang.html the dir attribute can be added to the html element, so I'm not sure that's it
To set the base text direction for an entire document, set the dir attribute on the HTML element.
I am also seeing some odd issues with the RTL behavior with Android browsers (it works fine on a desktop).

Take an element from a website and put into an android app

Okay noob of the year question.
I have a website, which has several div. and one of those div I would like to put as the front end of an android app.
I.E, I have this div id
I want to put that entire element as the android application. Of course add buttons for it for various items, but right now that is my main obsticle.
I dont want to hard code the page into the android application, becuase of course that element changes.
Thank you in advance.
You could use a WebView to display a Website inside your application. See this article. If you want to display only one div of a website, you could move this div to another page. This should be the easiest method to achieve your goal.
BTW: There are no stupid questions ;-)
One option would be to code your site so that this DIV has a unique ID assigned to it. You could then download all of the HTML from your site into a string in your app, parse out this individual div you want (by finding the unique ID) and save it in a string named, say, html. Next you can place this DIV inside of a webview using webView.loadData(html, mimeType, encoding); where "html" is a string containing the div you extracted. So long as that DIV has content that has absolute paths to resources (images/links), it should load and display your content properly

Categories

Resources