Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:53:37+00:00 2026-06-05T02:53:37+00:00

I got an android application that I would like to send its use log

  • 0

I got an android application that I would like to send its use log to my server so it would be saved in a database.

Basically I would like to log almost every action the user does, even a simple button click.

Since MQTT is already used in the application I thought maybe it would be good to use it for logging as well.

For example: every time I would like to log something, I would just publish the action through MQTT, then some server-
side service would subscribe to that logging channel, and each time a log publication would arrive, it would insert it to the DB.

However there are several things I’m worried about –

  1. I’d like to know if publishing a message of 30 characters each time the user does anything would be heavy on bandwidth.
  2. What would be the best solution for a service that would listen to that channel and insert each message into a DB.

Another option is to send the data through a regular REST method, though then I got 2 options, either send it in big bulks (I would have to know when is the right time to send it before the application closes) or send it in real-time when the logging action occurs.

Then I wouldn’t need a service that would subscribe to the MQTT logging channel.

And let’s assume that my server should be able to handle several thousands of users concurrently.

Any interesting thoughts?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:53:40+00:00Added an answer on June 5, 2026 at 2:53 am

    If you’re using MQTT already, it makes a lot of sense to use it for your logging. My quick calculation above of the bandwidth requirements show it’s unlikely to be a huge burden. The logging app would have to be able to deal with 2000 messages per second in my example. It would just be a simple MQTT client that also connected to whatever database you use. There is a trivial example for mysql at https://bitbucket.org/oojah/mosquitto/src/426b311d682d/examples/mysql_log/mysql_log.c

    Something that you probably do want to consider is the power usage of sending so many events. Stephen Nicholas has carried out two studies on Android looking at MQTT usage, first looking at straightforward MQTT usage in a number of scenarios ( http://stephendnicholas.com/archives/219 ) and second encrypted MQTT vs HTTPS ( http://stephendnicholas.com/archives/1217 ). The points you should consider are the battery cost to keep the connection active and the cost and speed of sending messages. Assuming one message per second, keepalive=240 seconds and that your user has an identical phone to Stephen, you’d consume about 3.1% battery life per hour over whatever else is happening on the phone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an IdeaPad A1-07 now and would like to debug an Android application.
I've got an android application that is supposed to read a mysql database from
I've got an android application that I'm attempting to use to pass some data
I got the Error message in Android below, it is send by PHP server
I am creating an android that acts as a media center. I would like
I would like to deploy an Android application internally in an organization. For the
Hey, I've got my database connection setup in an Android Application but LogCat keep's
I'm develloping an android application that has a local database which synchronizes whith an
I am making an android application where i got a set of strings that
I am developing an android application based on pdf reader so i got opensource

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.