Calling User Entered Number with Extension - android

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.

Related

Replicating phone gap to a native ios and android app issue

We have a phone gap cross-platform built app and we are building the same app in native.
The app has pages/views with text with embedded hyperlinks in them where it sends the user to other pages in the same app. Of course because this is HTML based so this is possible using phone gap apps. But what if we changed that to native how can we have links inside a text where it redirects users to other views or grabs other data from the database and pushes them to the UIViewController?
How will the backend send us JSON strings with hyperlinks in them that will be able to replicate what the phone gap built app does. Is this possible?
Ok maybe we can send embedded HTML in the JSON data. But how will these <a> links open or grab other data from the server?
I find it very complicated or maybe not doable at all. Anybody has ideas on how this could be solved?
A screen shot of what i mean. This is a phone gap app.
All right first and foremost you need structured data.
Lets say I opend a main post with id '14'. Api will fetch data from server for id 14.
JSON structure can be like this:
{"title":"What are origional sin?","content":"Although Adam & Eve had been given. God has given man free will.","inlineLinks":[{"startIndex":"8","endIndex":"18","contentId":"141"},{"startIndex":"55","endIndex":"64","contentId":"142"}]}
Now using spannable string in android and attributed string in ios you now have id for specific inline link content and start and end index which you can use to add clicks to specific inline links. Once user clicks these link you have id of that specific content which you can open in your app.
Since you know the spannable string I hope you dont need the detail code.
Wish you have started your question with Spannable String problem.
Please ignore the indexes incase they are wrong ;)

How to pass data from a web page to an app which is about to be installed on iOS and Android

Is this possible to achieve on iOS and Android with the least manual operation?
The user visit the web page W and W stores data D somewhere (in the device or the server).
The user install app A and A get D (from the device or the server).
I can only think two ways to indirectly achieve the same result:
W asks the user to copy D into the device's clipboard, and then A asks the user to paste D in the app.
W asks the user to write some random string X (and save the mapping from X to D), and then B asks the user to type X (and get D by sending X to backend).
Btw, after googling a while, it looks like current mobile browsers cannot access the clipboard, and W3C is just writing the draft of clipboard API (2014/09/18 http://www.w3.org/TR/clipboard-apis/ ), so using clipboard as a "hack" to pass data automatically is not possible currently.
We also struggled with this when we built our last mobile app, Kindred Photobooks. We actually created a native library for iOS and Android to do just this - give you the ability to pass data past install. The best way we found is to basically bundle that information in the link and use fingerprinting to make that data available after install, which is working really well.
You can try to build fingerprinting in in house as well - basically create an outstanding device fingerprint once someone clicks on the link and match it to the fingerprint that you create once a user
We automated everything and made sure all the edge cases work on both Android and iOS. Check us out at branch.io and if you are curious on how our links work, you can read more here.
I don't exactly what you want to do, but, you can for example, on the web page, ask the user to enter some info, and then you send to his email a code, then he can share that code with other people, and inside the application, you create a section, so user can enter a code. Using that code, the app makes an HTTP call to the server, and the response can be the info entered by the first user. Of course you are going to need a database.

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.

Redial or reload a href tel if the number is engaged

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.

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