当前位置: 首页 > news >正文

安庆网站开发/长沙seo排名外包

安庆网站开发,长沙seo排名外包,建站平台那个好,私有云笔记 wordpress一、产品说明 1.编写目的:用于用户查看图书信息。 2.情景设计:本产品用于小说阅读软件。随着电子产品的普及,大部分的人群选择使用电子书,为了方便用户更清楚的了解图书的信息,明智的选择适合自…

一、产品说明

1.编写目的:用于用户查看图书信息。

2.情景设计:本产品用于小说阅读软件。随着电子产品的普及,大部分的人群选择使用电子书,为了方便用户更清楚的了解图书的信息,明智的选择适合自己的图书而开发。

3.Demo主要实现的功能:当用户点击“图片下载”按钮时,软件会从网上下载图书的图片;当用户点击“图书简介”按钮时,页面跳转至图书介绍页面;当用户点击“返回”按钮时,返回首页。

二、实现过程

1.首先创建一个项目,然后在新建一个introduction.xml文件和Introduction.class文件,最后AndroidMainfest.xml文件中加入允许访问网络的指令<uses-permission android:name="android.permission.INTERNET" />和注册Introduction.class文件<activity android:name=".Introduction"></activity>

2.在activity_main.xml文件中加入控件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:gravity="center" tools:context="com.example.pj.download.MainActivity"> <ImageView android:id="@+id/img" android:layout_width="match_parent" android:layout_height="wrap_content" /> <Button android:id="@+id/btn_picture" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="图片下载" android:textSize="30sp" android:gravity="center"/> <Button android:id="@+id/btn_introduction" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="图书简介" android:textSize="30sp" android:gravity="center"/> </LinearLayout>

3.在MainActivity.class文件中写入功能

package com.example.pj.download;import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; public class MainActivity extends AppCompatActivity { private Button btn_p; private Button btn_i; private ImageView img; Handler handler = new Handler() { public void handleMessage(android.os.Message msg) { img.setImageBitmap((Bitmap) msg.obj); } }; public Bitmap getInternetPicture(String UrlPath) { HttpURLConnection httpURLConnection = null; Bitmap bm = null; try { URL url = new URL(UrlPath); httpURLConnection = (HttpURLConnection) url.openConnection(); httpURLConnection.setRequestMethod("GET"); httpURLConnection.setReadTimeout(5000); httpURLConnection.setConnectTimeout(10000); int responseCode = httpURLConnection.getResponseCode(); if (responseCode == 200) { InputStream is = httpURLConnection.getInputStream(); bm = BitmapFactory.decodeStream(is); } } catch (IOException e) { e.printStackTrace(); } finally { if (httpURLConnection != null) { httpURLConnection.disconnect(); } } return bm; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); img = (ImageView) findViewById(R.id.img); btn_p = (Button) findViewById(R.id.btn_picture); btn_i = (Button) findViewById(R.id.btn_introduction); btn_p.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { new Thread(new Runnable() { @Override public void run() { String URL = "https://img3.doubanio.com/lpic/s1076932.jpg"; Bitmap bm = getInternetPicture(URL); Message msg = new Message(); msg.obj = bm; handler.sendMessage(msg); } }).start(); } }); btn_i.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,Introduction.class); startActivity(intent); } }); } }

4.在introduction.xml文件中加入控件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text=" 《三国演义》是中国第一部长篇章回体历史演义小说,以描写战争为主,反映了吴.蜀.魏三个政治集团之间的政治和军事斗争。分为黄巾之乱、董卓之乱、群雄逐鹿、三国鼎立、三国归晋五大部分。在广阔的背景上,上演了一幕幕气势磅礴的战争场面。编者罗贯中将兵法三十六计融于字里行间,既有情节,也有兵法韬略。《三国演义》反映了丰富的历史内容,人物名称、地理名称、主要事件与《三国志》基本相同。人物性格也是在《三国志》留下的固定形象基础上,才进行再发挥,进行夸张、美化、丑化等等,这也是历史演义小说的套路。《三国演义》一方面反映了真实的三国历史,照顾到读者希望了解真实历史的需要;另一方面,根据明朝社会的实际情况对三国人物进行了夸张、美化、丑化等等。   《三国演义》是中国古典四大名著之一,全名为《三国志通俗演义》。作者是元末明初小说家罗贯中,是中国第一部长篇章回体历史演义小说。描写了从东汉末年到西晋初年之间近105年的历史风云。全书反映了三国时代的政治军事斗争,反映了三国时代各类社会斗争与矛盾的转化,并概括了这一时代的历史巨变,塑造了一批叱咤风云的三国英雄人物。" android:textSize="16sp"/> <Button android:id="@+id/btn_return" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="返回" android:layout_marginTop="20dp"/> </LinearLayout>

5.在Introduction.class文件中写入一个跳转功能

package com.example.pj.download;import android.content.Intent;
import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; /** * Created by pj on 2017/3/28. */ public class Introduction extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.introduction); Button btn_r = (Button)findViewById(R.id.btn_return); btn_r.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Introduction.this,MainActivity.class); startActivity(intent); } }); } }

三、运行结果截图

1.下载图片


2.书籍简介


转载于:https://www.cnblogs.com/yuhouwuqiong/p/6637260.html

http://www.lbrq.cn/news/1042471.html

相关文章:

  • 纺织行业网站怎么做/除了91还有什么关键词
  • 视频背景网站/谷歌浏览器下载安装2022
  • 网站建设毕业设计评价/免费的网页模板网站
  • 江苏建设工程交易信息网站/网络广告营销的特点
  • 标准物质网站建设/seo的重要性
  • 成都 网站开发/黑龙江头条今日新闻
  • 织梦网站迁移/网站关键词优化wang
  • 免费seo网站的工具/百度推广app下载
  • 一个服务器做两个网站吗/凡科网怎么建网站
  • 论文旅游网站建设/最基本的网站设计
  • 做cpa比较做网站吗/怎么创建网址
  • 别人带做的网站关闭了权限咋办/百度新闻官网
  • 聊城定制网站建设公司/竞价网站推广
  • 有没有专门做商铺招商的网站/培训机构
  • 有哪些优秀的个人网站/做广告推广哪个平台好
  • 教育视频网站开发/上海小红书seo
  • 京东购物官网免费下载/珠海百度推广优化排名
  • 可视化软件开发工具/满足seo需求的网站
  • 淘宝客不建立网站怎么做/郑州百度seo网站优化
  • 广州做网站优化/合肥seo排名优化
  • 企业网站模板带后台/优秀营销软文范例100字
  • 任丘市网站建设/百度知道网页入口
  • 攀枝花城市建设网站/chrome手机安卓版
  • 公司建网站多少钱qcjxkd/广告推广 精准引流
  • 开源手机网站建站系统/百度秒收录
  • wap网站制作工具/seo推广百度百科
  • 网站制作的预算/代写文章多少钱
  • 软件网站模板/自动发外链工具
  • 贵阳网站建设方案咨询/朝阳seo搜索引擎
  • 网站图片悬浮代码/淘宝seo搜索引擎优化
  • Vue 3 快速入门 第六章
  • @ContextConfiguration
  • 第5节 大模型分布式推理通信优化与硬件协同
  • Redis应⽤-缓存与分布式锁
  • Python FastAPI + React + Nginx 阿里云WINDOWS ECS部署实战:从标准流程到踩坑解决全记录
  • 《C语言》结构体和联合体练习题--2