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

进入百度app查看seo点击软件排名优化

进入百度app查看,seo点击软件排名优化,浙江网站建设公司推荐,网站维护模板我在我的电脑上执行java服务器并让我的android设备连接到它。我可以连接它#xff0c;但一旦连接就会断开连接。我确信在android方面我需要做一些事情#xff0c;但我很少迷失它。我有互联网许可#xff0c;所以很好。Android tcp客户端连接#xff0c;然后从java服务器断开…我在我的电脑上执行java服务器并让我的android设备连接到它。我可以连接它但一旦连接就会断开连接。我确信在android方面我需要做一些事情但我很少迷失它。我有互联网许可所以很好。Android tcp客户端连接然后从java服务器断开连接而且忽视了注释代码我发送图像从我的Android到PC。也忽略savebitmap并采取截图我不认为它影响连接如果它没有被调用。的Java服务器Java服务器import java.io.BufferedReader;import java.io.DataOutputStream;import java.io.InputStream;import java.io.InputStreamReader;import java.net.Socket;public class EchoThread extends Thread {protected Socket socket;public EchoThread(Socket clientSocket){this.socket clientSocket;}public void run(){InputStream inp null;BufferedReader brinp null;DataOutputStream out null;try{inp socket.getInputStream();brinp new BufferedReader(new InputStreamReader(inp));out new DataOutputStream(socket.getOutputStream());}catch(Exception e){return;}String line;while(true){try{line brinp.readLine();if ((line null) || line.equalsIgnoreCase(QUIT)){socket.close();return;}else{out.writeBytes(line \n\r);out.flush();}}catch(Exception e){e.printStackTrace();return;}}}}这里import javax.imageio.ImageIO;import javax.imageio.ImageReadParam;import javax.imageio.ImageReader;import javax.imageio.stream.ImageInputStream;import javax.swing.*; //access JFrameimport javax.swing.text.html.HTMLDocument.Iterator;import java.awt.BorderLayout;import java.awt.Graphics;import java.awt.Graphics2D;import java.awt.Image;import java.awt.image.BufferedImage;import java.io.*;import java.net.*;public class tcpmain {BufferedReader in;static final int PORT 9000;public static void main(String[] args) {// TODO Auto-generated method stub//lines to make the gui frameJFrame mainframe new JFrame();mainframe.setTitle(TCP Listener);mainframe.setSize(600,800);mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);mainframe.setVisible(true);ServerSocket serverSocket null;Socket socket null;try{serverSocket new ServerSocket(PORT);//Receive code motherfucker/*int filesize450660;int bytesRead;int current0;//receive file motherfuckerbyte [] mybytearray new byte [filesize];InputStream is srsvsock.getInputStream();FileOutputStream fos new FileOutputStream(C:\\Users\\Andy\\Desktop\\testimage.jpg);BufferedOutputStream bos new BufferedOutputStream(fos);bytesRead is.read(mybytearray,0,mybytearray.length);current bytesRead;*//*do{bytesRead is.read(mybytearray, current, (mybytearray.length-current));if(bytesRead 0) current bytesRead;} while(bytesRead -1);bos.write(mybytearray, 0, current);bos.flush();*/}catch(Exception e){e.printStackTrace();}while (true) {try {socket serverSocket.accept();JOptionPane.showMessageDialog(null, Client connected, ALERT, JOptionPane.INFORMATION_MESSAGE);} catch (IOException e) {System.out.println(I/O error: e);}// new threa for a clientnew EchoThread(socket).start();if (socket ! null !socket.isClosed()){try {socket.close();JOptionPane.showMessageDialog(null, Client Disconnected, ALERT, JOptionPane.INFORMATION_MESSAGE);} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}}}客户端处理程序是Android客户端package com.example.tcpsocket;import java.io.BufferedInputStream;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.InetAddress;import java.net.Socket;import android.os.Bundle;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Bitmap.CompressFormat;import android.util.Log;import android.view.Menu;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class MainActivity extends Activity {private Socket socket;private static final int SERVERPORT 9000;private static final String SERVER_IP 192.168.1.113;Bitmap bitmap;File imagePath;Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Button btnconnect (Button)findViewById(R.id.button1);btnconnect.setOnClickListener(connect);}private OnClickListener connect new OnClickListener(){Overridepublic void onClick(View arg0) {// TODO Auto-generated method stub//Bitmap bitmap takeScreenshot();// saveBitmap(bitmap);new Thread(new clienthread()).start();}};public Bitmap takeScreenshot() {View rootView findViewById(android.R.id.content).getRootView();rootView.setDrawingCacheEnabled(true);return rootView.getDrawingCache();}public void saveBitmap(Bitmap bitmap){File imagePath new File(sdcard/screenshot.jpg);FileOutputStream fos;try {fos new FileOutputStream(imagePath);bitmap.compress(CompressFormat.JPEG, 100, fos);fos.flush();fos.close();new Thread(new clienthread()).start();} catch (FileNotFoundException e) {Log.e(GREC, e.getMessage(), e);} catch (IOException e) {Log.e(GREC, e.getMessage(), e);}}Overridepublic boolean onCreateOptionsMenu(Menu menu) {// Inflate the menu; this adds items to the action bar if it is present.getMenuInflater().inflate(R.menu.main, menu);return true;}class clienthread implements Runnable {Overridepublic void run() {// TODO Auto-generated method stubtry{InetAddress serverAddr InetAddress.getByName(SERVER_IP);socket new Socket(serverAddr, SERVERPORT);/*File imagePath new File(sdcard/screenshot.jpg);byte[] mybytearray new byte[450560];FileInputStream fis new FileInputStream(imagePath);BufferedInputStream bis new BufferedInputStream(fis);bis.read(mybytearray,0,mybytearray.length);OutputStream os socket.getOutputStream();os.write(mybytearray,0,mybytearray.length);os.close();*/}catch(Exception e){}}}}2013-11-26andyADD
http://www.sadfv.cn/news/249130/

