(基于安卓app开发的毕业设计)代跑腿系统的设计与实现(论文+源码)

大家好!我是职场程序猿,感谢您阅读本文,欢迎一键三连哦。

💞当前专栏:安卓app毕业设计

精彩专栏推荐👇🏻👇🏻👇🏻

👉🎀 微信小程序毕业设计
👉🌎Java毕业设计

一、项目简介

论文主要是对基于移动端的延安大学代跑腿系统的开发与实现进行了介绍,包括研究的现状,还有涉及的开发背景,然后还对系统的设计目标进行了论述,还有系统的需求,以及整个的设计方案,对系统的设计以及实现,也都论述的比较细致,最后对基于移动端的延安大学代跑腿系统的开发与实现进行了一些具体测试。该系统主要以Android、java为开发技术,实现了一个基于移动端的延安大学代跑腿系统的开发与实现。该平台的主要使用者分为管理员和用户,用户端主要包括任务发布和任务接受两大模块,管理员端主要是对用户和发布的任务进行管理。通过这些功能模块的设计,基本上实现了整个代跑腿系统管理的过程。具体在系统设计上,采用了B/S的结构,后台基于JSP框架,前端通过Android技术进行实现,同时,也使用Android技术在动态页面上进行了设计,后台上采用Mysql数据库,是一个非常优秀的基于移动端的代跑腿系统的开发与实现。

二、系统核心功能模块部分截图

2.1客户端主题功能模块

用户可以通过填入账户名称、密码、电话、地址等信息进行注册,注册完成后可以通过账户、密码进行登录,如图5.1所示。

在这里插入图片描述
用户登陆之后之后,进入主界面,主要包括首页、畅所欲言、我的任务和我的等功能模块,首页包括任务列表,可以通过输入物品关键词检索,从而筛选能够未接单的代取订单。用户也可以填写相关的信息进行订单的发布,如图5.2所示。在这里插入图片描述
畅所欲言包括交友贴、发帖交流等内容,我的任务主要包括发布的任务订单和接收的任务订单。如图5-3所示。在这里插入图片描述
点击发布的订单可以通过位置跟踪,查看订单的详细位置信息。如图5-4所示。在这里插入图片描述

用户可以点击右上角,点击发布,进行订单任务的发布,通过填写相应的信息以及选择业务类型以进行发布。如图5-5所示。在这里插入图片描述
用户通过搜索框输入信息,进行订单的搜索,并通过接受按钮进行订单任务接受。如图5-6所示。在这里插入图片描述

2.4 用户后台功能模块

用户登录进入系统后台可以查看悬赏任务列表、类别列表、跑腿列表、评价列表、任务订单管理、发帖列表、通知列表、评分列表等功能模块。如图5-7所示。
在这里插入图片描述
并且可以进行相关信息的添加、更改、删除等操作,例如对于类别列表模块,添加类别的操作如图5-7所示。

在这里插入图片描述

三、部分核心代码

4.1 文件工具

package com.ideabobo.tool;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Environment;
import android.util.Log;

public class FileTool extends AsyncTask<String, Void, Integer>{
	private static final String COMMAND_BACKUP = "backupDatabase";
    public static final String COMMAND_RESTORE = "restroeDatabase";
    private Context mContext;

    public FileTool(Context context) {
        this.mContext = context;
    }

    @Override
    public Integer doInBackground(String... params) {
        // TODO Auto-generated method stub
    	// 获得正在使用的数据库路径,我的是 sdcard 目录下的 /dlion/db_dlion.db
    	 // 默认路径是 /data/data/(包名)/databases/*.db
//        File dbFile = mContext.getDatabasePath(Environment
//                .getExternalStorageDirectory().getAbsolutePath()
//                + "/dlion/db_dlion.db");
        File dbFileDir = mContext.getDatabasePath("/data/data/com.ideabobo.gap/");
        File exportDir = new File(Environment.getExternalStorageDirectory(),
                "ideaback/");
        if (!exportDir.exists()) {
            exportDir.mkdirs();
        }
        String command = params[0];
        if (command.equals(COMMAND_BACKUP)) {
            try {
                copyDirectiory(dbFileDir.getAbsolutePath(), exportDir.getAbsolutePath());
                return Log.d("backup", "ok");
            } catch (Exception e) {
                // TODO: handle exception
                e.printStackTrace();
                return Log.d("backup", "fail");
            }
        } else if (command.equals(COMMAND_RESTORE)) {
            try {
            	copyDirectiory(exportDir.getAbsolutePath(), dbFileDir.getAbsolutePath());
                return Log.d("restore", "success");
            } catch (Exception e) {
                // TODO: handle exception
                e.printStackTrace();
                return Log.d("restore", "fail");
            }
        } else {
            return null;
        }
    }

