Talking with App between Multiple Devices - android

I am developing an app which can be used for sharing location between 2 or more devices. One can be a publisher and other can be a subscriber. I got the first part done where I have an app which can read current lat-long from the device.
The second part is to publish it a repository (which is accessible on the internet to other devices also) so that other devices which subscribed to feeds of this device, will get such values and then render location on their devices. i.e. Bus Sending it location and people can subscribe to it to check when it will come near their home so that they leave office to reach bus stop just before 5 mins left for the bus to arrive at their stops.
I am looking where can be the best place to put such date where many devices can read and write (kind of online cache) for my application.

Maybe something like Firebase Realtime Database. Google Cloud Storage is not a good backend for something like this since it doesn't provide synchronization, and it would be hard to separate and authorize access to this privacy sensitive data.

Related

Position information transmission from one device to the other

I need to transmit GPS position information from one device to another but passing through my database to store the information. Something like Uber does when they show you the position of a vehicle. I was wondering what the best means of doing this would be in Android. I was thinking about firebase to transmit notifications and use the payload to transmit this data but I am not sure if this is the correct way of doing it. I see there is also a real time database in firebase which syncs information across all connected devices. Could this be a solution?
Firebase will do the job. Connect two apps to firebase project - from app A write location, from app B red location with onChildChange listener.

Is there an Apple Visits Location Service equivalent?

I'm looking to create an app for Android that checks a users location history to draw some conclusions of their daily life and identify behavioural patterns.
The Visits Location Service for IOS seems perfect for this kind of work as it logs location history separately, and then allows apps to access that data, but I'm struggling to find an equivalent for Android. I've looked into different Google API's, but nothing seems to fit the description very well - ideally, I could use the data already gathered by Google Timeline in order to avoid having the application active all the time, but so far I haven't found any way to access that data.
So, is there any equivalent for Android?

dataserver design based on firebase for Mobile Apps

I'm considering using Firebase as the main database for mobile based social network including only mobile clients (android, iOS).
In the scenario of social network where each user is exposed to only limited amount of data within its friend circle Firebase actually works quite well. However I have certain concerns I wan't to clear up before any heavy lifting starts.
I have the messages and chat functionality where users can message to all his friends or selected friend group. Since each user have slightly different friend circle, the message (or notification with the reference) needs to go to each friend.
My concern is if the user has 500 friends this would within the app generate 500 push requests to firebase with 500 different urls.
Alternatively I could store the chat/message in one place however receiving the message would mean to scan 500 different urls (all friends) to get the latest messages in the phone. Either way I end up with the same.
Do I have to be worried about app performance?
My second thought was to build the proxyserver which would take care of pushing notifications to friends so the app would send only one request for the server to push the message to all friends individually. But this would add up extra development work thus the cost to the project.
The answer is to de-normalize your data and put messages in people's inbox at the time they are created. We built an app called Firefeed to showcase this approach: http://firefeed.io/.
The basic concept is to create several copies of a message at creation time and send a copy to each of the recipients "inbox". Of course, this means that a sender cannot edit or delete after it is sent, but this might be an acceptable trade-off in most cases. (Note: It is technically possible to edit/delete a message, but it's a very expensive operation since you'll have to traverse your entire network to find the copies).
There's more about how to de-normalize your data in this blog post: https://www.firebase.com/blog/2013-04-12-denormalizing-is-normal.html

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.

Options for Sharing Android App Data on Multiple Phones

I'm looking for suggestions for ways to share Android app data between phones running the same app. For example, lets say I have an app that stores a database of book reviews. If person A has a book review that person B doesn't have, what are the options for getting that information from person A's phone to person B's phone?
Currently, I'm aware of the following options:
- Upload data from person A's phone to a server, then download data from server to Person B's phone.
- Write code to have the phones sync up using bluetooth
- Write code to send SMS messages
I'm wondering if there are any more options besides these, and if there's actually a best-practice for accomplishing this?
Ideally, I want the users to simply click a button in the app to make the sharing take place, so I don't want to go down the bluetooth route because that requires the user to do a bit of setup (or assumes they already have set things up in the form of bluetooth settings).
Since the data can be of variable length and potentially large, I believe that would rule out text messaging.
As far as the server route goes, from what I understand this seems to be an ok way of doing things, but my problem is that I have no experience with having users potentially sign in to a server and then uploading data. I don't know of the cost concerns (if any), or of potential security concerns (allowing just anyone to upload data, I'm not sure if I would have to take steps to ensure someone couldn't bypass the app and upload malicious data).
So, can you guys give me suggestions and point me in the right direction? Thanks.
I'm wondering if there are any more options besides these
You could try generating a QR code and scanning it on the other phone. Beyond that, I think you have it mostly covered.
and if there's actually a best-practice for accomplishing this?
That is impossible to answer in the abstract.
Keep the database server side and interface with it via a web service
I too am looking for a solution to this very problem. I'll throw it out there that a fourth, or rather extension of your first option, is to use the Cloud to Device Messaging Framework, though it still requires (as best I can tell) having your own server, though I suppose you wouldn't need to store the database server-side longer than it takes to send the message, provided you keep it under 1024b (or whatever the actual size is).
I don't believe there is a convenient way to monitor/send email in the background. If I could have my app monitor email messages looking for a key subject, then parsing the body, I could probably accomplish what I'm looking for using email as the transport.
The problem with maintaining a server, is that you probably would need to build in a subscription fee to your app to cover the costs of maintaining a server, as one time sales may not be able to cover the ongoing expense.

Categories

Resources