相关文章:

  • 为什么打开网址都是站长工具网站包括哪些主要内容
  • 网站链接结构有哪些做冒菜店网站
  • 网站列表页框架布局原则wordpress页面居中
  • 对于网站链接优化有哪些建议做ui设计师难吗
  • 做视频网站 带宽计算seo系统是什么
  • 深圳宝安区深圳网站建设 骏域网络手机网站设计方案
  • 一个网站完整的html代码网站建设市场介绍
  • 机械类毕业设计代做网站推荐智慧政务门户网站建设
  • 扁平化配色方案网站免费开源小程序商城源码
  • 做门面商铺比较好的网站小说网站模板html
  • 安康市网站开发线上营销课程
  • 展示互动南宁seo推广经验
  • 网站备案必须是企业吗中国建设劳动学会监制网站
  • 海南省住房和城乡建设厅官网网站首页龙溪营销型网站制作
  • 做养生哪个网站有客人WordPress导航栏目删除
  • 庆阳网站哪里做网站维护的协议
  • 用花生棒自己做网站网站服务器人多怎么挤进去
  • 西安市长安区规划建设局网站简述网站制作的过程
  • 做团购网站需要注册哪些商标注册公司名字有没有重复在哪可以查
  • 外贸人常用网站网站设计中建设规划和准备阶段
  • 江阴公司做网站常德seo招聘
  • 建设个网站需要多少钱赤峰浩诚网站建设公司
  • 交互式网站app网站建设 服务器主机配置
  • asp网站防注入代码wordpress网站资源
  • 做网站的上市公司有哪些东至网站制作
  • 网站开发前台企业网站程序下载
  • 网络公司网站报价网站建设电脑端手机端
  • 邯郸网站开发定制龙岗区网络科技有限公司
  • 全面的聊城网站建设jf厂高仿手表网站
  • 短租网站建设推动高质量发展要坚持