android开发---简单购物商城(JAVA) (一)

包括:商品展示,商品详情,购物车,删除,一键清除,返回

运用sqllist

另外因为一篇写不下 继续可看     源码二

下面是目录

运行样子

下面是源码

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"><applicationandroid:name=".MyApplication"android:allowBackup="true"android:dataExtractionRules="@xml/data_extraction_rules"android:fullBackupContent="@xml/backup_rules"android:icon="@mipmap/ic"android:label="@string/app_name"android:roundIcon="@mipmap/ic"android:supportsRtl="true"android:theme="@style/Theme.Shop"tools:targetApi="31"><activityandroid:name=".ShoppingDetailActivity"android:exported="false" /><activityandroid:name=".ShoppingcartActivit"android:exported="false" /><activityandroid:name=".ShoppingChannelActivity"android:exported="true"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application></manifest>
/database/ShoppingDBHelper
package com.example.shop.database;import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;import com.example.shop.enity.CartInfo;
import com.example.shop.enity.GoodsInfo;import java.util.ArrayList;
import java.util.List;public class ShoppingDBHelper extends SQLiteOpenHelper {private static final String DB_NAME="shopping.db";public static final String TABLE_GOODS_INFO = "goods_info";public static final String TABLE_CART_INFO = "cart_info";public static final String CONTENT = "content";private static final String TAG="MyApplication";private static final int DB_VERSION=1;private static ShoppingDBHelper mHelper=null;private SQLiteDatabase mRDB=null;private SQLiteDatabase mWDB=null;public ShoppingDBHelper( Context context) {super(context, DB_NAME, null, DB_VERSION);}public static ShoppingDBHelper getInstance(Context context){if(mHelper==null)mHelper=new ShoppingDBHelper(context);return mHelper;}public SQLiteDatabase openReadLink(){if(mRDB==null||!mRDB.isOpen()){mRDB=mHelper.getReadableDatabase();}return mRDB;}public SQLiteDatabase openWriteLink(){if(mWDB==null||!mWDB.isOpen()){mWDB=mHelper.getWritableDatabase();}return mWDB;}public void closeLink(){if(mRDB!=null&&mRDB.isOpen()){mRDB.close();mRDB=null;}if(mWDB!=null&&mWDB.isOpen()){mWDB.close();mWDB=null;}}@Override//数据库第一次被创建时调用该方法public void onCreate(SQLiteDatabase db) {//初始化数据库的表结构,执行一条建表的SQL语句String sql ="create table if NOT EXISTS "+TABLE_GOODS_INFO+"(_id integer primary key autoincrement not null,"+"name varchar not null,"+"description varchar not null,"+"price float not null,"+"pic_path varchar not null);";db.execSQL(sql);sql ="create table if NOT EXISTS "+TABLE_CART_INFO+"(_id integer primary key autoincrement not null,"+"goods_id integer not null,"+"count integer not null);";db.execSQL(sql);}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {}public void insertGoodsInfos(List<GoodsInfo> list){//插入多条记录try {mWDB.beginTransaction();for(GoodsInfo info:list){ContentValues values=new ContentValues();values.put("name",info.name);values.put("description",info.description);values.put("price",info.price);values.put("pic_path",info.picPath);mWDB.insert(TABLE_GOODS_INFO,null,values);}mWDB.setTransactionSuccessful();} catch (Exception e){} finally {mWDB.endTransaction();}}//查询public List<GoodsInfo>queryAllGoodsInfo(){String sql="select * from "+TABLE_GOODS_INFO;List<GoodsInfo>list=new ArrayList<>();Cursor cursor= mRDB.rawQuery(sql,null);while (cursor.moveToNext()){GoodsInfo info=new GoodsInfo();info.id=cursor.getInt(0);info.name=cursor.getString(1);info.description=cursor.getString(2);info.price=cursor.getFloat(3);info.picPath=cursor.getString(4);list.add(info);}cursor.close();return list;}public void insertCartInfo(int gid) {//添加购物车//不存在CartInfo cartInfo=queryCartInfoByGoodsId(gid);ContentValues values=new ContentValues();values.put("goods_id",gid);if(cartInfo==null){values.put("count",1);mRDB.insert(TABLE_CART_INFO,null,values);}else{ //数量加一values.put("_id",cartInfo.id);values.put("count",++cartInfo.count);mWDB.update(TABLE_CART_INFO,values,"_id=?",new String[]{String.valueOf(cartInfo.id)});}}private CartInfo queryCartInfoByGoodsId(int gid) {//查询Cursor cursor=mRDB.query(TABLE_CART_INFO,null,"goods_id=?",new String[]{String.valueOf(gid)},null,null,null);CartInfo info=null;if(cursor.moveToNext()){info=new CartInfo();info.id=cursor.getInt(0);info.goodsid=cursor.getInt(1);info.count=cursor.getInt(2);}return info;}public int countCartInfo() {int count=0;// String sql="select sum(count) from"+TABLE_CART_INFO;// List<CartInfo>list=new ArrayList<>();//  Cursor cursor= mRDB.rawQuery(sql,null);//   count=cursor.getInt(0);
//
//       // Cursor cursor=mRDB.rawQuery(sql,null);
//        if(cursor.moveToNext()){//        count=cursor.getInt(0);//    Log.d(TAG,String.valueOf(count));
//        }return count;}public List<CartInfo> queryAllCartInfo() {//查询购物车信息List<CartInfo>list=new ArrayList<>();Cursor cursor=mRDB.query(TABLE_CART_INFO,null,null,null,null,null,null,null);while(cursor.moveToNext()){CartInfo info=new CartInfo();info.id=cursor.getInt(0);info.goodsid=cursor.getInt(1);info.count=cursor.getInt(2);list.add(info);}return list;}public GoodsInfo queryGoodsInfoById(int goodsid) {GoodsInfo info=null;Cursor cursor=mRDB.query(TABLE_GOODS_INFO,null,"_id=?",new String[]{String.valueOf(goodsid)},null,null,null);if(cursor.moveToNext()){info=new GoodsInfo();info.id=cursor.getInt(0);info.name=cursor.getString(1);info.description=cursor.getString(2);info.price=cursor.getFloat(3);info.picPath=cursor.getString(4);}return info;}public void deleteCartinfobygoodsid(int goodsid) {//delete onemWDB.delete(TABLE_CART_INFO,"goods_id=?",new String[]{String.valueOf(goodsid)});}public void deleteallcartinfo(){mWDB.delete(TABLE_CART_INFO,"1=1",null);//条件}
}
/enity/CartInfo 购物车数据
package com.example.shop.enity;public class CartInfo {public int id;public int count;public int goodsid;public CartInfo(){}public CartInfo(int id,int goodsid,int count){this.goodsid=goodsid;this.id=id;this.count=count;}
}
/enity/GoodsInfo 商品数据
package com.example.shop.enity;import com.example.shop.R;import java.util.ArrayList;public class GoodsInfo {public int id;public String name;public String description;public float price;public String picPath;public int pic;private static String[ ]mNameArray={"iPhone 11","mate 30","mi30","huawei 2","rongyao30s","vivo x30"};private static String[]mDescArray={"Apple iphone 256D|G","mate30 iphone 256D|G","mi30 iphone 256D|G","huawei 2 iphone 256D|G","rongyao30s iphone 256D|G","vivo x30 iphone 256D|G",};private static float[]mPriceArray={100,200,31,221,22,40};private static int[]mPicArray={R.drawable.no1,R.drawable.no2,R.drawable.no3,R.drawable.no4,R.drawable.no5,R.drawable.no6};public static ArrayList<GoodsInfo>getDefaultList(){ArrayList<GoodsInfo>goodsList=new ArrayList<>();for(int i=0;i<mNameArray.length;i++){GoodsInfo info=new GoodsInfo();info.id=i;info.name=mNameArray[i];info.description=mDescArray[i];info.price=  mPriceArray[i];info.pic=mPicArray[i];goodsList.add(info);}return goodsList;}
}
/util/FilUtil 读取数据库数据并显示
package com.example.shop.util;import android.graphics.Bitmap;import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;public class FilUtil {//保存public static void saveText(String path,String txt){BufferedWriter os=null;try{os=new BufferedWriter(new FileWriter(path));os.write(txt);}catch (Exception e){e.printStackTrace();}finally {if(os!=null){try{os.close();}catch (Exception e){e.printStackTrace();}}}}//读取public static String openText(String path){BufferedReader is=null;StringBuilder sb=new StringBuilder();try{is= new BufferedReader(new FileReader(path));String line=null;while((line=is.readLine())!=null){sb.append(line);}}catch (Exception e){e.printStackTrace();}finally {if(is!=null){try{is.close();}catch (Exception e){e.printStackTrace();}}}return path;}public static void saveImage(String path, Bitmap bitmap){FileOutputStream fos=null;try{fos=new FileOutputStream(path);bitmap.compress(Bitmap.CompressFormat.JPEG,100,fos);}catch (Exception e){e.printStackTrace();}finally {if(fos!=null){try{fos.close();}catch (Exception e){e.printStackTrace();}}}}
}
/util/SharedUtil 轻量级存储
package com.example.shop.util;import android.content.Context;
import android.content.SharedPreferences;import java.util.Calendar;public class SharedUtil {private static SharedUtil mUtil;private SharedPreferences preferences;public static SharedUtil getInstance(Context ctx){if(mUtil==null){mUtil=new SharedUtil();mUtil.preferences=ctx.getSharedPreferences("shopping",Context.MODE_PRIVATE);}return mUtil;}public void writeBoolean(String key,boolean value){//快捷方法SharedPreferences.Editor editor=preferences.edit();editor.putBoolean(key,value);editor.commit();}public boolean reaadBoolean(String key,Boolean de){return preferences.getBoolean(key,de);}}
AppWriteActivity
package com.example.shop;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;public class AppWriteActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_app_write);}
}
MainActivity
package com.example.shop;import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;import java.lang.ref.Cleaner;import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);}}
MyApplication
package com.example.shop;import android.app.Application;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;import androidx.annotation.NonNull;import com.example.shop.database.ShoppingDBHelper;
import com.example.shop.enity.GoodsInfo;
import com.example.shop.util.FilUtil;
import com.example.shop.util.SharedUtil;import java.io.File;
import java.util.HashMap;
import java.util.List;public class MyApplication extends Application {private static MyApplication mApp;public HashMap<String,String>infoMap=new HashMap<>();public int goodsCount;public static MyApplication getInstance(){//外部调用return mApp;}@Overridepublic void onCreate() {super.onCreate();mApp=this;initGoodsInfo();}private void initGoodsInfo() {//第一次打开Boolean isFirst=SharedUtil.getInstance(this).reaadBoolean("first",true);String directory=getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).toString()+ File.separatorChar;if(isFirst){//打开数据库List<GoodsInfo>list=GoodsInfo.getDefaultList();for(GoodsInfo info:list){Bitmap bitmap=BitmapFactory.decodeResource(getResources(),info.pic);String path=directory+info.id+".jpg";FilUtil.saveImage(path,bitmap);bitmap.recycle();info.picPath=path;}//存储ShoppingDBHelper dbHelper=ShoppingDBHelper.getInstance(this);dbHelper.openWriteLink();dbHelper.insertGoodsInfos(list);dbHelper.closeLink();SharedUtil.getInstance(this).writeBoolean("frist",false);}}@Overridepublic void onTerminate() {super.onTerminate();}@Overridepublic void onConfigurationChanged(@NonNull Configuration newCondig) {super.onConfigurationChanged(newCondig);}
}
ShoppingcartActivit
package com.example.shop;import androidx.appcompat.app.AppCompatActivity;import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;import com.example.shop.database.ShoppingDBHelper;
import com.example.shop.enity.CartInfo;
import com.example.shop.enity.GoodsInfo;import java.util.HashMap;
import java.util.List;
import java.util.Map;public class ShoppingcartActivit extends AppCompatActivity implements View.OnClickListener {private TextView tv_count;private LinearLayout ll_cart;private ShoppingDBHelper mDBHelper;public List<CartInfo> mCartList;//购物车private TextView tv_total_price;//声明缓存private Map<Integer,GoodsInfo>mGoodsMap=new HashMap<>();private LinearLayout ll_empty;private LinearLayout ll_content;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_shoppingcart);TextView tv_title=findViewById(R.id.tv_title);tv_count=findViewById(R.id.tv_count);tv_title.setText("购物车");tv_count.setText(String.valueOf(MyApplication.getInstance().goodsCount));ll_cart=findViewById(R.id.ll_cart);tv_total_price=findViewById(R.id.tv_total_price);mDBHelper= ShoppingDBHelper.getInstance(this);findViewById(R.id.iv_back).setOnClickListener(this);findViewById(R.id.btn_shopping_channel).setOnClickListener(this);findViewById(R.id.btn_clear).setOnClickListener(this);findViewById(R.id.btn_settle).setOnClickListener(this);ll_empty=findViewById(R.id.ll_empty);ll_content=findViewById(R.id.ll_content);}protected void onResume() {super.onResume();showCart();}private void showCart() {//展示ll_cart.removeAllViews();//先移除mCartList=mDBHelper.queryAllCartInfo();if(mCartList.size()==0)return;else{for(CartInfo info:mCartList){GoodsInfo goods= mDBHelper.queryGoodsInfoById(info.goodsid);mGoodsMap.put(info.goodsid,goods);//缓存View view= LayoutInflater.from(this).inflate(R.layout.item_cart,null);@SuppressLint({"MissingInflatedId", "LocalSuppress"})ImageView iv_thumb= view.findViewById(R.id.iv_thumb);@SuppressLint({"MissingInflatedId", "LocalSuppress"})TextView tv_name=view.findViewById(R.id.tv_name);@SuppressLint({"MissingInflatedId", "LocalSuppress"})TextView tv_desc=view.findViewById(R.id.tv_desc);@SuppressLint({"MissingInflatedId", "LocalSuppress"})TextView tv_count=view.findViewById(R.id.tv_count);@SuppressLint({"MissingInflatedId", "LocalSuppress"})TextView tv_price=view.findViewById(R.id.tv_price);@SuppressLint({"MissingInflatedId", "LocalSuppress"})TextView tv_sum=view.findViewById(R.id.tv_sum);iv_thumb.setImageURI(Uri.parse(goods.picPath));tv_name.setText(goods.name);tv_price.setText(String.valueOf((int)goods.price));tv_count.setText(String.valueOf(info.count));tv_desc.setText(goods.description);tv_sum.setText(String.valueOf((int)(info.count*goods.price)));view.setOnLongClickListener(v -> {//clear 长安删除AlertDialog.Builder builder=new AlertDialog.Builder(ShoppingcartActivit.this);//长安builder.setMessage("是否从购物车中删除"+goods.name+"?");builder.setPositiveButton("是",(dialog, which) -> {ll_cart.removeView(v);//deletedeleteGoods(info);});builder.setNegativeButton("否",null);builder.create().show();return true;});ll_cart.addView(view);}refreshtotalprice();}}private void deleteGoods(CartInfo info) {MyApplication.getInstance().goodsCount-=info.count;mDBHelper.deleteCartinfobygoodsid(info.goodsid);//从detebseCartInfo removed=null;//从list from cartfor(CartInfo cartInfo:mCartList){if(cartInfo.goodsid==info.goodsid){removed=cartInfo;break;}}mCartList.remove(removed);showCount();Toast.makeText(this,"已从购物车中删除"+mGoodsMap.get(info.goodsid).name,Toast.LENGTH_SHORT).show();mGoodsMap.remove(info.goodsid);refreshtotalprice();}private void showCount() {//显示购物车数据tv_count.setText(String.valueOf(MyApplication.getInstance().goodsCount));if(MyApplication.getInstance().goodsCount==0){ll_empty.setVisibility(View.VISIBLE);ll_content.setVisibility(View.GONE);ll_cart.removeAllViews();}else{ll_content.setVisibility(View.VISIBLE);ll_empty.setVisibility(View.GONE);}}private void refreshtotalprice() {//重新可计算int totalPrice=0;for(CartInfo info:mCartList){GoodsInfo goods=mGoodsMap.get(info.goodsid);totalPrice+=goods.price*info.count;}tv_total_price.setText(String.valueOf(totalPrice));}@Overridepublic void onClick(View v) {if(v.getId()==R.id.iv_back){finish();} else if (v.getId()==R.id.btn_shopping_channel) {Intent intent=new Intent(this,ShoppingChannelActivity.class);intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);startActivity(intent);} else if (v.getId()==R.id.btn_clear) {mDBHelper.deleteallcartinfo();MyApplication.getInstance().goodsCount=0;showCount();Toast.makeText(this,"购物车已清空",Toast.LENGTH_SHORT).show();} else {//settle结算AlertDialog.Builder builder=new AlertDialog.Builder(this);builder.setTitle("结算");builder.setMessage("下次见");builder.setPositiveButton("know",null);builder.create().show();}}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/663036.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

统计图表在线配置服务-百度 SugarBI的学习笔记

最近&#xff0c;有个产品要支持统计图表在线可配置&#xff0c;这样&#xff0c;当用户有新增统计指标的需求时&#xff0c;运维人员通过界面化配置&#xff0c;就可以增加统计指标了&#xff0c;不用开发写代码&#xff0c;画页面了。 上网查了下相关的组件&#xff0c;感觉…

SG2520CAA汽车用晶体振荡器

爱普生SG2520CAA是简单的封装晶体振荡器&#xff08;SPXO&#xff09;&#xff0c;具有CMOS输出&#xff0c;这款SPXO是汽车和高可靠性应用的理想选择&#xff0c;符合AEC-Q200标准&#xff0c;功耗低&#xff0c;工作电压范围为1.8 V ~ 3.3 V类型&#xff0c;宽工作温度-40℃~…

VPP学习-startup.conf配置文件

背景 VPP&#xff08;Vector Packet Processing&#xff0c;矢量报文处理&#xff09;&#xff0c;作为一个开源的高性能数据包处理框架&#xff0c;旨在提供可扩展、灵活且高效的网络数据包处理能力&#xff1b;由于传统Linux 内核协议栈整体网络吞吐性能的局限性&#xff0c;…

【Linux】环境基础开发工具的使用之gcc详解(二)

前言&#xff1a;上一篇文章中我们讲解了Linux下的vim和yum的工具的使用&#xff0c;今天我们将在上一次的基础上进一步的讲解开放工具的时候。 &#x1f496; 博主CSDN主页:卫卫卫的个人主页 &#x1f49e; &#x1f449; 专栏分类:Linux的深度刨析 &#x1f448; &#x1f4a…

ESU毅速丨为什么增材制造广受关注?

随着科技的飞速发展&#xff0c;增材制造3D打印技术逐渐成为制造业的新宠。包括航空航天、汽车、家电、电子等各行业都在积极拥抱3D打印&#xff0c;为什么3D打印能引起制造业广泛关注与应用&#xff1f;它的主要优势有哪些&#xff1f; 首先&#xff0c;3D打印减少浪费。3D打印…

【Linux】 Linux编译器-gcc/g++使用

&#x1f497;个人主页&#x1f497; ⭐个人专栏——Linux学习⭐ &#x1f4ab;点击关注&#x1f929;一起学习C语言&#x1f4af;&#x1f4ab; 目录 导读1. Linux编译器-gcc/g使用1.1 引入1.2 初识gcc/g1.3 程序运行的四个阶段1.3.1 预处理1.3.2 编译1.3.3 汇编1.3.4 链接 1.…

【2024.2.1练习】岛屿个数(15分)

题目描述 题目思路 题目乍一看类似于“水坑个数问题”&#xff0c;是对陆地块进行DFS,上下左右4个方向分别对应了四种状态转移&#xff0c;每块陆地进行搜索后变成海洋&#xff0c;最终搜索次数就是岛屿个数。 但在子岛屿存在的情况下&#xff0c;需要先对海洋块进行DFS,由于…

binder android

文心一言的回答 Binder驱动是Android操作系统中用于进程间通信&#xff08;IPC&#xff09;的机制。它提供了一种高效、跨进程的数据传输方式&#xff0c;使得应用程序的不同组件可以在Android系统上互相通信。 Binder驱动基于Linux内核&#xff0c;其核心组件是一个称为Bind…

基于最新koa的Node.js后端API架构与MVC模式

Koa 是一个由 Express 原班人马打造的现代 Web 框架&#xff0c;用于 Node.js。它旨在提供一个更小、更富有表现力和更强大的基础&#xff0c;用于 Web 应用和 API 开发。Koa 不捆绑任何中间件&#xff0c;它提供了一个优雅的方法以组合不同的中间件来处理请求和响应。 Koa 的核…

2024年哪款便签软件是手机电脑同步的?

在繁忙的生活、工作和学习中&#xff0c;我们时常面临各种琐事和任务&#xff0c;需要随时记录、提醒&#xff0c;以保持高效的生活节奏。比如&#xff0c;突然想到的灵感、重要的工作计划、紧急的购物清单&#xff0c;都需要一个便利的便签工具来随手记录。特别是在多终端使用…

vue2 el-form 两个时间框(第一个时间框是只能选择当前时间,之前的是不允许选择,第二个时间框是第一个时间的当前的时间后30天后可以选择的)

<template><div id"app"><el-form :model"form"><el-form-item label"预签时间"><el-date-picker v-model"form.t2" type"date" placeholder"选择预签时间" changepreSigning/><…

RT-DETR算法优化改进:上采样算子 | 超轻量高效动态上采样DySample,效果秒杀CAFFE,助力小目标检测

💡💡💡本文独家改进:一种超轻量高效动态上采样DySample, 具有更少的参数、FLOPs,效果秒杀CAFFE和YOLOv8网络中的nn.Upsample 💡💡💡在多个数据集下验证能够涨点,尤其在小目标检测领域涨点显著。 RT-DETR魔术师专栏介绍: https://blog.csdn.net/m0_63774211/…

C++ 音视频流媒体浅谈

C流媒体开发 今天就浅浅聊一下C流媒体开发 流媒体开发中最常见的是FFmpeg&#xff08;编解码器&#xff09; 业务逻辑主要是播放器了&#xff08;如腾旭视频 爱奇艺等等&#xff09; FFmpeg是一个开源的音视频处理工具集&#xff0c;可以用于处理、转换和流媒体传输音视频…

广州标点医药信息-米内网数据及咨询服务企业全方位解析!

米内网&#xff08;MENET&#xff09;原名中国医药经济信息网&#xff0c;由广州标点医药信息股份有限公司主办&#xff0c;2010年10月28日更名为“米内网”&#xff0c;上线初始主打医药销售数据库&#xff0c;经过十余年的迭代发展&#xff0c;现已成为国内主要的医药健康信息…

计网——应用层

应用层 应用层协议原理 网络应用的体系结构 客户-服务器&#xff08;C/S&#xff09;体系结构 对等体&#xff08;P2P&#xff09;体系结构 C/S和P2P体系结构的混合体 客户-服务器&#xff08;C/S&#xff09;体系结构 服务器 服务器是一台一直运行的主机&#xff0c;需…

数据结构·复杂度讲解

1. 什么是数据结构 数据结构(Data Structure)是计算机存储、组织数据的方式&#xff0c;指相互之间存在一种或多种特定关系的数据元素的集合。 数据结构是用来在内存中管理数据的&#xff0c;类似的&#xff0c;我们熟悉的文件或数据库是在硬盘中管理数据的。内存中的数据是带点…

【2024美赛】B题(中英文):搜寻潜水器Problem B: Searching for Submersibles

【2024美赛】B题&#xff08;中英文&#xff09;&#xff1a;搜寻潜水器Problem B: Searching for Submersibles 写在最前面2024美赛翻译 —— 跳转链接 中文赛题问题B&#xff1a;搜寻潜水器你的任务是&#xff1a; 词汇表 英文赛题Problem B: Searching for SubmersiblesYour…

基于VMware和Unbuntu18.04编译 嘉立创·泰山派 Linux SDK

主机硬件要求 内存最少32G 硬盘腾出200-500G&#xff0c;虽然编译最终占了73G&#xff0c;但富余一些以后可以搞别的方便 操作系统win7/10/11 VMware 安装 1.去vmware官网下载&#xff1a;https://customerconnect.vmware.com/cn/downloads/info/slug/desktop_end_user_comp…

小红书种草商品笔记违规,有哪些原因?

发布小红书笔记之后迟迟没有流量&#xff0c;内容过关但是浏览量突然变低是什么原因?如果出现上述情况&#xff0c;就可能是商品笔记被限制了。那么该如何重新获得流量呢?今天我们就来分享下小红书种草商品笔记违规&#xff0c;有哪些原因&#xff1f; 一、怎样判断被限流了 …

网络原理-TCP/IP(4)

TCP原理 滑动窗口 之前我们讲过了确认应答策略,对发送的每一个数据段,都要给一个ACK确认应答,收到ACK后再发送下一个数据段. 确认应答,超时重传,连接管理这样的特性都是为了保证可靠运输,但就是付出了传输效率(单位时间能传输数据的多少)的代价,因为确认应答机制导致了时间大…