Website shows data from Android App - Like WhatsApp Web - android

Does anyone know how WhatsApp Web have done this?
They show the messages/data from the Android phone connected to the Internet.
So it seems there is no database on the server site. They get all messages directly from the mobile app and sends also the changes directly.
How can this be done?
With Firebase or any other Library?

WhatsApp created an API which is used both for mobile and web end to communicate to each other and to the main database where all the messages and user information are stored.
The fact that your phone needs to be turned on and have internet connection still doesn't really show that the website pulls the information out of the phone itself.
What it is happening, more likely, is that the web extension communicates with the mobile phone linked to it to make sure that the account is still active on the mobile device and then proceeds to pull messages and information out of the database using the API.
I'm not excluding that the web extension retrieves some information form the device but it probably constantly keeps in sync with it to make sure the account is still active and there is no ambiguity between the account on the web extension and the account currently logged in to the mobile device.
Hope this clarifies a bit but there's no public documentation that I could find online so I'm going by what I believe is the most likely scenario.
:)
P.S. You can have a look here if you haven't already tried:
WhatApp website FAQ

Related

How to send data from webpage to native app on mobile device, both Android and iOS?

The scenario is, a user is visiting my webpage, click the download button to download my apk package (on Android) or go to App Store (on iOS). Then install the app and open it.
What I want to do is, when the user visits my webpage, I store some data to somewhere, and when the app is installed and opened, it can somehow read the the data (so the custom url scheme doesn't work in this situation).
For example, the user is reading an article on my webpage and then he finds out that we have an native app. So he downloads the app and installs it. We hope that when he opens the app, it could automatically display the article he was just reading. Therefore, the native app needs to know the article id from the webpage.
Now I can think of two solutions to do this but have some difficulty to overcome:
When the user visits my webpage, I copy the data to system clipboard using document.execCommand('copy') and then in my app, I acquire the data from system clipboard. While, as you may know, this API are badly supported on mobile browsers due to security reasons.
Use remote server as media. Webpage sends data to the server and app fetches it. But the data is device sensitive, and I can't think of what can be used as a unique identifier for a device. Because all webpage can obtain is some navigator.userAgent information.
So, is there someone that can help me out here and find a perfect way to send the data from webpage to native app. I would be very grateful!
I think the best option you have is to :
-Store the data in a table
-Create a php page that will do the query to get the data
-Do a http query from you android/ios app to this php page, you've your data !

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.

how can i locate an android device with a website and communicate with an application installed on it

android is able to locate devices and then communicate and update these device. That is the basis behind what i want to achieve. I have created a Content Management System which is a webpage that requires login details. This CMS will contain a record of all my android devices, the users of these devices and all the applications available for these devices. The CMS was constructed using html and it also uses javascript, php and mysql. each android device will have one of my applications installed on it and will be a wifi only enabled device(so that is how it will communicate with the world).
the scenario is, a device stored on my cms will be used by a user in london and they will be able to access the internet via wifi.I want to send a notification to the device using the cms and my location is . I am logged on to my cms in Scotland.
1, What sort of code or software or technique can i implement into my cms(html code, php code, javascript code) and my android devices and or android applications(java code) that will allow me to send a notification from my cms webpage to my application?
2, how can i make sure it is sent to the right device and the right application on that devices? (i.e if i want to contact someone who has a mobile phone i use their phone number, in this case device does not have a sim card and can only connect to wifi.)
please provide me with a clear answer with links on how to achieve this and excuse my ignorance if the answer is straight forward i am new to this.
again just to make it clear i want to send notifications from my cms webpage to a specific application that i have made in android using eclipse and java on a specific android device whos only connection to the internet is via wifi.
thank you
I think Google Cloud Messaging is appropriate for your problem.
Here is the link: http://developer.android.com/google/gcm/index.html

Android App With Server Interaction

I am trying to write an app that will have a web interface for business owners who can select a specific Android mobile app user via querying a database and then have either the website or database(a little unsure about how this would work) push information to the queried user's phone to create a notification for them via the app.
I have never created an app like this and the connection between the website, the database, and the mobile app on a user's phone are all a mystery to me. I've searched the Android developer website and cannot find anything that will accurately explain how to do this, and have also Google'd the topic without much luck.
All I ask is for someone to point me in the right direction to place the pieces together, any information you can provide would be greatly appreciated, thanks!
Your solution will almost certainly involve Google Cloud Messaging.
Implementing GCM will involve a server in which all devices are registered with a central service. So you are half way there once you have GCM implemented. Well perhaps more so, almost everything you mentioned is basically just GCM.
http://developer.android.com/guide/google/gcm/index.html
For this you can use PHP programming to interact with the website.
Refer Android App interaction with Web
and also
Android App Development and Web Server Interactions
These links will be useful.Good luck..

What does it take to sync a contact/calendars web app with mobile devices?

I have been developing a web application in PHP that provides contact and calendar management. This application needs to sync its contact and calendar data with mobile devices (specifically Android, Apple, and Windows phones).
I have no experience in mobile development, so I am mostly looking for guidance. It is difficult to know what to even search for because of this lack of experience. I am mostly looking to know what is possible and what is not.
The overall goal is to be able to edit contact/calendar data from anywhere, whether that be from the web application itself or a mobile device. These changes will then be reflected no matter what tool you are using to view it. A very loose comparison is an IMAP server. One central data source where any app can hop in and view/manage e-mails.
My web application can currently handle HTTP requests using XML data. So it can send out data and have data POSTed into it.
This is where my knowledge ends. I have little insight as to what would be required of the device itself to be able to sync. If a user adds contacts to a mobile device's default contact/calendar application, how can it be told to sync with my web application? Does this mean developing an app for each mobile device in order to act as a medium between my application and the mobile device's default contact/calendar data?
Is it possible to access the internal contact/calendar data of a mobile device? Can that data be pushed to an external server or be modified by that same server? What is required on the web application's side? The mobile device's side?
These are the sort of questions I am looking to be answered. There might be questions that I haven't even thought of that I would also love to be discussed. If my question is too general, please specify anything to be clarified.
In case of iphone you have to write your own app. I would recommend to use a database (sql) on your server, then every time the application opens you can check if there are new entries on the server and load them if needed.
I think it will take you some time to get the basic knowledge about ios programming but it isn't a hard job at all.
Things you should check:
requests
uitableview(/delegate)
Event kit
There are good tutorials to learn this stuff.
One good site:
http://www.raywenderlich.com/

Categories

Resources