android中的幾種IPC方式

1. 使用Bundle

  1. 由于Bundle實(shí)現(xiàn)了Parcelable接口,所以在四大組件中的三大組件(Activity, Service, Receiver)都支持在Intent中傳遞Bundle.就可以在Bundle中附加我們需要的信息通過Intent發(fā)送出去. 當(dāng)然傳遞的類型必須是能夠被序列化的,
  2. 這個(gè)地方有一個(gè)疑問,intent也可以傳輸數(shù)據(jù)啊,為啥還要用bundle呢?
    • 解釋是:bundle的內(nèi)部實(shí)現(xiàn)是一個(gè)hashMap.一個(gè)容器將要傳輸?shù)臄?shù)據(jù)裝起來然后做傳輸,如果使用intent則需要一個(gè)一個(gè)傳輸,如果此數(shù)據(jù)需要從A傳到B然后傳入C,那么用bundle就很方便了,而對(duì)于intent則還需要在B取出,然后在轉(zhuǎn)入..
  3. 由于Bundle使用很簡(jiǎn)單就不展示代碼了;

2. 使用文件共享

  1. 原理:兩個(gè)進(jìn)程通過讀/寫同一個(gè)文件來交換數(shù)據(jù). 例如進(jìn)程A把數(shù)據(jù)寫入文件中,而進(jìn)程B從文件中讀取出來數(shù)據(jù).
  2. 需要注意的點(diǎn):文件共享適合在對(duì)數(shù)據(jù)同步要求不高的進(jìn)程之間進(jìn)行通信,并且要妥善的處理并發(fā)讀寫的問題.
  3. SharePreferencess是Android提供的一個(gè)輕量級(jí)方案,通過鍵值對(duì)存儲(chǔ)數(shù)據(jù),底層采用XML文件來進(jìn)行存儲(chǔ). 存儲(chǔ)路徑/data/data/package name/shared_prefs目錄下. 也屬于文件的一種,但是由于系統(tǒng)對(duì)SP的讀寫存在一定的緩存策略,內(nèi)存中會(huì)有一份緩存,所以多進(jìn)程下,系統(tǒng)對(duì)它的讀寫也就變得不可靠.
  4. 文件共享,使用sp就是比較好的例子,sp的使用也比較簡(jiǎn)單就不列出了

