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
MrShiehX own this application's copyright.
Anyone can take advices of this application to us.
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)
You can set the language in the settings.
Use the encryption or decryption algorithm of the src/java/com/mrshiehx/mschatroom/utils/EnDeCryptTextUtils.java
class
After encrypting the email address or account and password, use the insert
command to create new data in the MySQL database.
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.
After encrypting the email address and password, check whether the account exists. If it exists, use the update
command to modify the password data.
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.
Delete the email address or account and password data in SharedPreference.
After encrypting the email address or account and password, use the delete
command to delete the data in the MySQL database and log out.
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.
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.
Delete all files in the /data/data/com.mrshiehx.mschatroom/cache
directory.
Delete all files in the /data/data/com.mrshiehx.mschatroom
directory.
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
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.
MrShiehX
Sign in for post a comment
Comments ( 0 )