Skip to main content

Build an Android app to control a Q7 Camera P2P WIFI

This tutorial will teach you how to build an Android app to control a Q7 Camera P2P WIFI using the Android Studio development environment.

Start a new project


I create a new project with application name "Q7Camera". During the wizard i add a basic activity.

Import native libraries and sources

To control the camera you need the libraries at this link: https://github.com/brusdev/q7cam/tree/master/app/src/main/jniLibs/armeabi. Copy the previous library in the path "app/src/main/jniLibs/armeabi" of your project. The packages to import are x1.Studio.Core at https://github.com/brusdev/q7cam/tree/master/app/src/main/java/x1/Studio/Core and com.microembed.sccodec at https://github.com/brusdev/q7cam/tree/master/app/src/main/java/com/microembed/sccodec.


Edit the manifest

To use the native libraries you need to add the following permissions to the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


Edit the activity layout

I add the following sv to the activity layout to show the camera:
<SurfaceView android:id="@+id/surfaceView_video" android:layout_width="match_parent" android:layout_height="match_parent" />

Edit the activity source

To show the camera in an activity, it needs to implements the interfaces SurfaceHolder.Callback and IVideoDataCallBack, you can find an example here: https://github.com/brusdev/q7cam/blob/master/app/src/main/java/com/brusdev/q7cam/MainActivity.java.


Repository

You can find the repository with the complete example here: https://github.com/brusdev/q7cam.

Comments

  1. Hello, try the app and it reports these errors in the LOGCAST:

    W/linker: /data/app/com.brusdev.q7cam-2/lib/arm/libSCCodec.so has text relocations. This is
    wasting memory and prevents security hardening. Please fix.
    W/linker: /data/app/com.brusdev.q7cam-2/lib/arm/libchinalink.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
    W/linker: /data/app/com.brusdev.q7cam-2/lib/arm/libsystem.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

    any ideas ?

    thank you very much.

    ReplyDelete
  2. note: the app runs fine but does not show my q7 camera.

    ReplyDelete

Post a Comment

Popular posts from this blog

Smart solar water heating solution to take part in the Open IoT Challenge 4.0!

Smart solar water heating solution uses IoT and AI technologies to improve the efficiency of passive solar water heating system. This solution is designed to take part in the Open IoT Challenge 4.0!

Solar water heating Solar water heating (SWH) is the conversion of sunlight into heat for water heating using a solar thermal collector. Solar water heating systems include storage tanks and solar collectors. There are two types of solar water heating systems: active, which have circulating pumps and controls, and passive, which don't.
Passive solar water heating systems are typically less expensive than active systems, but they're usually not as efficient. However, passive systems can be more reliable and may last longer.


The solar panels heat the water in the storage tank when they are affected by the sun rays. The water reaches the highest temperature when the sun is stronger. If the water in the solar panel is hot the divert valve close the flow towards the boiler so the boile…

IoT temperature sensor with ESP8266 using LWM2M (Eclipse Wakaama)

The sensor uses an ESP8266 board with the protocol Lightweight M2M to communicate the temperature read by DS18B20 to the gateway. The sources of the project are available on GitHub: https://github.com/brusdev/smart-solar-heating-system/tree/master/sensor

ESP8266The ESP8266 is a low-cost Wi-Fi microchip with full TCP/IP stack and microcontroller capability produced by Espressif Systems. The avalability of same SDK allows the chip to be programmed, removing the need for a separate microcontroller. To program the microchip i use the SDK Arduino core for ESP8266 WiFi chip and PlatformIO, that is an open source ecosystem for IoT development. LwM2M Lightweight M2M is a protocol from the Open Mobile Alliance for M2M or IoT device management and communication. It uses CoAP, a light and compact protocol with an efficient resource data model, for the application layer communication between LWM2M Servers and LWM2M Clients. Each service on a constrained device/sensor/actor is modelled as an LWM2M o…

Smart solar water heating solution final report for Open IoT Challenge 4.0!

Smart solar water heating solution uses IoT and AI technologies to improve the efficiency of passive solar water heating system. This solution has been developed to take part in the Open IoT Challenge 4.0!

Solar water heating Solar water heating (SWH) is the conversion of sunlight into heat for water heating using a solar thermal collector. Solar water heating systems include storage tanks and solar collectors. There are two types of solar water heating systems: active, which have circulating pumps and controls, and passive, which don't.
Passive solar water heating systems are typically less expensive than active systems, but they're usually not as efficient. However, passive systems can be more reliable and may last longer.


The solar panels heat the water in the storage tank when they are affected by the sun rays. The water reaches the highest temperature when the sun is stronger. If the water in the solar panel is hot the divert valve close the flow towards the boiler so the …