編輯:關於Android編程
android NDK 使用(多個)靜態庫生成動態庫。
1、編寫Android.mk文件:如下兩種方式都可以,用於NDK編譯工具生成的兩個.a文件來生成最終的libtwolib-second.so動態庫。
LOCAL_PATH:=$(callmy-dir)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-second
LOCAL_SRC_FILES:=second.c
LOCAL_LDFLAGS:=first.athird.a
LOCAL_LDLIBS:=-L$(SYSROOT)/usr/lib-llog
include$(BUILD_SHARED_LIBRARY)
方式二:
LOCAL_PATH:=$(callmy-dir)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-first
LOCAL_SRC_FILES:=first.a
include$(PREBUILT_STATIC_LIBRARY)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-third
LOCAL_SRC_FILES:=third.a
include$(PREBUILT_STATIC_LIBRARY)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-second
LOCAL_SRC_FILES:=second.c
LOCAL_STATIC_LIBRARIES:=libtwolib-firstlibtwolib-third
LOCAL_LDLIBS:=-L$(SYSROOT)/usr/lib-llog
include$(BUILD_SHARED_LIBRARY)
2、生成動態庫
# Android.mk for FFmpeg
# Lei Xiaohua à×???è
# http://blog.csdn.net/leixiaohua1020
#
LOCAL_PATH := $(call my-dir)
# FFmpeg library
include $(CLEAR_VARS)
LOCAL_MODULE := avcodec
LOCAL_SRC_FILES := libavcodec-57.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := avdevice
LOCAL_SRC_FILES := libavdevice-57.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := avfilter
LOCAL_SRC_FILES := libavfilter-6.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := avformat
LOCAL_SRC_FILES := libavformat-57.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := avresample
LOCAL_SRC_FILES := libavresample-3.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := avutil
LOCAL_SRC_FILES := libavutil-55.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := swresample
LOCAL_SRC_FILES := libswresample-2.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := swscale
LOCAL_SRC_FILES := libswscale-4.so
include $(PREBUILT_SHARED_LIBRARY)
# Program
include $(CLEAR_VARS)
LOCAL_MODULE := sffstreamer
LOCAL_SRC_FILES :=simplest_ffmpeg_streamer.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_LDLIBS := -llog -lz
LOCAL_SHARED_LIBRARIES := avcodec avdevice avfilter avformat avutil avresample swresample swscale
include $(BUILD_SHARED_LIBRARY)
附:
可以直接編寫Android.mk文件來生成兩個.a文件,如下:
LOCAL_PATH:=$(callmy-dir)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-first
LOCAL_SRC_FILES:=first.c
include$(BUILD_STATIC_LIBRARY)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-third
LOCAL_SRC_FILES:=third.c
include$(BUILD_STATIC_LIBRARY)
include$(CLEAR_VARS)
LOCAL_MODULE:=libtwolib-second
LOCAL_SRC_FILES:=second.c
LOCAL_STATIC_LIBRARIES:=libtwolib-firstlibtwolib-third
LOCAL_LDLIBS:=-L$(SYSROOT)/usr/lib-llog
include$(BUILD_SHARED_LIBRARY)
Scroller是用於實現View的彈性滑動,在使用View的scrollTo或者scrollBy來進行滑動時,過程是瞬間完成的,這樣用戶體驗相當的不好。這時我們就要使用
大多數場景下,會單單使用viewPager+Fragment來完成項目需求,但也有一些特殊情況需要用到viewPager的多重嵌套。一、例如:我的想法是:①用viewPa
概述:滑動解鎖九宮格的分析:1、需要自定義控件;2、需要重寫事件onTouchEvent();3、需要給九個點設置序號和坐標,這裡用Map類就行;4、需要判斷是否到滑到過
剛剛介紹的“偽鎖”僅適用於微信,而微信之外的APP又該如何加密上鎖呢?通過“LockdownPro”這款軟件