请问在Android APP中如何与CAN口进行通信呐?

我在做应用层的Android APP,现在终端平板厂商提供了具有CAN协议接口的平板,请问我在应用层该如何实现与它的CAN口进行通信,完成数据收发?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
如何允许Android应用程序与网站通信

<div class="post-text" itemprop="text"> <p>Hello there and please excuse me for my English or the silly question.. Due to my not deep technical background I might not use the right terms..</p> <p>So..</p> <p>I have created a web site (in PHP) where the users need to authenticate themselves in order to read some articles. The users are also able to post their articles or comment to the other articles.</p> <p>What I need to do now is to transfer this simple functionality to an android app so the users can do the same thing through their mobile phones.</p> <p>How should I approach this? How should I make the app to communicate with the website?</p> <p>I am aware that directly access to the database is not a good idea at all.. So what are the alternatives?</p> <p>So far I was thinking to have a url in the website where the user will POST data and actions of what he/she needs to do..</p> <p>For example: In order to get the articles from a special category, they will need to send some POST data in the url <a href="http://www.example.com/mobile.php" rel="nofollow">http://www.example.com/mobile.php</a> containing: - username - password - action(read) - options[category,since yesterday, order by rating]</p> <p>And so goes on..</p> <p>Then the web site will return the result in a JSON format which the mobile app will read and display it to the user's mobile.</p> <p>A similar thing will happen when the user needs to write some articles or post comments..</p> <p>Is the above-mentioned a logical approach or it makes no sense at all? Would you suggest something more professional?</p> <p>Is there any link you could share please?</p> <p>Thanks in advance!</p> </div>

为什么我android UDP通信 只能发信息接收不到信息。请大神帮忙

