Sending an address by SMS - android

I have an appointment booking service that I want to be able to send the store address via SMS to the customers. I know I can just put in a regular address and Android and Apple will let you click on it to put it into the maps application. However, the addresses can sometimes be long and blow past the 160 char limit, meaning the customer gets a split message.
What I'd like to do is put the address in a URL shortner and have that be clickable to go to the maps app. My understanding is that if the link redirected to a geo:lat,long link that it would do that but it doesn't seem to work.
Can you suggest how to use a shortened URL that would allow a click to go to the map app on cell phones sent over SMS?

Look into TinyURL.com, it gives smaller url's. You still have enough space left for normalish adresses. Here even seems a way to call it from java.
http://www.mularien.com/blog/2008/12/04/tutorial-accessing-the-tinyurl-api-from-java/
Try it for yourself by following this link: http://tinyurl.com/outx83r
Option 2 would be a use a more modern system like WhatsApp, or your own message app.

Related

URL in Android SMS message truncated

We are sending text messages with a URL in them to mobile devices. Most people didn't seem to have a problem, except Android users.
Multiple messaging apps attempt to "linkify" what they see as a URL in the body of the message.
For no apparent reason, only the first portion of our URL is treated this way with a few characters at the end that are not included in the link. They are shown and they are correct.
They are just not part of the link so when the user clicks on the link, only the linkified portion is used and the link fails.
I know iOS had lots of problems with currency symbols and key words as they attempted to turn SMS into banking. This is not that.
Found what was happening.
All SMS messages are broken into "segments" when they are too long to fit in one SMS message, usually 160 characters or so.
What I discovered is that if the URL in the message falls across a segment break (in my case segment two to segment three) when the segments are reassembled on the phone, the part of the link falling into the next segment is not included when the message app "linkifies" the URL. It simply appears as trailing text.
Can't answer which OS version this is since it belonged to an end user. The phone was a Galaxy S8+. I did have the user update to the latest version available and the problem still existed. I also had the user try two different messaging apps with the same result.
In the end, I simply changed the message text to always have the complete URL fall into a single message segment. That's a half assed solution, but the only one available. Time to move on.
I got lucky on this one with some screen shots, a bit of digging and an old man's intuition.
Here's a link to the Twilio segment calculator. Thank God for those heroes.
Twilio Message Segment Calculator
HTH someone.

Limit my website to loading only on specific devices

I would like to create a dashboard app/site running at my home(or maybe on my hosting plan online). But the dashboard would display private info like locations of all family members, etc. So I want to limit the site(or app) to only work on specific devices. Ideally my wife and my Android phones. I'm wondering if the Android app(or website) can check the device mac address and only work if the mac is in the white list? Any other options for doing this?
If you only need it to work for a small number of trusted users, which it sounds like is the case, you can simply generate a long, random string (too long to guess by brute force) and pass that in the URL to the site. The server could then refuse to render the page for any request that doesn't pass the correct string.
This doesn't scale particularly well to more users, as the key could be leaked and you can't revoke access for one specific device, but for just you and your wife, it should be more than sufficient.

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 ;)

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.

Getting the name info of unknown phone number

Let's say we have got a number.We want to send SMS to this number but in the message body we want the user name.ie. "dear name surname". I searched the internet but could not find any code sample.Is not it possible in android?
That's a big problem, is it not ?
Many a times we get calls from phone nos, not in our phone contact list. Those numbers come as unknown numbers. Sometimes the nos, come as masked as well.
So if you are to develop an app to unmask those, how will you get around it ?
Well the solution is you gotta make use of trap calling web sites .
What are trap calling web sites ?
These are web sites , which do a reverse look up of the no that you query and it gives you the name of that number holder.
For e.g, if you are a person in US, then you can make use of the WhoIsThisPhone web site to find out the name of the person calling you.
In case, it's a masked no, you can get around that one too . But you will have to you to pay a subscription fee on a monthly basis for availing this feature(services like trap call are available as apps itself ) .
Depending on which country you are in, you will have to make use of similar services/web sites available to get your job done .

Categories

Resources