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 9040601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:01:50+00:00 2026-06-16T10:01:50+00:00

I have been trying to find some resources in order to build a Keylogger

  • 0

I have been trying to find some resources in order to build a Keylogger Android application for an accessibility research project on the Android platform (APILevel 17).

The Interface of the application would be a simple "EditText" field where the user types using the virtual onscreen keyboard [After selecting the required keyboard from the Input Settings].

I aim to create a Keylog database for my application (with an SQLite DB because I’m familiar with that, but a simple csv file DB would also work well! 🙂 ) which looks like the following:
enter image description here (Illustration)

Hence I need to log each character on a new entry as soon as it is typed, along with the timestamp.
I have been trying to expriment with the "TextWatcher" Class

    EditText KeyLogEditText = (EditText) findViewById(R.id.editTextforKeyLog);
    TextWatcher KeyLogTextWatcher = new TextWatcher() {
        
        @Override
        public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) 
        {   }
        
        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,int arg3) 
        {   }
        
        @Override
        public void afterTextChanged(Editable arg0) {
    // TODO Log the characters in the SQLite DB with a timeStamp etc.
    // Here I call my database each time and insert an entry in the database table. 
    //I am yet to figure out how to find the latest-typed-character by user in the EditText 
                            
        }

My Questions are:

  1. Is this the Right way of Implementing this?
  2. Can I obtain Exactly ONE character that is typed along with the time and insert it into the SQLite DB which I can later obtain and analyse??
  3. Or Would the onKeyUp Method be more useful? [I have not used tried method yet, So it would be great if someone could point me towards using this to build a keylogger if that’s simpler!]

*Thanks in Advance to anyone who can help me in any way!

Adit*

  • 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-16T10:01:51+00:00Added an answer on June 16, 2026 at 10:01 am

    For now your TextWatcher is not binded to EditText

    You should use addTextChangedListener(TextWatcher yourWatcher) on your EditText.
    Here is my example:

          smsET.addTextChangedListener(new TextWatcher() {
    
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            Log.d(TAG, "onTextChanged start :"+start +"  end :"+count);}
            public void beforeTextChanged(CharSequence s, int start, int count,int after) {
                Log.d(TAG, "beforeTextChanged start :"+start +"  after :"+after);
            }
    
            public void afterTextChanged(Editable s) {
                    int lastPosition = s.length()-1;
                char lastChar = s.charAt(lastPosition);
                Log.d(TAG, "afterTextChange last char"+lastChar );
            }
    
        });
    

    In your code it should be like this :

    KeyLogEditText.addTextChangeListener(KeyLogTextWatcher );
    

    Each of method included in this Watcher is triggerd by entering every single sign from keyboard.
    Since you get posistion after input you can easly get character that was entered

    To store data you mentioned, SharedPreferences will be faster than DB. (Many writes to DB) If your target is at least api 11 you can simply use StringSet Editor.putStringSet if your target is lower it is also possible, some example : http://androidcodemonkey.blogspot.com/2011/07/store-and-get-object-in-android-shared.html

    .

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

Sidebar

Related Questions

I have been trying to find some good sources on how to handle application-wide
I have been trying to find some resource on this topic for a while
I have been trying to find some step by step guidance on how to
I have been trying to find some documention on whether it's possible to run
I have been trying to find some more information about the next Microsoft Dynamics
I have been looking through trying to find some way to redirect to an
Good Evening, I have been trying to implement a simple Android(tm) application that utilizes
I have been trying to find an example some where on web on how
I have been trying to find if i can easily isolate and test azure
I have been trying to find ways to solve the problem. Firebug said syntax

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.