安卓(java) 使用MQTT连接阿里云iot
使用阿里云连接树莓派实现传感器数据上传,现用阿里云iot提供的安卓demo无法连接阿里云iot,日志如下:程序代码:
2023-04-10 23:25:25.353 15076-15076/? I/ot_android_dem: Late-enabling -Xcheck:jni 2023-04-10 23:25:25.376 15076-15076/? E/ot_android_dem: Unknown bits set in runtime_flags: 0x8000 2023-04-10 23:25:25.377 15076-15076/? W/ot_android_dem: Unexpected CPU variant for X86 using defaults: x86 2023-04-10 23:25:25.556 15076-15109/com.linkkit.aiot_android_demo D/libEGL: Emulator has host GPU support, qemu.gles is set to 1. 2023-04-10 23:25:25.542 15076-15076/com.linkkit.aiot_android_demo W/RenderThread: type=1400 audit(0.0:55229): avc: denied { write } for name="property_service" dev="tmpfs" ino=6969 scontext=u:r:untrusted_app:s0:c137,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 2023-04-10 23:25:25.556 15076-15109/com.linkkit.aiot_android_demo W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied) 2023-04-10 23:25:25.577 15076-15109/com.linkkit.aiot_android_demo D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so 2023-04-10 23:25:25.583 15076-15109/com.linkkit.aiot_android_demo D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so 2023-04-10 23:25:25.586 15076-15109/com.linkkit.aiot_android_demo D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so 2023-04-10 23:25:25.726 15076-15076/com.linkkit.aiot_android_demo W/ot_android_dem: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed) 2023-04-10 23:25:25.726 15076-15076/com.linkkit.aiot_android_demo W/ot_android_dem: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed) 2023-04-10 23:25:25.851 15076-15107/com.linkkit.aiot_android_demo D/HostConnection: HostConnection::get() New Host Connection established 0xd3772f00, tid 15107 2023-04-10 23:25:25.853 15076-15107/com.linkkit.aiot_android_demo D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 2023-04-10 23:25:25.855 15076-15107/com.linkkit.aiot_android_demo W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 2023-04-10 23:25:25.868 15076-15107/com.linkkit.aiot_android_demo D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0 2023-04-10 23:25:25.868 15076-15107/com.linkkit.aiot_android_demo D/EGL_emulation: eglCreateContext: 0xded4a5e0: maj 3 min 0 rcv 3 2023-04-10 23:25:25.895 15076-15107/com.linkkit.aiot_android_demo D/EGL_emulation: eglMakeCurrent: 0xded4a5e0: ver 3 0 (tinfo 0xd37aa320) 2023-04-10 23:25:25.913 15076-15107/com.linkkit.aiot_android_demo W/Gralloc3: mapper 3.x is not supported 2023-04-10 23:25:25.914 15076-15107/com.linkkit.aiot_android_demo D/HostConnection: createUnique: call 2023-04-10 23:25:25.914 15076-15107/com.linkkit.aiot_android_demo D/HostConnection: HostConnection::get() New Host Connection established 0xd3774710, tid 15107 2023-04-10 23:25:25.916 15076-15107/com.linkkit.aiot_android_demo D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 2023-04-10 23:25:25.916 15076-15107/com.linkkit.aiot_android_demo D/eglCodecCommon: allocate: Ask for block of size 0x1000 2023-04-10 23:25:25.916 15076-15107/com.linkkit.aiot_android_demo D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ff807000 size 0x2000 2023-04-10 23:25:25.921 15076-15107/com.linkkit.aiot_android_demo D/EGL_emulation: eglMakeCurrent: 0xded4a5e0: ver 3 0 (tinfo 0xd37aa320) 2023-04-10 23:25:25.923 15076-15107/com.linkkit.aiot_android_demo D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0 2023-04-10 23:25:26.084 15076-15111/com.linkkit.aiot_android_demo D/AlarmPingSender: Unregister alarmreceiver to MqttServiceicriEXjfkAE.raspi|timestamp=1681140325778,_v=paho-android-1.0.0,securemode=2,signmethod=hmacsha256| 2023-04-10 23:25:26.106 15076-15114/com.linkkit.aiot_android_demo D/AlarmPingSender: Unregister alarmreceiver to MqttServiceicriEXjfkAE.raspi|timestamp=1681140325778,_v=paho-android-1.0.0,securemode=2,signmethod=hmacsha256| 2023-04-10 23:25:26.115 15076-15076/com.linkkit.aiot_android_demo I/AiotMqtt: connect failed
因为没有用过java,阿里云提供的安卓demo只能看个大概,按照教程仍无法连接。。。教程网页如下:
https://help.