Android e-book reader applet (txt)

Android e-book reader applet (txt)

Development environment

JDK 1.8
operating system Windows×32-bit or 64-bit

Feasibility Analysis

Technical feasibility: This project applies all the content learned in class.
Software feasibility: You can use the programming software you usually learn.
Legal feasibility: All the technology and data of this project are in compliance with laws and regulations.

demand analysis

The Android system has become the mainstream mobile phone operating system, which can provide users with a good mobile Internet experience. Nowadays, more and more people are reading books through electronic devices. Mobile phone reading software should give users a very natural and user-friendly operating experience, such as the flipping effect of reading paper books. This software can be installed and run on Android smart phones to read txt e-books.

system design

1.功能设计
The software is simple to operate and easy to master. Click the enter button to enter the main page, then select the novel you want to read, and then select the chapter you want to read, and then you can start reading.

2.数据库设计
This novel has a simple structure and does not use a complex database. It just uses various knowledge points taught by the teacher in class, and selects some of them.

System implementation

涉及知识点
Intent and IntentFilter communication, various UI layouts, Android event mechanism
系统运行
Insert picture description here
Insert picture description here

Source program list

// An highlighted block

package simplepack.text;



import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.content.Intent; 
import android.view.View;
import android.widget.ImageButton;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;

public class MiniReader extends Activity {
    
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    
    
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ImageButton LoginButn=(ImageButton) findViewById(R.id.ImageButton01);
        
        //LoginButn.setWidth(320);     
         
        
    	/* 监听button的事件信息 */ 
        LoginButn.setOnClickListener(new Button.OnClickListener() {
    
    
			public void onClick(View v)
			{
    
    
				
				/* 新建一个Intent对象 */
				Intent intent = new Intent();
				/* 指定intent要启动的类 */
				intent.setClass(MiniReader.this, NovelMenu.class);
				/* 启动一个新的Activity */
				startActivity(intent);
				/* 关闭当前的Activity */
				MiniReader.this.finish();
				
			}
		});
    }
    /*创建menu*/
	public boolean onCreateOptionsMenu(Menu menu)
	{
    
    
		MenuInflater inflater = getMenuInflater();
		//设置menu界面为res/menu/menu.xml
		inflater.inflate(R.layout.menu, menu);
		return true;
	}

	/*处理菜单事件*/
	public boolean onOptionsItemSelected(MenuItem item)
	{
    
    
		//得到当前选中的MenuItem的ID,
		int item_id = item.getItemId(); 

		switch (item_id)
		{
    
    
			case R.id.about:
				/* 新建一个Intent对象 */
				Intent intent = new Intent();
				/* 指定intent要启动的类 */
				intent.setClass(MiniReader.this, AboutUs.class);
				/* 启动一个新的Activity */
				startActivity(intent);
				/* 关闭当前的Activity */
				MiniReader.this.finish();
				break;
			case R.id.exit:
				
				Dialog dialog = new AlertDialog.Builder(MiniReader.this)
				.setTitle("退出提示")
				.setMessage("你真的要退出吗!")//设置内容
				.setPositiveButton("确定",
			      new DialogInterface.OnClickListener() 
				   {
    
    
					  public void onClick(DialogInterface dialog, int whichButton)
					 {
    
    //设置确定按钮
						  MiniReader.this.finish();
					 }
				   })
				   .setNeutralButton("取消",  
			      new DialogInterface.OnClickListener() 
			       {
    
    
			          public void onClick(DialogInterface dialog, int whichButton)
			          {
    
    
				        //点击"退出"按钮之后推出程序
			        	  dialog.dismiss();
			          }
		          }).create();//创建按钮

		         // 显示对话框
		           dialog.show();
				  break;
		}
		return true;
	}
}

Design summary

Novel is so happy

Guess you like

Origin blog.csdn.net/qq_43218276/article/details/106223328