    private void fileCopy(File dbFile, File backup) throws IOException {
        // TODO Auto-generated method stub
        FileChannel inChannel = new FileInputStream(dbFile).getChannel();
        FileChannel outChannel = new FileOutputStream(backup).getChannel();
        try {
            inChannel.transferTo(0, inChannel.size(), outChannel);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            if (inChannel != null) {
                inChannel.close();
            }
            if (outChannel != null) {
                outChannel.close();
            }
        }
    }
    
    // 复制文件夹
    public static void copyDirectiory(String sourceDir, String targetDir) throws IOException {
        // 新建目标目录
        (new File(targetDir)).mkdirs();
        // 获取源文件夹当前下的文件或目录
        File[] file = (new File(sourceDir)).listFiles();
        for (int i = 0; i < file.length; i++) {
            if (file[i].isFile()) {
                // 源文件
                File sourceFile = file[i];
                // 目标文件
                File targetFile = new File(new File(targetDir).getAbsolutePath() + File.separator + file[i].getName());
                copyFile(sourceFile, targetFile);
            }
            else if (file[i].isDirectory()) {
                // 准备复制的源文件夹
                String dir1 = sourceDir + "/" + file[i].getName();
                // 准备复制的目标文件夹
                String dir2 = targetDir + "/" + file[i].getName();
                copyDirectiory(dir1, dir2);
            }
        }
    }

    // 复制文件
    public static void copyFile(File sourceFile, File targetFile) throws IOException {
        BufferedInputStream inBuff = null;
        BufferedOutputStream outBuff = null;
        try {
            // 新建文件输入流并对它进行缓冲
            inBuff = new BufferedInputStream(new FileInputStream(sourceFile));

            // 新建文件输出流并对它进行缓冲
            outBuff = new BufferedOutputStream(new FileOutputStream(targetFile));

            // 缓冲数组
            byte[] b = new byte[1024 * 5];
            int len;
            while ((len = inBuff.read(b)) != -1) {
                outBuff.write(b, 0, len);
            }
            // 刷新此缓冲的输出流
            outBuff.flush();
        } finally {
            // 关闭流
            if (inBuff != null)
                inBuff.close();
            if (outBuff != null)
                outBuff.close();
        }
    }
    
    public static void delFolder(String folderPath) {
        try {
           delAllFile(folderPath); //删除完里面所有内容
           String filePath = folderPath;
           filePath = filePath.toString();
           java.io.File myFilePath = new java.io.File(filePath);
           myFilePath.delete(); //删除空文件夹
        } catch (Exception e) {
          e.printStackTrace(); 
        }
   }
   
  //删除指定文件夹下所有文件
   //param path 文件夹完整绝对路径
      public static boolean delAllFile(String path) {
          boolean flag = false;
          File file = new File(path);
          if (!file.exists()) {
            return flag;
          }
          if (!file.isDirectory()) {
            return flag;
          }
          String[] tempList = file.list();
          File temp = null;
          for (int i = 0; i < tempList.length; i++) {
             if (path.endsWith(File.separator)) {
                temp = new File(path + tempList[i]);
             } else {
                 temp = new File(path + File.separator + tempList[i]);
             }
             if (temp.isFile()) {
                temp.delete();
             }
             else if (temp.isDirectory()) {
                delAllFile(path + "/" + tempList[i]);//先删除文件夹里面的文件
                delFolder(path + "/" + tempList[i]);//再删除空文件夹
                flag = true;
             }
          }
          return flag;
        }
      
      public static String getSDPath(){ 
          File sdDir = null; 
          boolean sdCardExist = Environment.getExternalStorageState()   
                              .equals(android.os.Environment.MEDIA_MOUNTED);   //判断sd卡是否存在 
          if(sdCardExist){                               
            sdDir = Environment.getExternalStorageDirectory();//获取跟目录 
          }   
          return sdDir.toString();   
      }
      
