How to (sort of) control android device from webapp? - android

I need to be able to control Android phone through my webapp. I need to know which permissions do I need to take from user from his/her google account. For example I need another user to be able to send an address to this user and this should open his Google Map with that address shown. Or send a message and it should be somehow opened on the user's phone. Is this all possible? If yes, then how. If no, what can be the closest we can achieve?

If your are creating an Android application that can be installed on users phone than as far as I know this is quite possible...
All you need to do is to use push notifications server like firebase to send the data from your webapp to an application on users phone. Then according to the request received the application has to determine which intent/Broadcast to send.

Related

Is there possibility of adding whatsApp option in my application?

I am developing an Android based application.
In my app communication between users plays a vital role. My app has
built-in E-mail options as a primary source of communication and I wants
to add WhatsApp option too.
Is there a way to add WhatsApp option inside my app which when chosen opens
open WhatsApp Application? If yes, I would love to know how?
You can first check if WhatsApp is installed on the device. The package name for the WhatsApp app is com.whatsapp.
If it's installed, then you can use an explicit intent to automatically take the user to the app to send a message.
You can not under any circumstances control how the user uses WhatApp. It merely opens the app for use. You may be able to guide a user to a particular contact, but that's going to be part of WhatsApp's api and is not guaranteed.
If it is not installed, then you can either remove the option from view since it simply can not be used, or send them to the play store to download it.
WhatsApp, to my knowledge, does not have an open API, so you can not directly integrate the service in to your app. You'll always have to be taken out of it.
Alternatively, you can also send the message as an SMS through an implicit intent. This will allow the user to use whatever messaging app they want so long as they handle SMS.

How to add a link to the Android or iOS app store in an SMS depending on OS?

I have a mobile application in iOS and Android formats. I run a server containing a database of user telephone numbers, for the purposes of sending an SMS message via Twilio. However, I don't know what operating system each number is associated with. The app does not make HTTP contact with the server.
I want to send a link to each of my users by SMS, which will redirect to the appropriate app store depending on their operating system. Facebook does this - does anyone know how they do it? Do they detect the operating system via the phone number?
Basically, once user click on that link it should automatically redirects to appropriate app store.
Ah. You have users DB represented by the phone number only, right? So you don't actually know which smartphone user has Android or iOS. In this case you should use a special universal url (sent in SMS, most probably shortened) linked to a special webpage on your server with special js (JavaScript, web devs should help on this) intergated. This script should detect which type of device user is using while viewing a webpage and simply redirect to the corresponding market. Also you could provide just both app market links on your page so it will be up to user to choose - in this case no js needed, it could be a very simple html page.

Which storage option for preserving app data in android?

I do not want the data that is fed into the android app by the user to go away when the app is uninstalled or the device is lost/disposed. What I necessarily want is - data has to be tied to a user account rather than a device where the user can install the app from any other android device by logging into his account using his login credentials and see all the data that was entered in the past from an old/other device. Please suggest a storage option that would best fit for this scenario.
This is a very generic question and I think someone might vote to close it but I will still attempt a generic answer.
Essentially you want the data saved on some external data storage (not on device). So the obvious thing is a server. You will need to set up a machine and run a server on it which can communicate with your app. Also you will need to have unique id for each user (authentication?) which will link user-data with the user, so that if user uninstalls and reinstalls your app, the app can then download the user's data from the server to the mobile device on which the app is running.
For the server you can look at Amazon AWS, Google App Engine, Heroku etc. You can set up a minimal server at one of these places, maybe set a DB there (SQL/ NoSQL) and get a unique URL so that the app can ping the server (so static IP obviously). Then your app can send network requests to your server fetch data for a user and save it to the app whenever the user wants it (say on reinstall, device change, monthly etc).
Hope this helps!
Google is working on Google Cloud Save as a simple way to save data to the cloud on an Android app. There is no backend programming needed.
It's in closed beta now, so that's not super helpful right away, but it might open up to the public soon.

SMS link to open app that is phone agnostic?

So I'm thinking this may be impossible. But on each phone platform there is a convention to send an SMS link, that when clicked, will launch an application on the device and do something based on the parameters sent in the link.
Ex:
iPhone: Launch an app from a link in an SMS
Android: Launch Android app from within SMS/MMS message?
However is there anyway to do this that is effectively cross platform? For example I have an android phone with my app, and I send an invitation to a friend that has the same app but the iphone version (perhaps I don't know he has an iphone I just have a phone number). Is there a way to send a sms link that figures out it's being opened on an iphone, and sends the link to open the iphone version of the app? Perhaps there is a way to embed very simple logic into a hyperlink that changes based on what device it is? Is there any way to pull off something like this?
I realize I could send multiple links and have the user click the one that is appropriate, but that seems a little sloppy (especially as more platforms become available, it will be cumbersome to cram all the links into 1 SMS message for every device).
This is a difficult situation with no easy answer unfortunately.
Option A) You send a link that points to your server. This link identifies the device based on user agent and then forwards them to the proper sms: link for each platform.
Option B) If you know what type of device you are sending the link to beforehand, then you can determine the proper link on the server side before it is sent.

Sharing data between android users

I'm having trouble understanding the top level of abstraction of this problem.
The Problem:
Users A and B download application X. A wants to send application-specific data to B. How does user A link with B?
My incredibly messy solution:
- User A clicks a button on the application that opens up a list of contacts. user A selects user B from the list. User B's email address was stored in A's address book. Application creates a sort of "share ID" and sends it to user B via that email address. User B's application gets that ID from the mail, then User A and B use the share ID to connect to a server and share between each other via the sserver.
There must be a better way? The two problems are:
1. It shouldn't need a server (should it? could it be free?)
2. There must be better ways of the users connecting to each other than sending ID's or links etc by gmail.
This solution should be so so simple, but I can't get my head round it. If this question is not sufficient to get a good answer, please please tell me what I need to do to get into the way of thinking about how mobile users can interract with each other as simply as possible, with as few clicks as possible, (Mobile 2.0 or whatever the modern day thing is!)
For example: A mother and a child have an android smart phone. They each download the "ChildLeash" app. Child wishes to configure the app to send updates to Mother, so that Mother can keep track of Child's location and so on. The problem is some how Child needs to tell the app what location Mother is at for the data to be sent to. What is a user-friendly way for Child to Identify Mother's phone? (Mother's IP address? Phone number? Email address? OpenIDs? NFC/Bluetooth?) So that it can then communicate?
You could use push notifications, as provided by the Android Cloud to Device Messaging Framework. There's an Android blog post about this. Problem is, this seems beta and not yet available to all developers (you need a specific signup).
Regarding "IP Adresss", P2P and such, this generally won't work. See: Is peer-to-peer communication over 3G/4G possible for smart phones?
If messages are not urgent, then you could use AlarmManager to have your app wake up every hour or so, and check for new messages by connecting to a server. Not sure that would work for your "ChildLeash" example. Another similar solution would be to use a Service to poll the server.
Usually this sort of interaction would require a server. Which you've kind of faked using email as your medium.
It might be worth looking into peer to peer libraries such as JXTA. There's an android port here: http://code.google.com/p/peerdroid/
EDIT: I just came across this: http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html Which looks like exactly what you're after.

Categories

Resources