3. 使用Messenger

  1. Messenger(信使). 不同的進(jìn)程中可以傳遞Message對(duì)象, 在Message中放入我們需要傳遞的數(shù)據(jù),就可實(shí)現(xiàn)進(jìn)程間傳遞. Messenger是一種輕量級(jí)的IPC方案,它的底層實(shí)現(xiàn)AIDL.

  2. 具體實(shí)現(xiàn),共分為四部:

    1. 客戶端進(jìn)程創(chuàng)建兩個(gè) Messenger,一個(gè) Sender ,一個(gè) Receiver;

           private Messenger mGetReplyMessenger =  new Messenger(new Handler(){
      
           @Override
           public void handleMessage(Message msg) {
               switch (msg.what){
                   case 0:
                       Log.d(TAG, "handleMessage: 這里是客戶端:::"+msg.getData().getString("reply"));
                       break;
                   default:
                       super.handleMessage(msg);
               }
           }
       });
      
          private ServiceConnection mConnection = new ServiceConnection() {
       
             @Override
               public void onServiceConnected(ComponentName componentName,   IBinder iBinder) {
             mMessenger = new Messenger(iBinder);
             Message message = Message.obtain(null, 1);
      
             Bundle bundle = new Bundle();
             bundle.putString("msg","wo shi 客戶端");
      
             message.setData(bundle);
            message.replyTo= mGetReplyMessenger;
      
             try {
                 mMessenger.send(message);
             } catch (RemoteException e) {
                 e.printStackTrace();
             }
      
         }
      
         @Override
         public void onServiceDisconnected(ComponentName componentName) {
      
         }
          };
      
    2. 綁定服務(wù),由于在不同的應(yīng)用中所以采用隱士啟動(dòng)方式:

          Intent intent = new Intent();
       intent.setAction("com.lemon.service");
       intent.setComponent(new ComponentName("com.lemon.messgagertest","com.lemon.messgagertest.MessagerService"));
       bindService(intent, mConnection,BIND_AUTO_CREATE);
      

    注意:采用隱士啟動(dòng)的時(shí)候,需要設(shè)置 intent.setComponent(),不然會(huì)報(bào)錯(cuò),找不到;

    1. 服務(wù)端,接受信息,然后處理,然后返回:

       private Messenger mMessenger = new Messenger(new Handler(){
           @Override
           public void handleMessage(Message msg) {
      
               switch (msg.what){
                   case 1:
                       Log.e(TAG,"receive msg from client "+msg.getData().getString("msg"));
                       Messenger client = msg.replyTo;
                       Message message = Message.obtain(null, 0);
                       Bundle bundle = new Bundle();
                       bundle.putString("reply","消息已收到,稍后回復(fù)");
                       message.setData(bundle);
      
                       try {
                           client.send(message);
                       } catch (RemoteException e) {
                           e.printStackTrace();
                       }
                       break;
                   default:
                       super.handleMessage(msg);
               }
      
           }
       });
      
    2. 配置xml文件:

        <service android:name=".MessagerService"
                android:process=":remote">
           <intent-filter>
               <action android:name="com.lemon.service"></action>
           </intent-filter>
           </service>
      
  3. Messenger使用很簡(jiǎn)單,但是有局限性,因?yàn)镸essenger對(duì)AIDL進(jìn)行了封裝,使得在使用時(shí)更加簡(jiǎn)單,并且它的處理方式是一次處理一個(gè)請(qǐng)求,因此服務(wù)器端不用考慮線程同步因?yàn)榉?wù)端不存在并發(fā)執(zhí)行的情形.

  4. 在使用Messenger進(jìn)行數(shù)據(jù)傳遞必須將數(shù)據(jù)放入到Message中. 而Messenger和Message都實(shí)現(xiàn)了序列化接口. 所以可以在進(jìn)程間通信.

