`
bogongjie
  • 浏览: 230482 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论
文章列表

C TLS 通讯

    博客分类:
  • C
1. TLS 通讯server sample: server.c   #include <errno.h> #include <unistd.h> #include <malloc.h> #include <string.h> #include <arpa/inet.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <resolv.h> #inclu ...
用fastboot命令查看设备提示无权限:  no permissions    fastboot   于是知道是因为权限问题,是fastboot没有权限, 解决步骤:   1. 将fastboot的所有者属性改成root   用which fastboot命令找到fastboot所在的目录,然后进入此目录;再用命令chown改其属性:   sudo chown root:root fastboot   2. 将其权限更改一下: sudo chmod +s fastboot    
插入耳机的时候也可以选择使用扬声器播放音乐,来电铃声就是这么用的。但是只能用MediaPlayer,播放音频文件。 使用AudioTrack.write播放是行不通的。按理说AudioRecord、AudioTrack类相对于MediaRecorder mediaPlayer来说,更加接近底层,应该也行得通的。 AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE); audioManager.setMicrophoneMute(false); ...
自定义format格式,用空格替换Tab键,ctrl+shit+f格式化后生效:   设置Eclipse中按Tab键为4个空格,这里标记下!   Window-->Preferences-->Java-->Code Style-->Formatter   然后右边选择 Edit...按钮,在General Settings页中 Tab policy 右边的下拉框,选择Space only!   然后下面的Indentation size 和 Tab size 都设置成你要的空格数即可!一般是4个空格!!
一,生成导入AS所需配置文件(*.ipr)   1),编译源码(为了确保生成了.java文件,如R.java;如果编译过,则无需再次编译) 2),检查out/host/linux-x86/framework/目录下是否有idegen.jar 如果idegen.jar不存在,执行:     mmm development/tools/idegen/ 如果执行成功,则会在out/host/linux-x86/framework/下生成idegen.jar文件。 3),执行 ./development/tools/idegen/idegen.sh 命令。 如果执行成功会出现类似下面 ...
  Android 使用ZXing库识别图片上的二维码: 1.  EncodingHandler.java 文件: public final class EncodingHandler { private static final int BLACK = 0xff000000; public static Bitmap createQRCode(String str,int widthAndHeight) throws WriterException { Hashtable<EncodeHintType, String> hints = new Hasht ...
Android开发中在某些界面为了保证显示一致性,可能需要调整statusBar的背景色,本文介绍了Android 4.4(API 19)和Android 5.0以上修改statusBar背景色的方案。其中5.0只需要修改styles.xml文件就可以修改statusbar背景色,而4.4使用了 Toolbar来替代ActionBar的方案。 support-v7-appcompat在21版本之后做了很多修改,所以首先保证你的v7包在21以上。如果没有,请在Android Manager把v7包升级到该版本,或者在Android Studio gradle中如下: dependencies ...
动态增加布局: private void addLayout(Context context) { LinearLayout layout = new LinearLayout(context); //设置宽高属性 LayoutParams fullParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); //设置布局方向 layout.setOrientation(LinearLayout.VERTICAL); //设置背景颜色 lay ...
一开始需要说明的是,Google之所以要将一些API隐藏(指加上@hide标记的public类、方法或常量)是有原因的。其中很大的原因就是Android系统本身还在不断的进化发展中。从1.0、1.1到现在即将问世的Android 2.3.4。 这些隐藏的API本身可能是不稳定的,所以,使用隐藏API,意味着程序更差的兼容性。 如果要我给出建议的话,最好还是不要使用隐藏的API。不过有时为了实现Android应用某些特殊的功能或者效果,隐藏的API往往能发挥意想不到的作用。这些API具体能做些什么事,我就不在这里举例了。正好,如果你不知道隐藏API能做什么的话,那么还是尽早放弃使用它们吧…… 不 ...
这是在检查你的 Android SDK 。有人会在这里卡上很长时间,很大的原因就是:网络连接有问题。可以通过配置hosts 的方式来解决。如果检查需要更新,则需要你进行安装 。   如果想跳过这一步,可以进行如下操作:在Android Studio安装目录下的 bin 目录下,找到 idea.properties 文件,在文件最后追加disable.android.first.run=true 。 
方法一: /* 方法1: * 将对话框的大小按屏幕大小的百分比设置 */ WindowManager m = getWindowManager(); Display d = m.getDefaultDisplay(); // 获取屏幕宽、高用 WindowManager.LayoutParams p = getWindow().getAttributes(); // 获取对话框当前的参数值 p.height = (int) (d.getHeight() * 0.5); // 高度 ...
分别存储位置: *.jar:库/build/intermediates/bundles/debug(release)/classes.jar *.aar:库/build/outputs/aar/libraryname.aar 两者区别: *.jar:只包含了class文件与清单文件,不包含资源文件,如图片等所有res中的文件。   *.aar:包含所有资源,class以及res资源文件全部包含   如果你只是一个简单的类库那么使用生成的*.jar文件即可;如果你的是一个UI库,包含一些自己写的控件布局文件以及字体等资源文件那么就只能使用*.aar文件。   使用方式: ...
In Android Studio, you can do this:For example, if you want to change com.example.app to my.awesome.game, then:    1. In your Project pane, click on the little gear icon     2. Uncheck / De-select the Compact Empty Middle Packages option   Your package directory will now be broken up in individ ...
1、普通模式安装,调用系统Intent,代码如下: public void install(Context context, String filePath) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://" + filePath), "application/vnd.android.package-archive"); intent.addFlags(Intent.FLAG_ACTIVITY ...
1. 修改getActionBar()的使用方式: public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContent ...
Global site tag (gtag.js) - Google Analytics