主进程 import android.support.v7.app.ActionBarActivity; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class YuntuActivity extends ActionBarActivity implements OnClickListener { private TextView adSpeed; private TextView reSpeed; private TextView reTxt; private Button btnHeadCar; private Button btnAgree; private Button btnApply; private Button btnStart; private Button btnExit; //自定义变量 private String remoteIP = null; private int rePort = 0; private int loPort = 0; private UDPThread reTxtThread = null; private UDPThread adSpeedThread = null; private UDPThread reSpeedThread = null; private String sendStr = null;//发送的字符串 private String receStr = null; Handler mhander = new Handler() { public void handleMessage(Message msg) { Bundle bundle =new Bundle(); bundle = msg.getData(); receStr = bundle.getString("info"); reTxt.setText(receStr); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_yuntu); //初始化UI initUI(); //初始化 init(); reTxtThread = new UDPThread(mhander); } private void init() { remoteIP = "172.22.130.124"; rePort = 8801; loPort = 8805; } //初始化UI private void initUI() { adSpeed =(TextView)findViewById(R.id.AdSpeed); reSpeed =(TextView)findViewById(R.id.ReSpeed); reTxt =(TextView)findViewById(R.id.reTxt); btnHeadCar =(Button)findViewById(R.id.button1); btnAgree =(Button)findViewById(R.id.button2); btnApply =(Button)findViewById(R.id.button3); btnStart =(Button)findViewById(R.id.button4); btnExit =(Button)findViewById(R.id.button5); } @Override public void onClick(View v) { switch (v.getId()) { //点击 同意入队 按钮 case R.id.button1: sendStr = "you can join in flownteam."; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击 申请入队按钮 case R.id.button2: sendStr = "Can I join in?"; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击申请离队按钮 case R.id.button3: sendStr = "Can I exit?"; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击开始监听按钮 case R.id.button4: reTxtThread.setReomteIP(remoteIP); reTxtThread.setRePort(rePort); reTxtThread.setLoPort(loPort); boolean connResult = reTxtThread.connectSocket(); if(connResult) { Toast.makeText(getApplicationContext(), "链接建立完毕!", Toast.LENGTH_SHORT).show(); } break; //点击关闭监听按钮 case R.id.button5: reTxtThread.disConnectSocket(); Toast.makeText(getApplicationContext(), "链接已经关闭!", Toast.LENGTH_SHORT).show(); break; default: break; } } } 子线程:接收和发送UDP包 package com.example.cqput_yuntu2; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.text.SimpleDateFormat; import java.util.Date; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.widget.TextView; public class UDPThread implements Runnable { // 定义变量 private TextView rTextView = null; private String reomteIP = null; private int rePort = 0; private int loPort = 0; private Thread rThread = null; private static String CHARECTER = "UTF-8"; private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); // 接收 private byte[] rBuffer = new byte[1024]; private DatagramSocket rSocket = null; private DatagramPacket rPacket = null; private String rStr = null; // 发送 private DatagramSocket sSocket = null; private DatagramPacket sPacket = null; private byte[] sBuffer = new byte[1024]; public Handler mhandler; public UDPThread(Handler handler) { mhandler = handler; } @Override public void run() { // 开始接收数据 Looper.prepare(); if (Thread.currentThread() == rThread) { System.out.println("------jieshouqian"); rStr = receiveData(); System.out.println("------jieshouhou"); Message toMain = mhandler.obtainMessage(); Bundle bundle = new Bundle(); bundle.putString("info", rStr); toMain.setData(bundle); mhandler.sendMessage(toMain); } ; try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // 开始接收数据 private String receiveData() { try { ByteArrayInputStream bais = new ByteArrayInputStream(rBuffer); DataInputStream dis = new DataInputStream(bais); if (rSocket == null) { rSocket = new DatagramSocket(8805); } if (rPacket == null) { rPacket = new DatagramPacket(rBuffer, rBuffer.length); } System.out.println("----rece"); rSocket.receive(rPacket); System.out.println("------receHou"); rStr = dis.readUTF().trim(); System.out.println("------jieBeg"); rStr = String.format("[%s:%d//%s]%s", rPacket.getAddress() .getHostAddress(), rPacket.getPort(), sdf .format(new Date()), rStr); return rStr; } catch (Exception e) { e.printStackTrace(); System.out.println("-----------------recvdata error:" + e.getMessage()); } return null; } // 建立连接 public boolean connectSocket() { boolean result = false; // 开启一个新的线程 startThread(); System.out.print("监听线程开启"); result = true; return result; } // 关闭连接 public void disConnectSocket() { if (rSocket != null) { rSocket.close(); rSocket = null; } if (rPacket != null) { rPacket = null; } // 关闭线程 stopThread(); } // 关闭线程 private void stopThread() { if (rThread != null) { rThread.stop(); rThread = null; } } // 开启新的线程 private void startThread() { if (rThread == null) { rThread = new Thread(this); rThread.start(); } } // 开始发送数据 public void sendData(String sendStr) { try { // 包装数据 ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeUTF(sendStr); sBuffer = baos.toByteArray(); if (sSocket == null) { sSocket = new DatagramSocket(); } if (sPacket == null) { sPacket = new DatagramPacket(sBuffer, sBuffer.length, InetAddress.getByName(reomteIP), rePort); } sSocket.send(sPacket); sSocket.close(); sSocket = null; sPacket = null; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); sSocket.close(); sSocket = null; sPacket = null; System.out.println("senddata error:" + e.getMessage()); } } public void setReomteIP(String reomteIP) { this.reomteIP = reomteIP; } public void setRePort(int rePort) { this.rePort = rePort; } public void setLoPort(int loPort) { // this.loPort = loPort; } }

Android应用程序与webservice通信的安全性

<div class="post-text" itemprop="text"> <p>I am developing an android app for a site, which I made a capability in it that users can send data to the site database in the app. I use PHP web services and URL in android code for connecting to the web service. how can I make my app (and my php web service) secure that no one can't find the web service url by debugging my apk and send amount of data to the site and make the site down.</p> <p>any tips for make software system secure from these kinds of dangers can help me a lot, thank you.</p> <p>edit : for example now I use AsyncTask for sending data in my edittext to webservice like below. I use this code in my oncreate to send data to AsyncTask class in the name of AskServer() :</p> <pre><code>link = "http://mywebservice-adrress/name.php"; new AskServer().execute(link, edttext.getText().toString()); </code></pre> <p>and here is my doInBackground of my AsyncTask class :</p> <pre><code>@Override protected Object doInBackground(String... params) { BufferedReader buf = null; try { URL link = new URL(params[0]); URLConnection connect = link.openConnection(); connect.setDoOutput(true); OutputStreamWriter osw = new OutputStreamWriter(connect.getOutputStream()); String data = URLEncoder.encode("field","UTF8") +"="+ URLEncoder.encode(params[1], "UTF8"); sw.write(data); osw.flush(); } catch (Exception e) {e.printStackTrace();} return null; }// end doInbackground() </code></pre> <p>and here is my php code in my web service :</p> <pre><code>&lt;?php include 'config.php'; $field=$_POST['field']; mysql_query("insert into `wp_comments` (`comment_content`) values('$field')"); ?&gt; </code></pre> <p>It is an example and my real code send much more data to server, and maybe code above doesn't work, I just make my question more exact and specific as stackoverflow want me. my question is how to make these transactions safe and secure from hackers which may debug my code and find my url , in code above (params[0]) and send amount of data to my site and make it down. or how can I use the service of sending data to server more secure from these kind of dangers??</p> </div>

我的网络服务器和Android通信

<div class="post-text" itemprop="text"> <p>I have a web page that is a demo for a web shop, which I will implement later. In the web shop you can select an item to buy it. In my demo scenario, I just want to send the info about the cost of the item to my Android upon button click in the web shop.</p> <p><strong>STEP-BY-STEP explanation:</strong></p> <ol> <li>openWebShop (in Android app you click a button and it calls this method to open URI)</li> <li>Web Shop opens with items that you can buy.</li> <li>Select an item from the list</li> <li>onItemClick send the prize value and name of item selected to the Android device and store it in a String</li> <li>Close WebShop -&gt; display your App again with a New Intent / Fragment displaying the chosen Item name and Prize tag.</li> </ol> <p>I also want to upload some files to the web shop. There are some questions here on Stack Overflow on how to do that, but for the time being, I won't tackle that problem yet.</p> <p><strong>QUESTIONS:</strong></p> <ul> <li>Can I use GCM for my idea ?</li> <li>Do I need to create a Web page apart from Android coding or can you style your web shop inside Android coding? (no experience with web development)</li> <li>Do I need to implement a onItemSelected inside PHP or is it done somehow else?</li> </ul> <p><strong>SOME INFO I GOT:</strong></p> <p>What I have learned so far is that I could use HTTP request to download a file from Web Server. I only saw examples on how to download XML files, but I assume that is the same for any file type. But I am not sure whether if this is the best solution for my case. I noticed GCM, but have trouble with PHP, since I have no experience with it - does it have some sort of onClick method ?</p> </div>

请大神看看android socket通信代码,发送没问题,接收UDP包时一直卡在receive。

import android.support.v7.app.ActionBarActivity; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class YuntuActivity extends ActionBarActivity implements OnClickListener { private TextView adSpeed; private TextView reSpeed; private TextView reTxt; private Button btnHeadCar; private Button btnAgree; private Button btnApply; private Button btnStart; private Button btnExit; //自定义变量 private String remoteIP = null; private int rePort = 0; private int loPort = 0; private UDPThread reTxtThread = null; private UDPThread adSpeedThread = null; private UDPThread reSpeedThread = null; private String sendStr = null;//发送的字符串 private String receStr = null; Handler mhander = new Handler() { public void handleMessage(Message msg) { Bundle bundle =new Bundle(); bundle = msg.getData(); receStr = bundle.getString("info"); reTxt.setText(receStr); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_yuntu); //初始化UI initUI(); //初始化 init(); reTxtThread = new UDPThread(mhander); } private void init() { remoteIP = "172.22.130.124"; rePort = 8801; loPort = 8805; } //初始化UI private void initUI() { adSpeed =(TextView)findViewById(R.id.AdSpeed); reSpeed =(TextView)findViewById(R.id.ReSpeed); reTxt =(TextView)findViewById(R.id.reTxt); btnHeadCar =(Button)findViewById(R.id.button1); btnAgree =(Button)findViewById(R.id.button2); btnApply =(Button)findViewById(R.id.button3); btnStart =(Button)findViewById(R.id.button4); btnExit =(Button)findViewById(R.id.button5); } @Override public void onClick(View v) { switch (v.getId()) { //点击 同意入队 按钮 case R.id.button1: sendStr = "you can join in flownteam."; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击 申请入队按钮 case R.id.button2: sendStr = "Can I join in?"; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击申请离队按钮 case R.id.button3: sendStr = "Can I exit?"; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击开始监听按钮 case R.id.button4: reTxtThread.setReomteIP(remoteIP); reTxtThread.setRePort(rePort); reTxtThread.setLoPort(loPort); boolean connResult = reTxtThread.connectSocket(); if(connResult) { Toast.makeText(getApplicationContext(), "链接建立完毕!", Toast.LENGTH_SHORT).show(); } break; //点击关闭监听按钮 case R.id.button5: reTxtThread.disConnectSocket(); Toast.makeText(getApplicationContext(), "链接已经关闭!", Toast.LENGTH_SHORT).show(); break; default: break; } } } 子线程: import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.text.SimpleDateFormat; import java.util.Date; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.widget.TextView; public class UDPThread implements Runnable { // 定义变量 private TextView rTextView = null; private String reomteIP = null; private int rePort = 0; private int loPort = 0; private Thread rThread = null; private static String CHARECTER = "UTF-8"; private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); // 接收 private byte[] rBuffer = new byte[1024]; private DatagramSocket rSocket = null; private DatagramPacket rPacket = null; private String rStr = null; // 发送 private DatagramSocket sSocket = null; private DatagramPacket sPacket = null; private byte[] sBuffer = new byte[1024]; public Handler mhandler; public UDPThread(Handler handler) { mhandler = handler; } @Override public void run() { // 开始接收数据 Looper.prepare(); if (Thread.currentThread() == rThread) { System.out.println("------jieshouqian"); rStr = receiveData(); System.out.println("------jieshouhou"); Message toMain = mhandler.obtainMessage(); Bundle bundle = new Bundle(); bundle.putString("info", rStr); toMain.setData(bundle); mhandler.sendMessage(toMain); } ; try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // 开始接收数据 private String receiveData() { try { ByteArrayInputStream bais = new ByteArrayInputStream(rBuffer); DataInputStream dis = new DataInputStream(bais); if (rSocket == null) { rSocket = new DatagramSocket(8805); } if (rPacket == null) { rPacket = new DatagramPacket(rBuffer, rBuffer.length); } System.out.println("----rece"); rSocket.receive(rPacket); System.out.println("------receHou"); rStr = dis.readUTF().trim(); System.out.println("------jieBeg"); rStr = String.format("[%s:%d//%s]%s", rPacket.getAddress() .getHostAddress(), rPacket.getPort(), sdf .format(new Date()), rStr); return rStr; } catch (Exception e) { e.printStackTrace(); System.out.println("-----------------recvdata error:" + e.getMessage()); } return null; } // 建立连接 public boolean connectSocket() { boolean result = false; // 开启一个新的线程 startThread(); System.out.print("监听线程开启"); result = true; return result; } // 关闭连接 public void disConnectSocket() { if (rSocket != null) { rSocket.close(); rSocket = null; } if (rPacket != null) { rPacket = null; } // 关闭线程 stopThread(); } // 关闭线程 private void stopThread() { if (rThread != null) { rThread.stop(); rThread = null; } } // 开启新的线程 private void startThread() { if (rThread == null) { rThread = new Thread(this); rThread.start(); } } // 开始发送数据 public void sendData(String sendStr) { try { // 包装数据 ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeUTF(sendStr); sBuffer = baos.toByteArray(); if (sSocket == null) { sSocket = new DatagramSocket(); } if (sPacket == null) { sPacket = new DatagramPacket(sBuffer, sBuffer.length, InetAddress.getByName(reomteIP), rePort); } sSocket.send(sPacket); sSocket.close(); sSocket = null; sPacket = null; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); sSocket.close(); sSocket = null; sPacket = null; System.out.println("senddata error:" + e.getMessage()); } } public void setReomteIP(String reomteIP) { this.reomteIP = reomteIP; } public void setRePort(int rePort) { this.rePort = rePort; } public void setLoPort(int loPort) { this.loPort = loPort; } }

服务器 - 客户端与PHP / JS和Android Activity的单向套接字通信?

<div class="post-text" itemprop="text"> <p>I'm trying to build a very simple client-server system that basically features a server script running on my computer which would send messages (Strings) from time to time to the client which is my Android Activity. The client would take a certain action based on the message received. I'm very new to socket programming of this kind so please bear with me.</p> <p>Currently, I'm using a PHP server script, running on a LAMPP server on Ubuntu that sends a client.html over to the Android app, which then shows the received messages using a WebView. I do not want to do this because this introduces an additional complexity of extracting the source of the html file and fishing information out of it. I tried using socket.io earlier but couldn't make it work. I don't understand why I need to use a client.html and if it's possible to just send a String message over the established connection. (Forgive my lack of knowledge here)</p> <p>Just for reference, this is the code I'm working with at present-</p> <p>Android Activity class file:</p> <pre><code>package com.example.websockettest; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends Activity { WebView wb; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); wb = (WebView)findViewById(R.id.webView1); wb.setWebViewClient(new WebViewClient()); wb.loadUrl("http://192.168.43.218/websocket/client/client.html"); //wb.loadUrl("http://192.168.0.108/websocket/client/client.html"); wb.getSettings().setJavaScriptEnabled(true); } @Override public 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; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } </code></pre> <p>Client code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Echo server - Websocket Demo&lt;/title&gt; &lt;style type="text/css"&gt; *{margin: 0; padding: 0;} body{ background-color: black; color: white; font-family: monospace; font-size: 16px; } #screen, #input{ padding: 10px; border: 1px solid #666; width: 650px; margin: 0 auto; } #screen{ margin-top: 10px; height: 300px; scroll: auto; } #screen p{ margin: 2px; } input, button{ font-size: 20px; padding: 3px; } .client{ color: green; font-weight: bold; } .server{ color: red; font-weight: bold; } &lt;/style&gt; &lt;script src="jquery-1.11.0.js"&gt;&lt;/script&gt; &lt;script&gt; // Client here var socket = null; var uri = "ws://192.168.43.218:2207"; function connect(){ socket = new WebSocket(uri); if(!socket || socket == undefined) return false; socket.onopen = function(){ //writeToScreen('Connected to server '+uri); } socket.onerror = function(){ ///\writeToScreen('Error!!!'); } socket.onclose = function(){ $('#send').prop('disabled', true); $('#close').prop('disabled', true); $('#connect').prop('disabled', false); writeToScreen('Socket closed!'); } socket.onmessage = function(e){ writeToScreen('&lt;span class="server"&gt;Server: &lt;/span&gt;'+e.data); } // Enable send and close button $('#send').prop('disabled', false); $('#close').prop('disabled', false); $('#connect').prop('disabled', true); } function close(){ socket.close(); } function writeToScreen(msg){ var screen = $('#screen'); screen.append('&lt;p&gt;'+msg+'&lt;/p&gt;'); screen.animate({scrollTop: screen.height()}, 10); } function clearScreen(){ $('#screen').html(''); } function sendMessage(){ if(!socket || socket == undefined) return false; var mess = $.trim($('#message').val()); if(mess == '') return; writeToScreen('&lt;span class="client"&gt;Client: &lt;/span&gt;'+mess); socket.send(mess); // Clear input $('#message').val(''); } $(document).ready(function(){ socket = new WebSocket(uri); if(!socket || socket == undefined) return false; //$('#message').focus(); //$('#frmInput').submit(function(){ // sendMessage(); //}); //$('#connect').click(function(){ connect(); //}); //$('#close').click(function(){ // close(); //}); //$('#clear').click(function(){ // clearScreen(); //}); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="frmInput" action="" onsubmit="return false;"&gt; &lt;div id="screen"&gt; &lt;p&gt;Demo echo server&lt;/p&gt; &lt;p&gt;----------------&lt;/p&gt; &lt;/div&gt; &lt;div id="input"&gt; &lt;input type="text" id="message" placeholder="Message here.."&gt; &lt;button type="submit" id="send" disabled&gt;Send&lt;/button&gt; &lt;button type="button" id="connect"&gt;Connect&lt;/button&gt; &lt;!--&lt;button type="button" id="close" disabled&gt;Close&lt;/button&gt; &lt;button type="button" id="clear"&gt;Clear&lt;/button&gt;--&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and finally, the server code:</p> <pre><code>&lt;?php require "PHP-Websockets/websockets.php"; class Server extends WebSocketServer { private $_connecting = 'Connecting to server..'; private $_welcome = 'Hello, welcome to echo server!'; protected function connected($user) { // Send welcome message to user $this-&gt;send($user, 'hi one'); $this-&gt;send($user, 'hi two'); $this-&gt;send($user, 'hi three'); $this-&gt;send($user, 'hi four'); } protected function process($user, $message) { // Upper case user message and send back to user $response = 'Upper case -&gt; ' . strtoupper($message); //$this-&gt;send($user, 'Server: ' . $response); } protected function closed($user) { // Alert on server echo "User $user-&gt;id closed connection".PHP_EOL; } public function __destruct() { echo "Server destroyed!".PHP_EOL; } } $addr = '192.168.43.218'; //'192.168.0.108'; $port = '2207'; $server = new Server($addr, $port); $server-&gt;run(); </code></pre> <p>I need to keep this very simple and straightforward. How can I build a simple PHP/Node.js server script that could communicate with a java client file on my Android app and receive messages? A detailed explanation of how can I approach this will be most appreciated!</p> </div>

如何用appcan编写的应用调用显示写好的安卓应用的页面

事先用安卓写好了一个应用,现在想在appcan中显示事先写好的安卓应用的页面,该如何在appcan中调用并且显示出安卓应用的页面呢

请大神帮我看看androi代码,UDP通信是能发,不能收,程序一直卡在收包那个点。怎么解决?

主进程: import android.support.v7.app.ActionBarActivity; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; public class YuntuActivity extends ActionBarActivity implements OnClickListener { private TextView adSpeed; private TextView reSpeed; private TextView reTxt; private Button btnHeadCar; private Button btnAgree; private Button btnApply; private Button btnStart; private Button btnExit; //自定义变量 private String remoteIP = null; private int rePort = 0; private int loPort = 0; private UDPThread reTxtThread = null; private UDPThread adSpeedThread = null; private UDPThread reSpeedThread = null; private String sendStr = null;//发送的字符串 private String receStr = null; Handler mhander = new Handler() { public void handleMessage(Message msg) { Bundle bundle =new Bundle(); bundle = msg.getData(); receStr = bundle.getString("info"); reTxt.setText(receStr); } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_yuntu); //初始化UI initUI(); //初始化 init(); reTxtThread = new UDPThread(mhander); } private void init() { remoteIP = "172.22.130.124"; rePort = 8801; loPort = 8805; } //初始化UI private void initUI() { adSpeed =(TextView)findViewById(R.id.AdSpeed); reSpeed =(TextView)findViewById(R.id.ReSpeed); reTxt =(TextView)findViewById(R.id.reTxt); btnHeadCar =(Button)findViewById(R.id.button1); btnAgree =(Button)findViewById(R.id.button2); btnApply =(Button)findViewById(R.id.button3); btnStart =(Button)findViewById(R.id.button4); btnExit =(Button)findViewById(R.id.button5); } @Override public void onClick(View v) { switch (v.getId()) { //点击 同意入队 按钮 case R.id.button1: sendStr = "you can join in flownteam."; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击 申请入队按钮 case R.id.button2: sendStr = "Can I join in?"; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击申请离队按钮 case R.id.button3: sendStr = "Can I exit?"; if(!sendStr.trim().equals("")) { reTxtThread.sendData(sendStr); } break; //点击开始监听按钮 case R.id.button4: reTxtThread.setReomteIP(remoteIP); reTxtThread.setRePort(rePort); reTxtThread.setLoPort(loPort); boolean connResult = reTxtThread.connectSocket(); if(connResult) { Toast.makeText(getApplicationContext(), "链接建立完毕!", Toast.LENGTH_SHORT).show(); } break; //点击关闭监听按钮 case R.id.button5: reTxtThread.disConnectSocket(); Toast.makeText(getApplicationContext(), "链接已经关闭!", Toast.LENGTH_SHORT).show(); break; default: break; } } } 子线程:发送,接收UDP包 package com.example.cqput_yuntu2; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.SocketException; import java.text.SimpleDateFormat; import java.util.Date; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.widget.TextView; public class UDPThread implements Runnable { // 定义变量 private TextView rTextView = null; private String reomteIP = null; private int rePort = 0; private int loPort = 0; private Thread rThread = null; private static String CHARECTER = "UTF-8"; private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); // 接收 private byte[] rBuffer = new byte[1024]; private DatagramSocket rSocket = null; private DatagramPacket rPacket = null; private String rStr = null; // 发送 private DatagramSocket sSocket = null; private DatagramPacket sPacket = null; private byte[] sBuffer = new byte[1024]; public Handler mhandler; public UDPThread(Handler handler) { mhandler = handler; } @Override public void run() { // 开始接收数据 Looper.prepare(); if (Thread.currentThread() == rThread) { System.out.println("------jieshouqian"); rStr = receiveData(); System.out.println("------jieshouhou"); Message toMain = mhandler.obtainMessage(); Bundle bundle = new Bundle(); bundle.putString("info", rStr); toMain.setData(bundle); mhandler.sendMessage(toMain); } ; try { Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // 开始接收数据 private String receiveData() { try { ByteArrayInputStream bais = new ByteArrayInputStream(rBuffer); DataInputStream dis = new DataInputStream(bais); if (rSocket == null) { rSocket = new DatagramSocket(8805); } if (rPacket == null) { rPacket = new DatagramPacket(rBuffer, rBuffer.length); } System.out.println("----rece"); rSocket.receive(rPacket); System.out.println("------receHou"); rStr = dis.readUTF().trim(); System.out.println("------jieBeg"); rStr = String.format("[%s:%d//%s]%s", rPacket.getAddress() .getHostAddress(), rPacket.getPort(), sdf .format(new Date()), rStr); return rStr; } catch (Exception e) { e.printStackTrace(); System.out.println("-----------------recvdata error:" + e.getMessage()); } return null; } // 建立连接 public boolean connectSocket() { boolean result = false; // 开启一个新的线程 startThread(); System.out.print("监听线程开启"); result = true; return result; } // 关闭连接 public void disConnectSocket() { if (rSocket != null) { rSocket.close(); rSocket = null; } if (rPacket != null) { rPacket = null; } // 关闭线程 stopThread(); } // 关闭线程 private void stopThread() { if (rThread != null) { rThread.stop(); rThread = null; } } // 开启新的线程 private void startThread() { if (rThread == null) { rThread = new Thread(this); rThread.start(); } } // 开始发送数据 public void sendData(String sendStr) { try { // 包装数据 ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeUTF(sendStr); sBuffer = baos.toByteArray(); if (sSocket == null) { sSocket = new DatagramSocket(); } if (sPacket == null) { sPacket = new DatagramPacket(sBuffer, sBuffer.length, InetAddress.getByName(reomteIP), rePort); } sSocket.send(sPacket); sSocket.close(); sSocket = null; sPacket = null; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); sSocket.close(); sSocket = null; sPacket = null; System.out.println("senddata error:" + e.getMessage()); } } public void setReomteIP(String reomteIP) { this.reomteIP = reomteIP; } public void setRePort(int rePort) { this.rePort = rePort; } public void setLoPort(int loPort) { // this.loPort = loPort; } }

如何在Java Applet和PHP服务器之间进行套接字通信?

<div class="post-text" itemprop="text"> <blockquote> <p>Can I use PHP modules, such as the one found in PEAR's <code>Net_Socket</code> library, to have socket communications to a client-side in-browser Java Applet (presumably using <code>java.net.Socket</code>)? If so, how? Perhaps an example somewhere?</p> </blockquote> <p>The reason here being a two parter: 1) With the popularity of Java apps on mobiles devices I can make a Java program once, and it can be easily ported to a mobile app from Java applet when the time comes. and 2) cheap shared web hosting doesn't typically support custom Java servers (not even Node.js). So, I'm looking for a way to make a server for my Java apps with socket based communication. With this in mind, there is then a less specific question (optional):</p> <p>Is there any way, or a preferred way, (say using CGI/Perl, PHP/Python) to setup socket communications between the free services found on a cheap web host and my client-side Java apps?</p> <p>(for instance, say I'm trying to make a simple chat room)</p> <p>NOTE: I did find this question: <a href="https://stackoverflow.com/questions/2259438/how-to-implement-communication-between-java-client-application-android-and-php?rq=1">How to implement communication between Java client application (Android) and PHP server application?</a> But it doesn't apparently involve sockets. So a chat room would require the client to pole.</p> </div>

FTP存储传递和PHP安全通信

<div class="post-text" itemprop="text"> <p>i have two questions...both of them are about security issues on android app..</p> <ol> <li><p>From my app are photos sent to my ftp server,so i need to have stored ftp,user and pass..what is the best way to to that? I am affraid that these values can be easily read from code by reverse engineering..i was thinking about shared preferences but i think it is not enouhg...or to send request to my server which returns pass to ftp server (this is part of second question:)</p></li> <li><p>In app a communicate with php server (create order then in app biling and finally confirmation that order was already paid...i have to write secure communication between android and php..(now android send json data by post method to php server..so if somebody cinds out url and json format of data..he is could create ordef and confirm it)..in app is no login or registration process..i was thinking abou asymetric cryptography with public key on android and private key on server..or maybe SSL is a solution..i am very confused so any advices are welcome..</p></li> </ol> <p>I dont know how to secure app whne reverse engineering of apk is possible..</p> </div>

保护客户端 - 服务器通信免受泄漏

<div class="post-text" itemprop="text"> <p>I'm developing an android application that communicates with my server. That server provide information through a get (or post), and the application display these information.</p> <p>The question I want to make is if it's possible to make this connection "safe", I mean, I want to provide information only to the user who use MY application. I make an example, I've a website, if you visit this page:</p> <pre><code>http://mywebsite.com/APP/get.php?a=23123 </code></pre> <p>You'll get useful information that i want to display into my app. The problem is that everyone can make it's own app that connect itself to my website, and get these information. Is possible to check via server who is using my application and who is trying to get only the information from another thing that isn't my app?</p> </div>

如何构建一个可以从全球移动通信系统(GSM)拨打和接听电话的应用程序?

<div class="post-text" itemprop="text"> <p><strong>How can I build an App that makes and receives Calls from Global System for Mobile communication (GSM)?</strong></p> <p>I need to build an App from Scratch that can originate and terminate calls to GSM technology.</p> <p>I have no prior strong programming skills.</p> <p>I would appreciate if i get to know the end to end technology associated and have any source code if it does exist.</p> </div>

C#PHP通信

<div class="post-text" itemprop="text"> <p>I'm writing an app that will authenticate user from a MySQL database. I have written it in Java (android) but am now porting to Windows phone.</p> <p>the PHP file uses $get and then echoes the response:</p> <pre><code>$localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database_localhost, $localhost); $username = $_POST['username']; $query_search = "select * from users where user = '".$username."'"; //$query_search = "select * from users where username = '".$username."' AND password = '".$password. "'"; $query_exec = mysql_query($query_search) or die(mysql_error()); $rows = mysql_num_rows($query_exec); //echo $rows; if($rows == 0) { echo "No Such User Found"; } else { echo "User Found"; } </code></pre> <p>How can I pass the username variable to PHP and then receive the result?</p> </div>

将实时网络摄像头源编码为RTMP编码视频

<div class="post-text" itemprop="text"> <p>I am working on a concept where people can go live using their webcam. So basically it's a web app. I am using webRTC concept. My code is pretty basic but still have a look :</p> <pre><code>&lt;script&gt; (function () { console.log('here'); navigator.getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; window.hasUserMedia = function hasUserMedia() { return navigator.getMedia ? true : false; }; var errorcallback = function (e) { console.log('errorCalback: ' + e); }; navigator.getMedia({ video: true, audio: true }, function (stream) { var video = document.getElementById('live'), webcamstream, streamrecorder, vendorUrl = window.URL || window.webkitURL; console.log(video); video.src = vendorUrl.createObjectURL(stream); //webcamstream = stream; //video.play(); video.onloadedmetadata = function (e) { var counter = 0; counter++; console.log(e); console.log(video.src); }; }, errorcallback); })(); </code></pre> <p></p> <p>This <code>video.src</code> gives a source but i think it's in blob format.</p> <p>the output is something like <code>mediastream:http://localhost.movyt.com/8b57e486-a985-4331-b9ab-0eaf6def3404</code>. Well blob formats can't be published. We need to encode it to RTMP encoded. My question is how would i encode it with out any third party softwares because as a end user i will not likely install any software for signing up a website.</p> <p>I tried with flash for live streaming but there is a need to install <strong>flash live encoder</strong> which i don't want to use as it won't be user friendly. There are pretty dedicated servers like wowza, dacast and all but they need RTMP encoded video streams for further processing .</p> <p>note: I tried with a <code>&lt;video src=video.src&gt;</code> in another page but it won't fruit into any result because as per the previous code written <code>video.src</code> is coming from <code>video metadata</code>.</p> <p><strong>So is there any way to encode my blob video to RTMP protocol?</strong></p> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

阿里面试官让我用Zk(Zookeeper)实现分布式锁

他可能没想到,我当场手写出来了

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

2020春招面试了10多家大厂,我把问烂了的数据库事务知识点总结了一下

2020年截止目前,我面试了阿里巴巴、腾讯、美团、拼多多、京东、快手等互联网大厂。我发现数据库事务在面试中出现的次数非常多。

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

在拼多多上班,是一种什么样的体验?我心态崩了呀!

之前有很多读者咨询我:武哥,在拼多多上班是一种什么样的体验?由于一直很忙,没抽出时间来和大家分享。上周末特地花点时间来写了一篇文章,跟大家分享一下拼多多的日常。 1. 倒时差的作息 可能很多小伙伴都听说了,拼多多加班很严重。这怎么说呢?作息上确实和其他公司有点区别,大家知道 996,那么自然也就能理解拼多多的“11 11 6”了。 所以当很多小伙伴早上出门时,他们是这样的: 我们是这样的: 当...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

太狠了,疫情期间面试,一个问题砍了我5000!

疫情期间找工作确实有点难度,想拿到满意的薪资,确实要点实力啊!面试官:Spring中的@Value用过么,介绍一下我:@Value可以标注在字段上面,可以将外部配置文件中的数据,比如可以...

立即提问
相关内容推荐