4. 使用AIDL

  1. 雖然Messenger使用方便, 但是要清楚它是以串行的方式處理客戶端發(fā)來的消息,如果有大量并發(fā)的請(qǐng)求. 或者需求是跨進(jìn)程調(diào)用服務(wù)端的方法時(shí). 就無法使用Messenger. 這個(gè)時(shí)候就該AIDL

  2. 對(duì)于使用AIDL的流程簡(jiǎn)單梳理一遍

    1. 服務(wù)端
      • 服務(wù)端創(chuàng)建一個(gè)Service用來監(jiān)聽客戶端的連接請(qǐng)求, 然后創(chuàng)建一個(gè)AIDL文件,將暴露給客戶端的接口在這個(gè)AIDL文件中聲明,最后在Service中實(shí)現(xiàn)這個(gè)AIDL接口并在onBind()返回即可.
    2. 客戶端
      • 綁定服務(wù)端的Service,綁定成功后,將服務(wù)端返回來的Binder對(duì)象轉(zhuǎn)成AIDL接口所屬的類型,接著就可以直接調(diào)用AIDL中的方法了.
  3. 具體的實(shí)現(xiàn)

    1. AIDL 文件

      Book.aidl

       package com.lemon.bookaidl;
       parcelable Book;
      

      IBookManger.aidl

       package com.lemon.bookaidl;
      
       // Declare any non-default types here with import statements
       import com.lemon.bookaidl.book;
       import com.lemon.bookaidl.IOnBookArrivedListener;
       interface IBookManger {
      
       List<Book> getBookList();
       void addBook(in Book book);
       void registerListener(IOnBookArrivedListener listener);
       void unregisterListener(IOnBookArrivedListener listener);
       }
      

      IOnBookArrivedListener.aidl

       package com.lemon.bookaidl;
       
       // Declare any non-default types here with import statements
       import com.lemon.bookaidl.book;
       interface IOnBookArrivedListener {
       
       void IOnBookArriverListener(in Book book);
       }
      
    2. 服務(wù)端:

             public class BookMangerService extends Service {  
               private static final String                                     TAG                 = "BookMangerService";
             private              AtomicBoolean                              mIsServiceDestoryed = new AtomicBoolean(false);
             private              CopyOnWriteArrayList<Book>                 mBookList           = new CopyOnWriteArrayList<Book>();
             private              RemoteCallbackList<IOnBookArrivedListener> mListeners          = new RemoteCallbackList<>();
               private Binder mBinder = new IBookManger.Stub() {
               @Override
                   public List<Book> getBookList() throws RemoteException {
                     return mBookList;
                   }
      
                 @Override
                   public void addBook(Book book) throws RemoteException {
                   mBookList.add(book);
                   }
      
                   @Override
                       public void registerListener(IOnBookArrivedListener listener) throws RemoteException {
                         mListeners.register(listener);
                       }
      
                     @Override
                     public void unregisterListener(IOnBookArrivedListener listener) throws RemoteException {
                       mListeners.unregister(listener);
                       }
                       };
      
                     @Nullable
                     @Override
                       public IBinder onBind(Intent intent) {
                       return mBinder;
                     }
      
                         @Override
                       public void onCreate() {
                           super.onCreate();
      
                           mBookList.add(new Book(1,"Android"));
                             mBookList.add(new Book(2, "Ios"));
                         new Thread(new serviceWork()).start();
                           }
      
                             private class serviceWork implements Runnable {
                           @Override
                               public void run() {
                                   while (!mIsServiceDestoryed.get()){
                                     try {
                                           Thread.sleep(5000);
                                           } catch (InterruptedException e) {
                                               e.printStackTrace();
                                                 }
      
                               int bookId = mBookList.size()+1;
                               Book newBook = new Book(bookId,"#new Book"+bookId);
      
                                       try {
                                         onNewBookArrived(newBook);
                                         } catch (RemoteException e) {
                                         e.printStackTrace();
                                             }
                                               }
                                           }
                                           }
      
                                         private void onNewBookArrived(Book newBook)                           throws RemoteException {
                     mBookList.add(newBook);
      
                     final int N = mListeners.beginBroadcast();
                     Log.e("onNewBookArrived","registener listener size:" + N);
      
                         for (int i = 0 ;i<N ;i++){
                          IOnBookArrivedListener l = mListeners.getBroadcastItem(i);
                            if (l!=null){
                               l.IOnBookArriverListener(newBook);
                                  }
                                }
      
                           mListeners.finishBroadcast();
                                              }
      
                            @Override
                            public void onDestroy() {
                                 mIsServiceDestoryed.set(true);
                              super.onDestroy();
                                         }
                                  }
      
  4. 客戶端

             public class MainActivity extends AppCompatActivity {       
                   private static final String TAG = "MainActivity";
     
                 private static final int MESSAGE_NEW_BOOK_ARRIVED = 1;
                 private IBookManger mIBookManger;
     
                 private android.os.Handler mHandler = new android.os.Handler(){
             @Override
                   public void handleMessage(Message msg) {
     
                 switch (msg.what){
                     case MESSAGE_NEW_BOOK_ARRIVED:
                         Log.e(TAG, "received new book:" + msg.obj);
                         break;
                     default:
                         super.handleMessage(msg);
     
                 }
             }
         };
     
         private ServiceConnection mServiceConnection = new ServiceConnection() {        
             @Override
             public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
                 mIBookManger = IBookManger.Stub.asInterface(iBinder);
                 try {
                     List<Book> bookList = mIBookManger.getBookList();
                     Log.e(TAG, "query book list,list type:" + bookList.getClass().getCanonicalName());
                     Log.e(TAG, "query book list:" + bookList.toString());
     
                     Book newBook = new Book(3, "android進(jìn)階");
                     mIBookManger.addBook(newBook);
     
                     Log.e(TAG, "add book:" + newBook);
                     List<Book> newList =  mIBookManger.getBookList();
                     Log.e(TAG, "query book list:" + newList.toString());
                     mIBookManger.registerListener(mIOnBookArrivedListener);
                 } catch (RemoteException e) {
                     e.printStackTrace();
                 }
             }
     
             @Override
             public void onServiceDisconnected(ComponentName componentName) {
                 }
         };
     
         private IOnBookArrivedListener mIOnBookArrivedListener = new IOnBookArrivedListener.Stub() {
             @Override
             public void IOnBookArriverListener(Book book) throws RemoteException {
                 mHandler.obtainMessage(MESSAGE_NEW_BOOK_ARRIVED,book).sendToTarget();
             }
         };
         @Override
         protected void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.activity_main);
     
             bindService();
     
         }
     
         private void bindService() {
             Intent intent = new Intent();
             intent.setAction("com.lemon.bookservice");
             intent.setComponent(new ComponentName("com.lemon.bookaidl","com.lemon.bookaidl.BookMangerService"));
             bindService(intent,mServiceConnection, Context.BIND_AUTO_CREATE);
         }
     
         @Override
         protected void onDestroy() {
             if (mIBookManger != null && mIBookManger.asBinder().isBinderAlive()){
                 Log.e(TAG, "unregister listener:" + mIOnBookArrivedListener);
                 try {
                     mIBookManger.unregisterListener(mIOnBookArrivedListener);
                 } catch (RemoteException e) {
                     e.printStackTrace();
                 }
             }
             unbindService(mServiceConnection);
             super.onDestroy();
         }   
             }   
    
  5. 幾個(gè)點(diǎn)得理解:

    1. CopyOnWriteArrayList:支持并發(fā)的讀寫,這里我們使用它來進(jìn)行自動(dòng)的線程同步;
    2. RemoteCallBackList:是系統(tǒng)專門提供的用于刪除跨進(jìn)程listener的接口:它的工作原理其實(shí)很簡(jiǎn)單:在它的內(nèi)部有一個(gè)Map結(jié)構(gòu)專門用來保存所有AIDL回調(diào)3. 這個(gè)例子涉及到的東西比較多,如果剛接觸可以參考點(diǎn)簡(jiǎn)單的例子,就實(shí)現(xiàn)個(gè)遠(yuǎn)程服務(wù)進(jìn)行計(jì)算,而client獲取到結(jié)果的這種,實(shí)現(xiàn)特別簡(jiǎn)單,主要看你怎么理解