      public static final String[][] MIME_MapTable={  
              //{后缀名, MIME类型}  
              {".3gp",    "video/3gpp"},  
              {".apk",    "application/vnd.android.package-archive"},  
              {".asf",    "video/x-ms-asf"},  
              {".avi",    "video/x-msvideo"},  
              {".bin",    "application/octet-stream"},  
              {".bmp",    "image/bmp"},  
              {".c",  "text/plain"},  
              {".class",  "application/octet-stream"},  
              {".conf",   "text/plain"},  
              {".cpp",    "text/plain"},  
              {".doc",    "application/msword"},  
              {".docx",   "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},  
              {".xls",    "application/vnd.ms-excel"},   
              {".xlsx",   "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},  
              {".exe",    "application/octet-stream"},  
              {".gif",    "image/gif"},  
              {".gtar",   "application/x-gtar"},  
              {".gz", "application/x-gzip"},  
              {".h",  "text/plain"},  
              {".htm",    "text/html"},  
              {".html",   "text/html"},  
              {".jar",    "application/java-archive"},  
              {".java",   "text/plain"},  
              {".jpeg",   "image/jpeg"},  
              {".jpg",    "image/jpeg"},  
              {".js", "application/x-javascript"},  
              {".log",    "text/plain"},  
              {".m3u",    "audio/x-mpegurl"},  
              {".m4a",    "audio/mp4a-latm"},  
              {".m4b",    "audio/mp4a-latm"},  
              {".m4p",    "audio/mp4a-latm"},  
              {".m4u",    "video/vnd.mpegurl"},  
              {".m4v",    "video/x-m4v"},   
              {".mov",    "video/quicktime"},  
              {".mp2",    "audio/x-mpeg"},  
              {".mp3",    "audio/x-mpeg"},  
              {".mp4",    "video/mp4"},  
              {".mpc",    "application/vnd.mpohun.certificate"},        
              {".mpe",    "video/mpeg"},    
              {".mpeg",   "video/mpeg"},    
              {".mpg",    "video/mpeg"},    
              {".mpg4",   "video/mp4"},     
              {".mpga",   "audio/mpeg"},  
              {".msg",    "application/vnd.ms-outlook"},  
              {".ogg",    "audio/ogg"},  
              {".pdf",    "application/pdf"},  
              {".png",    "image/png"},  
              {".pps",    "application/vnd.ms-powerpoint"},  
              {".ppt",    "application/vnd.ms-powerpoint"},  
              {".pptx",   "application/vnd.openxmlformats-officedocument.presentationml.presentation"},  
              {".prop",   "text/plain"},  
              {".rc", "text/plain"},  
              {".rmvb",   "audio/x-pn-realaudio"},  
              {".rtf",    "application/rtf"},  
              {".sh", "text/plain"},  
              {".tar",    "application/x-tar"},     
              {".tgz",    "application/x-compressed"},   
              {".txt",    "text/plain"},  
              {".wav",    "audio/x-wav"},  
              {".wma",    "audio/x-ms-wma"},  
              {".wmv",    "audio/x-ms-wmv"},  
              {".wps",    "application/vnd.ms-works"},  
              {".xml",    "text/plain"},  
              {".z",  "application/x-compress"},  
              {".zip",    "application/x-zip-compressed"},  
              {"",        "*/*"}    
          }; 
      
      /** 
       * 根据文件后缀名获得对应的MIME类型。 
       * @param file 
       */  
      public static String getMIMEType(File file) {  
            
          String type="*/*";  
          String fName = file.getName();  
          //获取后缀名前的分隔符"."在fName中的位置。  
          int dotIndex = fName.lastIndexOf(".");  
          if(dotIndex < 0){  
              return type;  
          }  
          /* 获取文件的后缀名 */  
          String end=fName.substring(dotIndex,fName.length()).toLowerCase();  
          if(end=="")return type;  
          //在MIME和文件类型的匹配表中找到对应的MIME类型。  
          for(int i=0;i<MIME_MapTable.length;i++){ //MIME_MapTable??在这里你一定有疑问,这个MIME_MapTable是什么?  
              if(end.equals(MIME_MapTable[i][0]))  
                  type = MIME_MapTable[i][1];  
          }         
          return type;  
      }
      
      public static Intent openFile(File file){  
          
    	    Intent intent = new Intent();  
    	    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
    	    //设置intent的Action属性  
    	    intent.setAction(Intent.ACTION_VIEW);  
    	    //获取文件file的MIME类型  
    	    String type = getMIMEType(file);  
    	    //设置intent的data和Type属性。  
    	    intent.setDataAndType(/*uri*/Uri.fromFile(file), type);  
    	    //跳转  
    	    return intent;  
    	      
    	}
      
      private void writeTxtToFile(String strcontent, String filePath, String fileName) {
          //生成文件夹之后,再生成文件,不然会出错
          makeFilePath(filePath, fileName);

          String strFilePath = filePath + fileName;
          // 每次写入时,都换行写
          String strContent = strcontent + "\r\n";
          try {
              File file = new File(strFilePath);
              if (!file.exists()) {
                  Log.d("TestFile", "Create the file:" + strFilePath);
                  file.getParentFile().mkdirs();
                  file.createNewFile();
              }
              RandomAccessFile raf = new RandomAccessFile(file, "rwd");
              raf.seek(file.length());
              raf.write(strContent.getBytes());
              raf.close();
          } catch (Exception e) {
              Log.e("TestFile", "Error on write File:" + e);
          }
      }
      private File makeFilePath(String filePath, String fileName) {
          File file = null;
          makeRootDirectory(filePath);
          try {
              file = new File(filePath + fileName);
              if (!file.exists()) {
                  file.createNewFile();
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
          return file;
      }

  //生成文件夹

      private static void makeRootDirectory(String filePath) {
          File file = null;
          try {
              file = new File(filePath);
              if (!file.exists()) {
                  file.mkdir();
              }
          } catch (Exception e) {
              Log.i("error:", e + "");
          }
      }
}




4.2command部分


package com.ideabobo.tool;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class Command {
	public static String exec(String[] args) {  
        String result = "";  
        ProcessBuilder processBuilder = new ProcessBuilder(args);  
        Process process = null;  
        InputStream errIs = null;  
        InputStream inIs = null;  
        try {  
            ByteArrayOutputStream baos = new ByteArrayOutputStream();  
            int read = -1;  
            process = processBuilder.start();  
            errIs = process.getErrorStream();  
            while ((read = errIs.read()) != -1) {  
                baos.write(read);  
            }  
            baos.write('\n');  
            inIs = process.getInputStream();  
            while ((read = inIs.read()) != -1) {  
                baos.write(read);  
            }  
            byte[] data = baos.toByteArray();  
            result = new String(data);  
        } catch (IOException e) {  
            e.printStackTrace();  
        } catch (Exception e) {  
            e.printStackTrace();  
        } finally {  
            try {  
                if (errIs != null) {  
                    errIs.close();  
                }  
                if (inIs != null) {  
                    inIs.close();  
                }  
            } catch (IOException e) {  
                e.printStackTrace();  
            }  
            if (process != null) {  
                process.destroy();  
            }  
        }  
        return result;  
    }  
}


四、论文目录

1 概述 1
1.1课题背景及意义 1
1.2 国内研究现状 2
1.3 本课题主要工作 3
2 系统开发环境 4
2.1 Android简介 4
2.2 Android系统架构 4
2.3 Android开发平台搭建 5
2.4 Android程序开发的基本组件 6
2.5 Android关键技术研究 7
2.6 JSP 技术简介 8
2.7 MySql数据库 9
3 系统分析 10
3.1 可行性分析 10
3.1.1 技术可行性 10
3.1.2操作可行性 10
3.1.3 经济可行性 11
3.1.4 法律可行性 11
3.2系统流程分析 11
3.2.1系统开发流程 11
3.2.2 用户登录流程 12
3.2.3 信息添加流程 12
3.2.4信息删除流程 13
4系统设计 14
4.1 系统概述 14
4.2 系统结构设计 14
4.3数据库设计 15
4.3.1 数据库实体 16
5统详细设计 17
5.1客户端主题功能模块 17
5.2用户后台功能模块 20
6系统测试 21
6.1系统测试的意义 21
6.2 测试方法 22
6.3测试分析 22
结 论 23
致 谢 24
参考文献 25

获取源码或论文

如嘘对应的源码,可以私wo

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值