• Nenhum resultado encontrado

Creating Android application using BLE sensor : a knee rehabilitation monitoring system

N/A
N/A
Protected

Academic year: 2023

Share "Creating Android application using BLE sensor : a knee rehabilitation monitoring system"

Copied!
37
0
0

Texto

The sensor used in this thesis is the TI SensorTag and it is used to create an application for a monitoring system for knee rehabilitation. It is hoped that the application will motivate the patients to participate actively in the rehabilitation process. In this thesis, special emphasis is placed on the BLE platform, as it is a common and widely used platform for communication with sensors.

Since 2001 Eclipse has been published under open source license and it is free software. The drag-and-drop technique generates XML code and it is possible to use both techniques in combination. It is released by Google and therefore has integrated functionality for other Google services, for example Google Cloud Messaging.

Like Eclipses Android Development Tools, it has graphical user interface for dragging and dropping layout components. It is wizard based and creates all the files needed to run the application. The number of channels used is less for BLE than for standard Bluetooth.

When BLE technology hit the market, many sports and wellness companies started using this technology because it is energy efficient and easy to connect.

3 DEVELOPING ANDROID APPLICATION

Relative Layout allows the designer to specify how the child objects are positioned relative to each other, while Linear Layout adds all child objects to a single row or column. This kind of layout doesn't have to be static, but can pull information from the database or array. It is also possible to nest layout containers so that the layout container contains another layout container.

For example, there are many types of text fields that are specifically designed to contain a specific type of information, such as plain text, address, or password. The similar kind of components are combined under one umbrella term that describes the main behavior of the component. However, the main purpose of text fields is to allow the user to enter text into the application.

These are by linking the button to the method in the Activs XML file by setting the value of the "android:onClick" parameter. The other way to do it is to link it in code by setting up and event handlers for the button. If there are only two options that cannot exist in parallel (for example function on/off), there is Toggle Button.

As with regular buttons, it is possible to bind the button to the action in XML or programmatically. It is not possible to bind the select to the method through the XML file and therefore must be done programmatically. This cannot require the user to take action and they are displayed on the screen only for the predetermined time.

Notifications can be shown to the user even if the application is only running in the background. SQLite is integrated into the host application and therefore no separate database management is required. SQLite supports several programming languages ​​and is embedded in many well-known applications and operating systems.

4 COMPONENTS FOR SENSOR TAG COMMUNICATION

GATT

Together with value access and display information, the value can be retrieved by the customer. Services are functions and associated data related to different types of behavior. In Android development, intents are objects that allow an app to prompt another app component to take action.

Intents can be used to start a service or deliver broadcast or start an activity. However, explicit intent is difficult to use to request action from an external application since the name of the component is not known. Unlike explicit intent, implicit intent is handled by the Android system looking for the right component in other applications to take action.

Implicit intents use intent filters defined in manifest file and describe what kind of intents the application cares for. Broadcast receiver, as the name suggests, is a component that listens for specific broadcast intent. However, it takes up the execution of user interface code in cases where there is a long process to be executed.

This allows the user interface to run while actions are taking place in the background. The downside of background processing is that the user interface is not updated when the process is running in another thread that is not allowed to communicate with the main thread. Handler allows the background thread to communicate with the main thread by sending a message and startup objects to the main thread.

Then the handler can be used to post from another thread to the original thread. This is commonly used to update user interface after a background process has completed. Other way to use handler is to schedule tasks to run after a specified period of time.

5 IMPLEMENTATION

Mockups serve their purpose because the implementation started from functionality and the user interface would be completed last. The images also act as buttons to change activity to another mockup UI. The first component is not actually part of the database, but is the class that calls the database functions.

For simplicity, a class is created that has a constructor for the data and defines the format for it. Guides and tutorials for using the sensor tag were almost non-existent, so a lot of work had to be done by studying the sample program source code and the sensor tag user manual. As of Android 4.3, Bluetooth Low Energy is supported and there are specific methods for establishing this type of connection.

This is done by writing the bytecode into the feature configuration data space on the sensor tag. When the sensor is powered on, the initial value of the sensor is read from the data space on the sensor tag. In this way, it also makes sure that the sensor is turned on and collecting data.

To get data continuously, the Sensor Tag has a notification function, which sends data over specified periods and allows application to be updated. However, the data from sensor is raw data and needs to be processed before it is in human understandable form. The components are all functional and the final phase is to combine them and finalize the user interface.

The user interface has been deliberately omitted from this thesis as it is out of scope. After transferring data to a human readable form, the database handler is not only displayed, but the data is stored in the database for later use. From the database, the data can be easily read and used for any purposes with the database handler introduced above.

This is to give the user some buffer, as it is likely that the user will not do the final iterations as thoroughly as the calibrating one. After completing the set, the number of repetitions is saved in the database together with the date.

6 SUMMARY

18] Bluetooth low Energy, Android Developer's Guide, Retrieved 2014-03-26 Available at: http://developer.android.com/guide/topics/connectivity/bluetooth-le.html.

Referências

Documentos relacionados

A imputação objetiva surge para conter os excessos que podem surgir da teoria da conditio sine qua non, o nexo causal no direito penal não pode surgir de uma simples relação de