5. 使用ContentProvider

  1. ContentProvider是Android提供專門用于不用應(yīng)用進(jìn)行數(shù)據(jù)共享的方式. 它的底層同樣也是Binder. 因?yàn)橄到y(tǒng)封裝, 所以它的使用比起AIDL要簡(jiǎn)單很多.
  2. 要實(shí)現(xiàn)一個(gè)內(nèi)容提供者, 只需要寫一個(gè)類繼承ContentProvider,并復(fù)寫六個(gè)抽象方法. 其中有四個(gè)是CURD操作方法. 一個(gè)onCreate()用來做初始化. 一個(gè)getType()用來返回一個(gè)Uri請(qǐng)求所對(duì)應(yīng)的MIME類型,比如圖片還是視頻等. 如果我們不關(guān)心那么可是直接返回NULL或者

6. 使用Socket

  1. Socket也稱為套接字. 是網(wǎng)絡(luò)通信中的概念, 它分為流式套接字和用戶數(shù)據(jù)包套接字兩種. 分別對(duì)應(yīng)于網(wǎng)絡(luò)的傳輸控制層中TCP和UDP協(xié)議.
socket實(shí)現(xiàn)IPC.png
客戶端:

            public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private static final String TAG="MainActivity";
        private Button mSend;
        private EditText mInput;
        private TextView mMessage;
        private Socket mClientSocket;
        private PrintWriter mPrintWriter;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            initView();
    
    
    
        }
    
        private void initView() {
    
            mMessage = (TextView) findViewById(R.id.tv_message);
            mInput = (EditText) findViewById(R.id.et_input);
            mSend = (Button) findViewById(R.id.bt_send);
    
            mSend.setOnClickListener(this);
    
            Intent service = new Intent(this, SocketService.class);
            startService(service);
            new Thread(){
                @Override
                public void run() {
                    connectTCPserver();
                }
            }.start();
        }
    
        private void connectTCPserver() {
    
            Socket socket=null;
            while (socket==null) {
                try {
                    socket = new Socket("localhost", 8888);
                    mClientSocket = socket;
                    mPrintWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);
                } catch (IOException e) {
                    SystemClock.sleep(1000);
                }
            }
    
    
    
    
                try {
                    BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                    while (!isFinishing()){
                        String msg = br.readLine();
                        if (msg!=null){
                            String time = formateDateTime(System.currentTimeMillis());
                            Log.e(TAG,"客戶端收到信息:"+msg+"  at:"+time);
                        }
                    }
    
                    mPrintWriter.close();
                    br.close();
                    socket.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
    
        }
    
        private String formateDateTime(long l) {
            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(l));
        }
    
        @Override
        public void onClick(View view) {
            if (view== mSend) {
                final String msg = mInput.getText().toString();
                if (!TextUtils.isEmpty(msg) && mPrintWriter != null) {
                    //像服務(wù)器發(fā)送信息
                    Log.e(TAG,"client has send '" + msg + "' at " + formateDateTime(System.currentTimeMillis()));
                    mPrintWriter.println(msg);
                    mInput.setText("");
                }
            }
        }
    
    
        @Override
        protected void onDestroy() {
            if (mClientSocket != null) {
                try {
                    mClientSocket.shutdownInput();
                    mClientSocket.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            super.onDestroy();
        }
    }
服務(wù)端:

    public class SocketService extends Service {
        private static final String TAG= "SocketService";
        private boolean mIsSocketServiceDestory=false;
    
    
        @Override
        public void onCreate() {
    
            new Thread(new TcpServer()).start();
            super.onCreate();
        }
    
        @Nullable
        @Override
        public IBinder onBind(Intent intent) {
            return null;
        }
    
    
        @Override
        public void onDestroy() {
            mIsSocketServiceDestory=true;
            super.onDestroy();
        }
    
        private class TcpServer implements Runnable{
    
            @Override
            public void run() {
                 ServerSocket mServerSocket;
                try {
                    mServerSocket = new ServerSocket(8888);
                } catch (IOException e) {
                    e.printStackTrace();
                    return;
                }
    
                while (!mIsSocketServiceDestory){
    
                    try {
                        final Socket accept = mServerSocket.accept();
    
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
                                try {
                                    replyClient(accept);
                                } catch (IOException e) {
                                    e.printStackTrace();
                                }
                            }
    
    
                        }).start();
    
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    
        private void replyClient(Socket accept) throws IOException {
            BufferedReader input = new BufferedReader(new InputStreamReader(accept.getInputStream()));
    
            PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(accept.getOutputStream())),true);
    
            while (!mIsSocketServiceDestory){
                String line = input.readLine();
                if (line==null)break;
    
                Log.e(TAG,"## reveive msg :"+line);
    
                String message = "server has received your message:"+line;
                out.println(message);
            }
    
            out.close();
            input.close();
            accept.close();
    
        }
    }

