ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalEC-333Getting Feedback
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    EC-333

    Mobile Application Development

    Progress0 / 33 done
    Topics33
    1Mobiles Application Development Platform2HTML5 for Mobiles
    3Architecture, Framework and Application Development
    4Architecture, Framework5Application Development with Windows Mobile6Eclipse7Fragments8Calling Built-in Applications using Intents9Displaying Notifications10Components of a Screen11Adapting to Display Orientation12Managing Changes to Screen Orientation13Utilizing the Action Bar14Creating the User Interface15Listening for UI Notifications16Views17User Preferences18Persisting & Sharing Data19Sending SMS Messages20Getting Feedback21Sending E-mail22Displaying Maps23Consuming Web Services Using HTTP
    24Accessing and Creating25Threading26Publishing Android Applications27Deployment on App Stores28Mobile Programming Languages29Challenges with Mobility and Wireless Communication30Location-aware Applications31Performance/Power Tradeoffs32Mobile Platform Constraints33Emerging Technologies
    7 min read
    Topic 20 of 33
    Topic Study Note Illustration
    20

    Getting Feedback

    Getting feedback from users is an essential part of creating an interactive and user-friendly Android application. Feedback can help improve the user experience, monitor app performance, and...

    Getting Feedback in Android

    Getting feedback from users is an essential part of creating an interactive and user-friendly Android application. Feedback can help improve the user experience, monitor app performance, and guide users in achieving their goals. Feedback can be collected in various ways in Android apps, including through visual cues, touch gestures, sound, and direct input from the user.

    There are different types of feedback you might consider providing to users, such as:

    1. Visual Feedback
    2. Audio Feedback
    3. Haptic Feedback
    4. User Input Feedback (Forms, Ratings, Surveys)
    5. Error and Success Messages

    Let's go through each one.


    1. Visual Feedback

    Visual feedback refers to providing information to users through graphical elements such as icons, text, or animation to indicate the status of an action. This kind of feedback helps users understand what's happening in the app without needing further explanation.

    A. Progress Indicators

    Progress indicators are used when an action takes time to complete. They can be either indeterminate (when the app doesn't know how long the process will take) or determinate (when the app knows the expected completion time).

    • ProgressBar (Determinate):
    ProgressBar progressBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
    progressBar.setMax(100);
    progressBar.setProgress(50);  // Update progress
    setContentView(progressBar);
    
    • ProgressBar (Indeterminate):
    ProgressBar progressBar = new ProgressBar(this);
    setContentView(progressBar);
    

    These visual indicators give users feedback that an operation is happening, and the progress or result will follow soon.

    B. Toast Messages

    Toast messages are simple notifications that appear briefly on the screen to give users feedback. These are commonly used for short notifications such as "Saved Successfully" or "Error".

    Toast.makeText(getApplicationContext(), "Data saved!", Toast.LENGTH_SHORT).show();
    

    C. Snackbar

    Snackbar is a more flexible version of a Toast and can be used for actions like undoing a recent change, confirming actions, or showing longer messages. Unlike Toast, Snackbar allows for user interaction.

    Snackbar.make(view, "Item deleted", Snackbar.LENGTH_LONG)
            .setAction("Undo", new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    // Handle the undo action
                }
            })
            .show();
    

    2. Audio Feedback

    Audio feedback provides an audible response to the user’s actions, such as a sound when a button is clicked or a notification is received. It's often used in situations where visual feedback may be less noticeable or when the app is running in the background.

    A. Playing a Sound

    To play a simple sound in response to user actions:

    MediaPlayer mediaPlayer = MediaPlayer.create(this, R.raw.sound_file);
    mediaPlayer.start();  // Play sound
    

    You can place sound files (like .mp3 or .ogg) in the res/raw directory.

    B. Vibration Feedback

    While vibration is not exactly audio, it’s another form of feedback that is often used in conjunction with audio. Vibration gives users physical feedback, for example, when a button is pressed.

    Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
    if (vibrator != null) {
        vibrator.vibrate(500);  // Vibrate for 500 milliseconds
    }
    

    Ensure you request the appropriate permissions in the manifest if your app uses vibration:

    <uses-permission android:name="android.permission.VIBRATE" />
    

    3. Haptic Feedback

    Haptic feedback provides physical sensations (like a vibration or touch feedback) to the user. It is often used to reinforce interactions, like button presses or touch gestures, and improve the user experience.

    A. Using Haptic Feedback for Button Presses

    You can trigger haptic feedback on touch interactions, for example, when the user clicks a button:

    Button button = findViewById(R.id.my_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            // Give haptic feedback when button is pressed
            v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
        }
    });
    

    This will produce a slight vibration when the user interacts with the button.


    4. User Input Feedback (Forms, Ratings, Surveys)

    User input feedback involves directly asking users for their opinion, typically through forms, surveys, or ratings. This kind of feedback is essential for understanding how users feel about the app and can guide future updates and improvements.

    A. User Rating Prompt

    A simple and effective way to gather user feedback is by asking users to rate your app. Android provides a built-in method to prompt users to rate your app directly in the Google Play Store.

    AppRate.with(this)
        .setInstallDays(0)  // Number of days after which the prompt is shown
        .setLaunchTimes(3)  // Number of times the app has been launched before showing the prompt
        .setRemindInterval(2)  // Interval (in days) to show the prompt again if declined
        .monitor();
    AppRate.showRateDialogIfNeeded(this);
    

    B. Feedback Form via Dialogs

    Another way to collect feedback is by using dialog boxes, where users can provide textual feedback. You can create a custom dialog to collect input:

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle("We value your feedback!")
           .setMessage("Please leave your comments.")
           .setView(inputField)  // EditText for feedback input
           .setPositiveButton("Submit", new DialogInterface.OnClickListener() {
               @Override
               public void onClick(DialogInterface dialog, int which) {
                   String feedback = inputField.getText().toString();
                   // Handle feedback submission (send to server or store locally)
               }
           })
           .setNegativeButton("Cancel", null)
           .show();
    

    This dialog can contain an EditText field for users to write their feedback, which you can then process and store or send to a server.

    C. Survey

    For more structured feedback, you can use tools like Google Forms or SurveyMonkey to create surveys and embed them in your app via an Intent to open a web browser.

    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.surveyformlink.com"));
    startActivity(intent);
    

    5. Error and Success Messages

    Feedback is crucial when something goes wrong or when an action is successfully completed. Error messages should be clear, actionable, and informative.

    A. Error Feedback

    When something goes wrong, it's important to provide clear feedback to the user:

    Toast.makeText(this, "Error: Unable to complete the action", Toast.LENGTH_SHORT).show();
    

    You can also use AlertDialog to show a more detailed error message:

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle("Error")
           .setMessage("Something went wrong. Please try again later.")
           .setPositiveButton("OK", null)
           .show();
    

    B. Success Feedback

    For successful actions, providing a Toast, Snackbar, or Dialog can be useful:

    Toast.makeText(this, "Action completed successfully!", Toast.LENGTH_SHORT).show();
    

    You can also use Snackbar for more interactive success messages:

    Snackbar.make(view, "Data saved successfully", Snackbar.LENGTH_LONG)
            .setAction("Undo", new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    // Undo the action
                }
            })
            .show();
    

    6. Conclusion

    Getting feedback in Android can be achieved through various methods such as visual feedback (using progress bars, Toast, or Snackbar), audio feedback (playing sounds), haptic feedback (vibrations), and direct user input (forms or surveys). Proper feedback not only enhances user experience but also helps guide users in their interactions with your app.

    By integrating feedback mechanisms into your app, you provide a more responsive, intuitive, and user-friendly experience that can also help you improve the app based on real user insights.

    ← Previous topic 19
    Sending SMS Messages
    Next topic 21 →
    Sending E-mail

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    7mremaining
    1.1kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Mobile Application Development