生成liblogsdk.jar库
使用命令行生成liblogsdk.jar
mvn package
在Android.mk文件中添加路径(请根据实际路径添加)
LOCAL_SRC_FILES := \
+$(LOCAL_PATH)/logsdk/android/source/LambdaClient.cpp \
+$(LOCAL_PATH)/logsdk/android/source/LambdaDevice.cpp \
+$(LOCAL_PATH)/logsdk/android/source/LogSdkJniHelper.cpp \
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/logsdk/android/include
在proj.android/jni/android.mk中添加路径
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../../../logsdk/android/include \
在AndroidManifest.xml中添加uses-permission
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
添加logsdk库到您的工程中
在工程中初始化LogSdkJniHelper
//In main class,
// please add this include
#include "LogSdkJniHelper.h"
jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
JniHelper::setJavaVM(vm);
// please add this line
lambdacloud::LogSdkJniHelper::setJavaVM(vm);
在工程中初始化DeviceInfo
// please add these import
import android.content.Context;
import com.lambdacloud.sdk.android.DeviceInfo;
public class YOURAPP extends Cocos2dxActivity{
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
// please add these lines
Context context = getApplicationContext();
DeviceInfo.init(context);
示例
生成liblogsdk.a
合成真机和模拟器静态库
lipo -create /所在路径/Release-iphoneos/liblogsdk.a /所在路径/Release-iphonesimulator/liblogsdk.a -output /自定义路径/liblogsdk.a
查看合成静态库架构,若查询结果为:liblogsdk.a are: arm7 i386 x86_64 arm64即为合成成功
lipo -info liblogsdk.a
添加liblogsdk.a静态库及其头文件
添加引用库CoreTelephony.framework,SystemConfiguration.framework
使用SDK
问题
================================
GenyMotion is a fantastic Android simulator, with much better performance than Android's original simulator.
Trouble shooting