7. sharedUserId

sharedUserId的作用是讓兩個(gè)應(yīng)用程序共享一個(gè)user id,我們都知道Linux進(jìn)程給每一個(gè)應(yīng)用程序分配了一個(gè)獨(dú)立的user id,所以如果兩個(gè)或多個(gè)應(yīng)用程序的簽名相同并且設(shè)置了一樣的sharedUserId,他們將會(huì)共享一個(gè)user id,相同user id的應(yīng)用程序可以訪問對(duì)方的數(shù)據(jù)(也就是說如果應(yīng)用程序中的一個(gè)文件的權(quán)限是600,相同uid可以直接訪問,反之則無法訪問),并且設(shè)置成一個(gè)Android:process就能夠運(yùn)行在一個(gè)進(jìn)程中了。

  1. sharedUserId方式主要就是使用createPackageContext (String packageName, int flags)函數(shù),該函數(shù)用來返回指定包名應(yīng)用的上下文,注意是application的context。
  2. 注意里面的兩個(gè)參數(shù),尤其是第二個(gè):這個(gè)flag,有CONTEXT_INCLUDE_CODE和CONTEXT_IGNORE_SECURITY兩個(gè)選項(xiàng),CONTEXT_INCLUDE_CODE的作用就是在調(diào)用者的進(jìn)程執(zhí)行該應(yīng)用的代碼,也就是說可以使用getClassLoader()函數(shù)來初始化該application的相關(guān)類,如果需要加載的application不能被安全的加載進(jìn)進(jìn)程的話,將會(huì)拋出一個(gè)SecurityException,如果這個(gè)標(biāo)示沒有被設(shè)置,那么將不會(huì)在被加載的類上面施加任何約束,getClassLoader()將會(huì)返回默認(rèn)的系統(tǒng)類加載器;CONTEXT_IGNORE_SECURITY的意思是忽略任何安全警告,和CONTEXT_INCLUDE_CODE標(biāo)識(shí)一起使用可能會(huì)將不安全的代碼加載進(jìn)進(jìn)程,所以謹(jǐn)慎使用。

