Skip to content

Instantly share code, notes, and snippets.

@qqli007
Last active August 29, 2015 14:11
Show Gist options
  • Save qqli007/cf5127c3b02e810f5ded to your computer and use it in GitHub Desktop.
Save qqli007/cf5127c3b02e810f5ded to your computer and use it in GitHub Desktop.
android各方面的
1.测试网页是否移动友好
https://www.google.com/webmasters/tools/mobile-friendly/
2.docker android env
https://registry.hub.docker.com/u/wasabeef/android/
https://plus.google.com/u/0/+BradFitzpatrick/posts/CmqtqAShWZJ
OpenJDK 7
Android SDK r22.3
Android NDK r9b
Ant 1.9.2
Maven 3.1.1
Gradle 1.9
@qqli007
Copy link
Author

qqli007 commented May 21, 2015

***save inputstream to file:

private void getH264File() throws IOException {

    String path = Environment.getExternalStorageDirectory() + "/931.h264";
    File file = new File(path);
    FileOutputStream outputStream = null;
    try {
        boolean isCreated = file.createNewFile();
        if (isCreated) {
            outputStream = new FileOutputStream(file);
            byte[] cache = new byte[1024];
            int lenght = 0;
            while ((lenght = videoStream.read(cache)) != -1) {
                outputStream.write(cache, 0, lenght);
            }
            outputStream.flush();
        }
    } finally {
        videoStream.close();
        if (outputStream != null) outputStream.close();
    }


}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment