android_Media操作/桌面共享







  mActivity.managedQuery()方法废弃,被CursorLoader取代。
  Adapter接口中,有registerDataSetObserver(DataSetObserver observer) 和 unregisterDataSetObserver(**) 方法。
  OnSharedPreferenceChangeListener接口中,有onSharedPreferenceChanged()方法。
  MediaStore --> Object. The Media provider contains meta data for all available media on both internal and external storage devices.
  MediaStore.Images --> Object.  Contains meta data for all available images.
  MediaStore.Images.Thumbnails --> Object.    This class allows developers to query and get two kinds of thumbnails: MINI_KIND: 512 x 384 thumbnail MICRO_KIND: 96 x 96 thumbnail
  MediaStore.Audio.AudioColumns, MediaStore.Audio.Genres.Members, MediaStore.Audio.Media, MediaStore.Audio.Playlists.Members, MediaStore.Files.FileColumns, MediaStore.Images.ImageColumns, MediaStore.Images.Media, MediaStore.Video.Media, MediaStore.Video.VideoColumns --> MediaStore.MediaColumns  --> Object.  Fields for MediaProvider tables

 
  MediaCodecList --> Object.  Allows you to enumerate available codecs, each specified as a MediaCodecInfo object, find a codec supporting a given format and query the capabilities of a given codec.
  MediaCodecInfo --> Object.
  MediaFormat --> Object. Encapsulates the information describing the format of media data, be it audio or video. The format of the media data is specified as string/value pairs. Keys common to all audio/video formats, all keys not marked optional are mandatory.
  mMediaCodec.dequeueInputBuffer(**);  //After filling a range of the input buffer at the specified index submit it to the component. //client端,解码生成屏幕
  mMediaCodec.dequeueOutputBuffer(**); //Dequeue an output buffer, block at most "timeoutUs" microseconds.  //server端,获取截屏流
  mMediaCodec.createInputSurface(); //Requests a Surface to use as the input to an encoder, in place of input buffers.
  ByteBuffer[] inputBuffers=mMediaCodec.getInputBuffers();
  ByteBuffer --> Buffer --> Object.  A buffer for bytes.
  mByteBuffer.get();  //Returns the byte at the current position and increases the position by 1.
  mByteBuffer.getInt();  //Returns the int at the current position and increases the position by 4.
  mByteBuffer.getShort();  //Returns the short at the current position and increases the position by 2.
  PowerManager --> Object.
  This class gives you control of the power state of the device.
  Device battery life will be significantly affected by the use of this API. Do not acquire PowerManager.WakeLocks unless you really need them, use the minimum levels possible, and be sure to release them as soon as possible.
  mPowerManager.newWakeLock();



  socket连接被拒绝,通过搜索找到了解决方案:原因一原来android程序将127.0.0.1或localhost地址默认为模拟器的IP,而不是电脑的IP,所以无法找到连接进行通信。而android将本机电脑的IP 默认为10.0.2.2 只要将socket 连接到此地址即可。


  桌面共享:
  sdkver<16  //c解析屏幕。  4.4是19; 4.1.2是16;
  client端,c解析屏幕也是调用java层的代码去实现的。





 
  应用共享:私密性,延时,数据传输量;其中,延时表现为 UPP->SurfaceFlinger->LCD.
  重载:public ParcelFileDescriptor openFile(Uri uri, String mode){***} 与 public AssetFileDescriptor openAssetFile(Uri uri, String mode){ ** }
  获取屏幕截图,缓冲去大小(所需要的drawingCache>系统所提供的最大DrawingCache值)
  View decorView = this.getWindow().getDecorView();
  decorView.setDrawingCacheEnabled(true);
  decorView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),    
      MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));    
  decorView.layout(0, 0, decorView.getMeasuredWidth(),    
      decorView.getMeasuredHeight());    
  decorView.buildDrawingCache();  
  Bitmap vBitMap= decorView.getDrawingCache();







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值