1. 獲取client應(yīng)用的context

            context=createPackageContext("com.lemon.shareuidclient",CONTEXT_INCLUDE_CODE|CONTEXT_IGNORE_SECURITY);
        tv_context.setText(context.toString());

2. 獲取client應(yīng)用的drawable圖片

     int id = context.getResources().getIdentifier("android_boot","drawable","com.lemon.shareuidclient");
            iv_pic.setImageDrawable(ContextCompat.getDrawable(context,id));

3. 獲取client應(yīng)用的string中得值

     int ie = context.getResources().getIdentifier("lemon","string","com.lemon.shareuidclient");
     tv_string.setText(context.getString(ie));

4. 打開client應(yīng)用的activity

     Intent intent = new Intent();
            intent.setComponent(new ComponentName("com.lemon.shareuidclient","com.lemon.shareuidclient.MainActivity"));
            startActivity(intent);

5. 調(diào)用client中得方法

 try {
                Class clazz = context.getClassLoader().loadClass("com.lemon.shareuidclient.Method");
                Object instance    = clazz.newInstance();
                int [] arr= new int []{3,4,5,6};

                    int sum = (int) clazz.getMethod("add",int[].class).invoke(instance,arr);
                    tv_sum.setText(" sum: ="+sum);
                } catch (Exception e) {
                    e.printStackTrace();
                }

6. 獲得client中得sharepreference

       SharedPreferences lemon = context.getSharedPreferences("lemon", MODE_MULTI_PROCESS);
       String string = lemon.getString("adress", "china");
       tv_shared_preference.setText(string );

由于SharedPreferences是有緩存機(jī)制的,所以如果在B應(yīng)用中修改了該SharedPreferences文件,接著A應(yīng)用去讀取該文件中修改的那個(gè)值,這時(shí)你會(huì)發(fā)現(xiàn)還是修改前的值,這就是緩存機(jī)制導(dǎo)致的問題,不過有一個(gè)flag可以解決這個(gè)問題:MODE_MULTI_PROCESS,但是非常不幸的是api23已經(jīng)將該標(biāo)識(shí)deprecated了,原因是在一些版本上不可靠,有興趣的可以去了解一下;

8.對(duì)比

image.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 230,501評(píng)論 6 544
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 99,673評(píng)論 3 429
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 178,610評(píng)論 0 383
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我,道長(zhǎng),這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,939評(píng)論 1 318
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 72,668評(píng)論 6 412
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 56,004評(píng)論 1 329
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼。 笑死,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 44,001評(píng)論 3 449
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 43,173評(píng)論 0 290
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 49,705評(píng)論 1 336
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 41,426評(píng)論 3 359
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 43,656評(píng)論 1 374
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 39,139評(píng)論 5 364
  • 正文 年R本政府宣布,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 44,833評(píng)論 3 350
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,247評(píng)論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,580評(píng)論 1 295
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 52,371評(píng)論 3 400
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 48,621評(píng)論 2 380

推薦閱讀更多精彩內(nèi)容