Quote request program that emails information entered by user - android

I have an Activity that has various EditText boxes and Spinners that the user will fill out in order to receive a quote. This application will be used by our outside sales team and the information will be emailed to our inside team to process the quote. What is the best way to capture the information from this Activity and email it?
The way I was going to do this was when the Process Button was clicked, it would take the data entered and just automatically populate that text in the email field. Is this the best way or should I look into forms?
Also I have considered adding a feature that requires certain fields to have information and if they do not, you will not be able to proceed to submit the quote. What is the best way to accomplish this?
Lastly, One of the textboxes require the outside salesperson to enter a "quote due by" date. Is it possible to use a calendar feature to do this so when you click Process and the quote is sent to the inside team, it will be added to a calender or something that can be viewed by both parties to help keep track of pending quotes?

I wouldn't email through the app; instead, I would take all their data, send it in a POST request to a PHP server, and then handle it from there. You could either save it in a database your sales reps can access or immediately email the data to them through there. This way you can avoid all the nasty email authentication you'd have to do to keep it in-app, and this way you also don't need to pass the data to an email intent and have them manually send it.
Here's a good SO answer on using HttpPost requests within Android: https://stackoverflow.com/a/4544026/1426565

Related

How to Send a text message from the data input on the text view fields?

I am using android studio. I made an application that allows the user to input data in different activities. The goal of the app is that what the user inputs will somehow be retrieved back to me by text message. I was wondering if there was a way to store the information input on the textfields (perhaps using a variable) and then send the variables to my phone as a text message for me to be able to see what was input on them. I’m not sure if this has been done before but I really need help with it. Thanks.
I think, this can be achieved by using the backend services. Whatever user inputs will be stored on database or somewhere using the backend services and retrieve that data using the sms service from backend system to the specific number or phone.

Advice on direction for an Android App to receive data from other devices

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.

Android transfer object data through different device, same app

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?

Send an email with a link (HTML) to open a specific application on the mobile phone

Background
I'm planning to implement a password reset function in my application. After some research, I've evaluated this approach to fit my needs:
User enters a "Reset Password" Activity where he enters a pre-registered email to be send a reset link.
The system has a table password_change_requests with the columns ID, Time and UserID. When the user presses the "send" button to reset the password, a record is created in the table. The Time column contains the time when the user pressed the "Forgot Password" button. The ID is a string. A long random string is created and then hashed like a password. This hash is then used as the 'ID' in the table.
The system sends an email to the user which contains a link in it. The link also contains the original ID string (before the hashing).
When the user clicks the link in the email, he is moved to the application in question. The app retrieves the ID from the URL, hashes it again, and checks against the table. If such a record is there and is no more than, say, 24 hours old, the user is presented with the prompt to enter a new password.
The user enters a new password, hits OK.
This approach was inspired by the answer to this question by Vilx-.
The difficulties
At first glance, the above presented approach seemed to be easy enough to implement. But I've ran into some headaches. Step (1) and (2) are easily implemented. When I had a closer look step (3) and (4) my initial thought was to send some kind of Intent with the email, since that's the usual way to launch applications. But since the "source" of the intent would be HTML code at best, I'm not quite sure if that will work.
Questions
How can I launch my specific android application from an email (say an HTML anchor tag) in the users inbox?
How do I pass on the data (the ID string) to my application via the email?
And if this is not possible, is there an alternative way to solve the above approach?
How can I launch my specific android application from an email (say an HTML anchor tag) in the users inbox?
There is no guaranteed way to do this. Email applications are not obligated to pay a lick of attention to you.
You are welcome to have an activity in your app, with an <intent-filter> that advertises that you wish to respond to certain URLs or URL prefixes, such as http://marcussystem.com/hey/lets/run/the/app. In theory, when the user clicks on a link in an email that points to a matching URL, your app will be included in the chooser (along with Web browsers) for the user to select.
Or, you are welcome to craft a URL using the intent scheme that opens one of your activities. The email client may not recognize that as a valid URL, but it would bypass the chooser.
But, again, there is no requirement for any email client to support what you want. This goes double for users who happen to view their email in a mobile Web browser.
How do I pass on the data (the ID string) to my application via the email?
In the http URL case, have it be part of the URL itself, preferably in the path: http://marcussystem.com/hey/lets/run/the/app/and/here/is/the/ID/..., where ... is your ID (assuming that it is purely URL path-friendly characters).

How would I go about creating a login

The set-up:
I have an android application that so far can register a user by inserting values into a remote mysql database. I'm now trying to implement the log in.
I was thinking that I can add a "logged in" column to the user table in the database that would store whether or not the user was logged in. Then I would have a trigger that would log the user off after a certain amount of time has been elapsed.
The application's use is to retrieve files based upon if the user has access to a certain file. For this I have an "access" column in the user table table specifying the access a user has to a certain file. I was thinking that when a user clicks an item in a list the application would send their login information and the server would determine if the information was correct then check to see if they had access to the specified file then send back the file if the information is correct.
The problem I'm having though is that checking the registration information takes about 2 seconds alone(due to connecting to the socket and sending a string over the network) and if I try to check both the login and the access id it would take slightly longer.
I feel as if I'm trying to reinvent the wheel but I can't find any viable resources on this matter. Criticisms? Suggestions?
(I wouldn't mind doing a complete redesign I just need to know where to start)
Never connect a client to a db-server. There's no way to intercept hacking attempts, because privileges are very basic (SELECT, UPDATE, etc., they ignore the query):
UPDATE users SET name='%s' WHERE userID=%i // where %i will be defined as the real userID
Above should be a valid query to update the user's account-information, however, a hacker can easily intercept this and change it into:
UPDATE users SET name='%s' WHERE userID=15 // ... or any other variable
Instead, you should create a web based API which will validate each query, or better, support only specific API-commands:
account/update.json?name=%s

Categories

Resources