I would like to share data between two users in my app. Generally, users are registered in the app and the storage of their data is done via Firestore. To access the data I use the UID of the user on the one hand and an id for the corresponding document inside a collection to be accessed on the other.
I am now looking for a way to share some selected data of a user with other users. The data is to be shared via WhatsApp, Email, etc., for example. These are the ways I have thought of so far:
The DataClass with all the stored data is packaged as an app-specific file and sent between the users.
or
The UID of the user and the id of the corresponding document inside the collection are sent. Using these two pieces of information, I can access the data from the user who is to receive the data via Firestore and save it on his or her device.
In general, my data sets are not particularly large. Now to my question:
Which of the two ways seems to make more sense and, above all, how can I implement this or which other sites could help me?
I've tried a few things with FileProvider so far, but haven't really got anywhere. It would be important that the user in question receives a message via e.g. WhatsApp, email, etc., can open my app via this, and the processing of the data for the user begins. Basically, I need to start an intent from the message the user receives with some extra data. How can I achieve that?
If you need any further information, please just let me know. Many thanks in advance!
You might want to have a look at Firebase Dynamic Links, which:
If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app.
Related
For this question, I am not looking for specific answers, or code or anything, but moreso suggestions on what techniques to employ to accomplish my goal.
I am very new to Android development. I have a bit of a background in Java.
The App I'm looking to build would have two types of users. The Narrator and the Participant.
The Participants would fill out a few fields, and click a button. This data would be integer and string values. Nothing terribly complex. The participants don't really need any sort of feedback beyond success or failure.
The Narrator's app would receive this information, and build a list displaying the information the Participants sent. Possibly the Narrator is able to send a message to the Participant devices prompting them to fill out and send their inputs, but not necessary.
What I am looking for is direction on which sorts of methods or techniques to accomplish this. It could be accomplished over Bluetooth, but even accomplishing it over the internet is arguably better.
It would need to be able to generate a unique session that users can locate and "connect to", as well.
If there are other questions that have info that would help me, feel free to link them. I assume there are. The rub is that I wasn't exactly sure how to ask this question with enough brevity to yield useful search results.
Thanks very much.
Look at realtime cloud db solutions to create the realtime, connect to session that you want to create.
In your app create a registration activity where the user can register as a participant or narrator. Store the user details on the cloud once register with a usertype key under your user model/map.
For example to define a value to usertype use like this.
usertype = 0 for participant
usertype = 1 for narrator
For your main activity you can create 2 layouts:
Layout1 (participant)
Layout2(narrator)
When user login you read the usertype value and assign layout in the oncreate method.
Example
if(usertype==0){
setContentView(Layout1)}
Within the layouts you will add your edittexts, views and buttons as per required for narrators and participants.
You will also write your functions for narrator in its own class/void and the same for participant.
Then use the usertype value to access the defined classes/voids.
You can have a look at firebase as a realtime database or there are plenty other options.
Happy coding.
So according to your explanation, participants will send something to other users which are Narrator. So something like chat system. In that case, you can use Firebase Realtime database. First, see how Firebase real-time database works. You can check this to get an idea.
So when participants fill up something it must receive by the narrator. When participants submit something you just need to send a push notification to all participants. So when participants click on the notifications you will redirect him to a specific activity and can load the participant's submitted form in that.
I wish to customise Views to target different types of people.
How do I identify a user without a) any input from them or b) caching data on their device c) using cookies or storing anything on the device.
I want to save the person identifier in a database table called "likes", to which I'll log views, time spent viewing articles etc.
In the database without them having to register and on future refreshes, use that data in order to display content tailored for them.
I don't need it to be 100% accurate, and if people are going to make the effort to fool the system then I'm happy to let them, because I don't handle any sensitive data.
So knowing this, what are the key identifiers for users available to my website?
I envisage my site/service being loaded via Android/iOS app or mobile/desktop browser.
Once identified, I wish to save data about them for showing articles/content both now and in the future.
I want to implement a feature in an app where users can add friends and check and compare each other stats from the java objects created, which involves a few subclasses.
I was wondering if anyone know what the best way to approach this would be?
The only thing that pops out is using Firebase. Where the user would click a button to upload the data to Firebase with a UUID link, and then give the UUID to the other user, where he/she would have to manually type the UUID in a textfield, and it gets the data from Firebase.
Would method be viable and is there any other better options?
Thanks
I would probably create a file (you can invent any ending) with all info you need displayed in json. That file can be shared via Whatsapp or what ever and imported in your app?
But I don't know what "stats" that are that the users can compare but I think they will change from time to time? So I would guess an online service would be better because otherwise to update, they have to share again and again?
I am currently using api.ai , to create agent to perform specific tasks, but one question i don't have answer to is , can i make it learn something while chatting , mean that i speak my name is 'John Cena' and she should store it and then whenever i ask her again bot should answer me that. i know there is a way to do it by logging into api.ai web and manually add entries , but it will not help, is there any work around programmatically or automatically ? the file i've been using to practice is given in github . and here is working DEMO
You basically need for your bot to "learn" facts. There are many different ways to achieve this, but recently the most common way is to arrange knowledge into Semantic "Triples" and store the knowledge into a Graph repository (like Neo4j, Titan, Spark Graph, etc). In your example, "my name is John Cena" would translate into a Triple like ("anubava","Name","John Cena"). That way, the next time you are logged in as anubhava and ask "What is my name?", it would translate into a Graph search that will return "John Cena". A word of caution, achieving this is not trivial and would require some significant amount of fine tuning. For more info, you can check here and here.
Finally, most complete solutions (that I know of), are Server Side solutions. If you want for the whole knowledge base to reside in your mobile device, you could probably use the resources there as inspiration, and build your own Linked Data repository using an embedded database.
Hope this helps. Good luck.
To store and recall the user's name, you'll need to set up a webhook with some basic data persistence capabilities. Any database or key-value store would work fine.
Here's the breakdown:
Implement webhook fulfillment for the intent that captures the user's name. The webhook should store the name along with a unique, identifying ID that you should supply from your front-end in either the sessionId or as a context parameter in your call to /query.
Implement webhook fulfillment for the intent that reads the user's name. The webhook should look up the name by ID and return a response that tells the user their name.
The high-level docs for writing a fulfillment webhook are here:
https://docs.api.ai/docs/webhook
I'm looking to set up a remote database for user data for an Android application I am developing, but I don't want to use a server to handle the queries. Instead, I am looking to see if there is a way to make either the database recieve or the app only send parts of a generated code for each user.
This is my thought process on how it would work:
User opens app for first time ->
app generates and stores on device specific code for user and visible to user->
example of User Code: MG0CG094CF08352FBZS3042C0890432 ->
when user inputs data on app ->
data stored on device and sent to database when connection available ->
database receives only M0045328 for user identification for data input
The idea would be registration with the database without having to handle emails, passwords, etc., just the 8 digit user identification code. The purpose of the 32 character app generated code would be for security and the user in the event they they get a new device or delete the app.
The security measure I'm thinking of instead of a server is for the database to only handle certain characters of the user code or for the app to only send certain characters.
User sees this in app: MG0CG094CF08352FBZS3042C0890432
Application only sends: Mx0xx0x4xxxxx5xxxxx3xx2xxx8xxxxx
Database reads: M0045328
Obviously I don't want it to read like that in the source, so I need some discrete way for the app to exclude characters when sending information. Problem is that I can't think of some way that it's possible to code it like that. I essentially want the app to encrypt itself and only decrypt when it's sending information. I obviously also don't want each code to decrypt the same way, so maybe the 32 character code could also include which characters to send?
Anyone have some idea about how to do this or would simply a server solution be easier? Keep in mind I would prefer for it to handle it this way more than to use a server.
For all your pseudo code, in the end you are trying to achieve a DRM structure. DRM is not feasible for devices that you have no control over. So you can only obfuscate things a bit. Trying to hide code is not likely to work; it's better to try and hide some kind of data to make that more difficult to find.