1 Star 1 Fork 0

MrShiehX / mschatroom

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

MSChatRoom (MSCR)

An Android chat application using MINA framework (communication) and MySQL database (account information storage) If you want to use the old version of this application, you need to download the source code of the target version, unzip it, and check its README file.

点我转到中文的README页面
Click me to go to the update log of this application

Copyright

MrShiehX own this application's copyright.
Anyone can take advices of this application to us.

Version

The latest version:
1.0 (Jan. 31, 2021)
Historical version:
1.0 (Jan. 31, 2021)
beta-2 (Jan. 26, 2021)
beta-1 (Jan. 21, 2021)
alpha-6 (Dec. 27, 2020)
alpha-5 (Dec. 26, 2020)
alpha-4 (Dec. 20, 2020)
alpha-3 (Dec. 17, 2020)
alpha-2 (Dec. 7, 2020)
alpha-1 (Dec. 5, 2020) (First version)

The software configuration required for this application is:

  • Android 4.0 and above

Supported languages

You can set the language in the settings.

  • English (United States)
  • Simplified Chinese (China)

Found BUGs

  • When chatting, you cannot send too much Chinese, otherwise, the other party will not receive it.
  • If the app is not running in the background, there will be not receive new message notifications.
  • If the app opens the Chat interface or the Main interface and then leaves the app (not exiting), you will not receive new messages notification.
  • (Fixed in alpha-6) Users can add chats without login.
  • (Fixed in beta-1) When adding a chat, if the current number of chats >= 2, it will replace the last one, but it has been added successfully. Restart the application to see the newly added chat.
  • (Fixed in beta-1) The application may crash after modifying the user information for unknown reasons.
  • (Fixed in alpha-3) After you login, open the settings, the user information (avatar, name and what's up) may not be displayed. This problem will be fixed in the future.

Precautions

  • If you want to add a chat, make sure that the target user and you are using the same encryption or decryption algorithm.
  • In order to avoid problems in the program, please do not bypass the Loading interface (LoadingScreen) and directly enter the application by other means.

Text encryption and decryption

Use the encryption or decryption algorithm of the src/java/com/mrshiehx/mschatroom/utils/EnDeCryptTextUtils.java class

Working Principle

Register

After encrypting the email address or account and password, use the insert command to create new data in the MySQL database.

Login

After encrypting the email address or account and password, use the select command to check whether the data exists in the MySQL database. If it exists, store the login data in SharedPreference.

Reset password

After encrypting the email address and password, check whether the account exists. If it exists, use the update command to modify the password data.

Login with email address

After encrypting the email address, use the select command in the MySQL database to check whether the data exists. If it does, the password is obtained and the login data is stored in SharedPreference.

Log out

Delete the email address or account and password data in SharedPreference.

Delete account

After encrypting the email address or account and password, use the delete command to delete the data in the MySQL database and log out.

Modify avatar

After encrypting the email address or account and password, select the file to be set as the avatar, and then use the update command to update the InputStream.

Modify nickname, gender or what's up

After encrypting the email address or account and password, download the InputStream in the information from the database, modify its content, and then use the update command to update the InputStream.

Clear cache

Delete all files in the /data/data/com.mrshiehx.mschatroom/cache directory.

Clear application data

Delete all files in the /data/data/com.mrshiehx.mschatroom directory.

Ready to work

First of all, you need to have a server (if you don’t have one, you can use your local computer), and the MySQL database needs to be installed on this server. After you are ready, you need to create a new database in MySQL. "mscr" is the database name, you can change it.

create database mscr;

Then we enter the database.

use mscr;

After entering, create a new table in the following format Table description You can enter the following command to create a new table, where "users" is the name of the table.

create table `users` (`email` varchar(1000) not null,`account` varchar(1000) not null,`password` varchar(1000) not null,`information` mediumblob not null,`avatar` mediumblob,`messages` text(4294967295));

At this point, if everything goes well without errors, then you can proceed to the next step.

After setting up a server with MySQL, modify the variable content in the file Variables.java in the src/java/com/mrshiehx/mschatroom directory (representatives not listed in the table below do not need to be modified)

Variable name Meaning
DEFAULT_SERVER_ADDRESS Default server (or local computer) address
DEFAULT_SERVER_PORT Default server (or local computer) port (used for communication)
DEFAULT_DATABASE_NAME Default MySQL database name
DEFAULT_DATABASE_USER_NAME Default MySQL database account
DEFAULT_DATABASE_USER_PASSWORD Default MySQL database password
DEFAULT_DATABASE_TABLE_NAME Default MySQL table name
TEXT_ENCRYPTION_KEY Text encryption key (not too long or too short)
CAPTCHA_EMAIL_SMTP_SERVER_ADDRESS The SMTP server address of the mailbox that sends the CAPTCHA email (see below)
CAPTCHA_EMAIL_ADDRESS The email address for sending the CAPTCHA email (see below)
AUTHENTICATOR Authorization code of the mailbox sending the verification code email (see below)

Regarding the e-mail address for sending the CAPTCHA, it is not provided here. You need to create an email address yourself, and then enable the IMAP/SMTP service and POP3/SMTP service of the mailbox, and write down the email address, authorization code and SMTP address of the email service , Input in Variables.java. You can also choose to modify the method content in the SendEmailUtils.java file in the src/java/com/mrshiehx/mschatroom/utils directory

The number of rows Method name Meaning
47 setSubject CAPTCHA email title
51 setContent CAPTCHA email content

For the application to use the chat communication function normally, you need to find the directory named server in the root directory of the source code, open it, find the server MSCRServer_1.0.jar file with the latest version 1.0, and use java -jar MSCRServer_1.0.jar command to run it, and then enter a port number you make sure that there is no occupied port number, press Enter, if there is no error, you have completed this step.

After all these tasks are completed, you can compile the application and run it.

About Author

MrShiehX

  • Occupation:
    Student
  • Email address:
    Bntoylort@outlook.com
  • QQ:
    3553413882 (Remember to tell me why you want to add me)

If you find any bugs in this application or have new ideas, please send an email or add my QQ.

Comments ( 0 )

Sign in for post a comment

About

一个使用 MINA 框架(通讯)和 MySQL数据库(账户信息存储)的 Android 聊天软件 spread retract
Java
GPL-3.0
Cancel

Releases (4)

All

Contributors

All

Activities

load more
can not load any more
Java
1
https://gitee.com/MrShiehX/mschatroom.git
git@gitee.com:MrShiehX/mschatroom.git
MrShiehX
mschatroom
mschatroom
master

Search