Redial or reload a href tel if the number is engaged - android

I am using an href tel: to successfully create a clickable link for mobile phones such as Android. However, if the number is engaged/busy (unreachable) there seems to be no fall=back option to redial or reload the page.
Is it possible to refresh or redial the page if this happens from within the OS?

That functionality would clearly lie outside the control of a website or web app, since it will have transferred control of the call over to the phone application by that point.
So no, you're not going to be able to get a "callback" or the like from the phone application to the webpage indicating failure. Indeed, that might be a privacy concern anyway.
As far as refreshing or redialing, the closest you might get is to put a "refresh page" hook on the action of clicking a href tel: link with javascript, which is a relatively trivial procedure that is well documented elsewhere.

Related

Should I open an url in WebView inside app or in browser?

I was wondering if there is a best practice in Android about WebView/Browsers. I want to open an url in my app to show a web page but I do not have anything to retrieve from that page so I do not need to show it in a webview inside my app. Should I show that page in a browser or in a webview ?
If you should open an URL in WebView or Browser that totally depends upon your requirements. Still I am adding some points that you can consider:
Browser:
If you have some data like Privacy Policy of your organization, that just for user information. You do not require any inputs from user.
WebView:
If you want to,
Customize content of URL
Get some input from User
Send some information to Server
Thank You!
Quick Answer:
From your context, it looks going the Browser way is good enough.
Details:
When you don't have user inputs to process and it is not part of the user-flow in your app, go about showing it in the Browser. It's easier that way, because you don't have to manage anything explicitly.
When you have something to process or that this window is some part of your in-app flow, you should go the WebView way. It gives you the power to manage things and you really need to code of situations like user pressing "back button", and the like. I mean, you're the owner of the life-cycle management of the WebView and see how it seamlessly fits in your user flow while (s)he is at it.

Is there a way to pass a variable to an aspx file via the url?

I am trying to write a little Android app for my daughter. The goal is to scan a book's bar code and pass the ISBN number to this website: http://www.arbookfind.com/default.aspx . The result will show if the book is part of the Accelerated Reader program and how many points the book is worth. I am trying to automate the part where the ISBN would need to be entered into the search field.
For simplicity's sake, and because I'm not a programmer, I am using MIT's App Inventor 2. I can now scan and get the ISBN but I will need to know how to format a URL to the website that will allow me to pass the ISBN to it's search page.
Is it possible to send a variable via the URL similar to index.php?myvar=testing&someothervar=somethingelse ? I've tried but perhaps I am not using the correct variable name or format for aspx. Is there an easy way to see what the variable name is in the aspx displayed page in my browser?
EDIT To clarify, I am not trying to scrape data and avoid showing ads from the site I am using to generate the results. I am wanting to pass the ISBN number to the page and have it search and display the resulting page in the phone's browser. I am also fine with a method that would populate the search field and the user would have to hit the search button if that can be accomplished easier.
I would recommend abandoning this route, as it is highly unlikely that the owners of this website will want you passing a query string to their site anyway, but rather they will most likely point you to an Application Programming Interface (API) that they provide, so that your program can connect to this service (free or paid, depending upon the company) and then you can request the book's details by providing the ISBN in the request.
There is no discovery mechanism for an .aspx page like there is for a web service to find out the names of things to pass. Even if you figure out what the name of the query string is that you could pass in for ISBN, you run the risk of the implementation being changed and your "application breaking". While this is also true of web service APIs, since APIs are the route the website providers want you to use, as opposed to screenscraping, then they generally inform their users of breaking changes or newer versions of the API via documentation.
From what I can see that page does not accept URL-variables for their search field the way google.com and other does. The page is generated through some sort of content management system (CMS) and it relies heavily on javascript to make things work. I tried doing a normal search there, and you have two issues you need to wriggle around.
First, the page redirects you to a page where you select if your a student, parent etc. It seems that it relies on some session cookie to remember the setting, but it times out pretty fast.
Second, the form uses javascript to trigger the search, and it appears to be done using AJAX, a method of using javascript to trigger actions on the server and displaying the results, without actually loading the page again. You might be able to get a hold of the javascript code used and re-engineer it for your purposes, and call that using HTTP POST and/or GET from your app, but it is a tricky path, and quite possibly not allowed by the company since you will be loading data from their site, without presenting their advertisements and thus be costing them money.

Calling User Entered Number with Extension

I am trying to design a webpage that will allow the user to enter an extension (e.g 1234) and then press a 'call now' button that will call a predefined number (on ios or android etc) followed by the extension e.g - 02098761234.
Not sure if I need a script of some sort or whether it can be done in HTML but any advice would be much appreciated.
I've looked around on here and found a few similar questions (Placing a phonecall including extension) but none that talk about doing this from a webpage.
You can use a link tag:
1234
Following this logic, your script / web page could dynamically construct this phone number and go to the URL via javascript.

Defining URL for "put on homescreen" functionality

I'm working on a mobile webapplication which consists of multiple pages (with different urls)
/index.html
/products/1.html
/products/2.html
{...}
Now if the user is on one on the subpages and selects "put on homescreen", I'd like to put the startpage (i.e. /index.html) on the homescreen, so he goes to the home page when clicking on the icon instead of some subpage.
Is there any way to tell the mobile OS (iOS and Android in my case) which URL to choose for putting on the homescreen?
Unfortunately iOS chooses the current URL and does not provide a meta tag option to set this. As for Android I don't know whether there is a possibility to do this but I don't believe there is one. It makes sense for security reasons.
But maybe there is a workaround for this. I thought about the following (untested, just brainstorming):
Create a session for the user and measure last interaction time. If the last interaction happened e.g. 10 minutes ago, redirect the user to the starting page. So if your user doesn't use the App for a while and calls it via the homescreen, he will be redirected to the first page.
Another method would be to use anchors for all the navigation and a script that disallows to directly browse to anchors without previous user interaction. So even if your user is at /index.html#products/2 he has to start at index.html

Passing data from Android Browser to external app

This is what I need to do:
I have an app running in the background. Now when the user is browsing and comes across an 'interesting' URL, he can make a gesture and send the URL to the external app. The app then processes it.
I can think of two way of doing this(though I am not sure if either is possible)
1. Program something like a hook that senses the particular gesture or key press and sends the URL to the app
Write something like an add on to the browser.
My question is, is any of this possible. If yes, could you give me a few hints so that I can go ahead. If not, then is there any other way to do it?
Thanks,
Sandip
Short answer : You can't use the android browser like this.
Long answer : The android browser is an application. The only way you can interact with it is to call it with an argument (a URL). And... that's all. You can't write an extension to the browser like you can do in Chrome.
If you want to control the browser, use a webview, but even in that case, you won't have the ability to detect gesture.
What you're trying to do is not possible.
Take a look at WebViewClient.shouldOverrideUrlLoading. It should allow you to be notified when a new URL is loaded.
http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading%28android.webkit.WebView,%20java.lang.String%29

Categories

Resources