The research methodology is based on studying the mathematical background of each app and creating each application to be launched on the Google Play Store.
The design approach is user-centered design, so the applications were tested to be built on what users would need to use on their phone for on a daily basis, with a great emphasis on user feedback. Decisions to make changes in apps and implement new functionalities were always made after carefully checking the user comments on the Google Play Store.
The programming language chosen to create the mobile apps was Java, because it has the widest support among all mobile programming languages for the Android operating system.
3.1. Vocal SMS Writing and Reading App for Visually Impaired People
The methodology of creating the voice SMS app is to first study mathematical aspects such as the spectrogram of the audio signal and then implement all the findings in the mobile phone app.
The scientific impact of the vocal SMS application advances the research fields of speech recognition, natural language processing, human–computer interaction, accessibility, cybersecurity, and behavioral linguistics. It also enhances AI-driven communication, fosters digital inclusion, and optimizes data communication. In addition, it helps to advance multilingual technologies.
An app is needed for visually impaired people to use SMS functionalities vocally; a solution would be this vocal SMS app. The creation method and the mathematical background will be presented next.
This Android application creates text when recording, sends it as an SMS message, and reads the received SMS messages using text-to-speech software. The aim is to accelerate the composition of SMS messages, which is helpful when the user is in a hurry or driving a vehicle, or for visually impaired people. The application loads all contacts into a list, but additionally, a contact can be searched (with a speech command as well). When the user long-presses a contact, recording starts immediately. To end the recording, the user should stop speaking or remove the mobile device from near the mouth. If the result is not satisfactory, the recording can be repeated. The recording result will be better if the default language of the mobile device is set to the spoken language. When the message is OK, it can be sent via an SMS message or copied to the clipboard to send it through other messaging applications. The received SMS message can also be read aloud with text-to-speech software, so the user can hear the message rather than read it. When the user wants to answer a received message, they can simply long-press on the contact name from the received SMS pop-up. The application needs an Internet connection. It needs Internet to run the speech-to-text and text-to-speech engine from Google. The implication is that if the user has no Internet access, the app cannot work. This exception was handled, so the app will not crash, but an error message that says that the app cannot work without an Internet connection will pop up.
Algorithm 1 shows the most important steps of the vocal SMS app.
Algorithm 1 Speech-to-text conversion in vocal SMS app. |
- 1:
procedure ConvertSpeechToText(audioInput) - 2:
audioData ← CaptureAudio(audioInput) - 3:
processedAudio ← PreprocessAudio(audioData) - 4:
textOutput ← SpeechRecognition(processedAudio) - 5:
if textOutput is valid then - 6:
Return textOutput - 7:
else - 8:
Return “Error: Could not transcribe speech” - 9:
end if - 10:
end procedure
|
Figure 1 shows the flowchart of the vocal SMS app.
All SMS messages are saved in the SMS database of the mobile device. The application shows only the current SMS, not all old messages. Older SMS messages can be read from the default SMS application on the mobile device. When the application is installed, the application must become the default SMS application on the mobile device by tapping OK on the initial pop-up message. This can be easily changed by tapping on OK in the default SMS application. Everything is stored on the user’s mobile device, so the user should not worry about the data being present in any other third-party servers. The goal of this application is to make SMS writing similar to normal phone talk and to reduce the writing time. The user must make text to speech functional on their mobile device and configure the Google text-to-speech engine in their language of choice.
The sending of voice messages can be represented with the following functions.
This function starts the voice message recording process.
This function plays the voice message that was received.
The designated voice message is removed using this function.
This function converts the audio message that must be sent to text.
The text message is sent while using this function. The TTS (text-to-speech) function can be represented as TTS (text), where text is the text input that must be spoken.
This function converts text input into audio, which is indicated by audio. Likewise, STT (audio) represents the STT (speech-to-text) function, where audio is the speech input that needs to be translated into text.
“Text” is the result of this function’s conversion of the audio input to text. Integrating SMS messaging with these features is the function shown below.
Using STT, this function converts audio to text and sends an SMS to the designated receiver.
Text to speech translates written words into spoken language using various methods. One essential model for this purpose is the Tacotron 2 architecture, which encompasses both sequence-to-sequence models and vocoders.
The Tacotron 2 architecture includes the following steps:
1.
Encoder: As demonstrated in Equation (
1), the encoder converts the character sequence
into a series of hidden states
.
2.
Attention Mechanism: The attention mechanism matches the hidden states
with the decoder states, as illustrated in Equation (
2).
3.
Decoder: The decoder produces Mel spectrogram frames using the attended hidden states as described in Equation (
3)
4.
Vocoder (e.g., WaveNet): The vocoder transforms the Mel spectrogram frames into the time-domain waveform as depicted in Equation (
4).
Converting spoken words into written text is the essence of speech to text. A typical method employs a Recurrent Neural Network (RNN) paired with a Connectionist Temporal Classification (CTC) loss function.
The following steps are involved in the RNN-CTC model:
1.
Feature Extraction: Derive the acoustic features
from the audio signal
as depicted in Equation (
5).
2.
Recurrent Neural Network: Implement an RNN to capture the temporal dependencies present in the features as demonstrated in Equation (
6).
3.
CTC Loss: Determine the likelihood of the output sequence
using the CTC method as illustrated in Equation (
7).
A model such as Deep Speech streamlines the process by employing a single deep learning model trained from start to finish.
The Deep Speech model includes the following procedures.
1.
Feature Extraction: Derive characteristics from the audio signal as described by Equation (
5).
2.
Deep RNN: Implement multiple layers of RNNs, including GRUs or LSTMs, as described in Equation (
8).
3.
Softmax Layer: Estimate the probability distribution of the characters at each time step as depicted in Equation (
9).
4.
CTC Loss: Employ CTC for alignment and training as described in Equation (
7).
SMS messages can be encoded with various character sets, including GSM 7-bit, UCS-2 (16-bit), and UTF-8. For GSM 7-bit encoding, the count of septets (7-bit characters) is crucial.
The equation for the number of septets,
, derived from a string
M consisting of
L characters, is presented in Equation (
10).
For SMS messages that contain multiple parts, it is necessary to determine the maximum character count per segment and the total number of segments.
When the message length L is more than 160 characters, it must be divided into segments. Each segment can contain a maximum of 153 characters because some characters are used for segmentation details.
Equation (
11) provides the value of the number of parts
.
Error-correcting codes like Reed–Solomon codes are useful for maintaining message integrity.
In a Reed–Solomon code
, with
n as the block length and
k as the message length, the quantity of errors that can be corrected
t is given by Equation (
12).
Communicating with the SMSC (Short Message Service Center) requires the use of protocols such as SMPP (Short Message Peer-to-Peer) to transmit messages.
The overall length of a message
, which encompasses both the header and the body, is represented in Equation (
13).
where
represents the length of the SMPP header, and
indicates the length of the encoded message.
Modulation and demodulation processes are describable utilizing signal-processing techniques.
The modulated signal, denoted as
, is shown in Equation (
14).
In which:
A represents the amplitude;
denotes the message signal;
stands for the carrier frequency;
symbolizes the phase.
The function represents the TTS system as follows:
Where:
x serves as the input text.
is the feature extraction function responsible for transforming text into linguistic features.
S is the synthesis function responsible for creating the audio signal using the features.
The synthesis function
S is usually represented as
Where:
represents the amplitude for the i-th sine wave.
denotes the frequency.
denotes the phase offset.
N represents the count of sine waves used in the synthesis process.
Figure 2 shows the sine wave components in TTS.
Figure 3 shows the spectrogram of audio signal.
The STT system can be characterized as follows:
Where:
The recognition function, denoted by
G, operates through multiple layers:
Where:
A vocal SMS application enables users to both send and receive text messages through voice commands. The functionality of this system depends on different mathematical models that address signal processing, energy usage, and data transfer. To represent these critical components of the app, we will employ techniques from differential equations, linear algebra, analytic geometry, and mathematical analysis.
An auditory signal can be described as a time-dependent function , with t representing time and indicating the signal’s amplitude at that moment. This audio signal undergoes sampling at specific time points , where denotes the interval between samples. The sampled values of the signal are represented by .
The Fourier transform is employed to change a signal from the time domain to the frequency domain, a process crucial for compression and transmission. The Fourier transform of the function
is expressed as
The discrete Fourier transform (DFT) is employed to analyze the discrete signal:
To reconstruct the signal, the inverse Fourier transform is applied:
By transitioning the signal to the frequency domain, we can achieve compression by discarding minor Fourier coefficients, which are associated with less significant frequencies. Let denote the vector of Fourier coefficients.
We can achieve signal compression by using a projection matrix
to eliminate minor coefficients:
Let
denote the compressed signal, while
represents a diagonal matrix assigning 0 to small coefficients and 1 to large ones. The compression ratio is calculated as follows:
Let C represent the battery capacity of the phone, measured in mAh, while denotes the power consumption of the vocal SMS application at a given time t, expressed in watts. This power consumption depends on the intensity of audio processing and SMS transmission.
The rate at which battery discharges can be represented by this differential equation:
Given that
V represents the constant voltage of the phone battery, resolving this equation provides the battery level at any time point
t:
When the app consistently uses power
, the battery level diminishes linearly:
Here, denotes the original battery capacity.
Analytic geometry offers a framework for modeling signal transmission. Imagine a phone sending a voice signal across a span
d. The signal power diminishes following the inverse-square law:
where
denotes the signal power in the phone speaker, and
represents the power received at a distance
d.
To enhance signal quality, we reduce attenuation by selecting the best transmission angle. When the phone antenna emits the signal at an angle of
to the horizontal, it arrives at the receiver over a distance
, represented by
Given that
h represents the height of the phone with respect to the receiver, the power received can be expressed as a function of
as follows:
In order to enhance the performance of the vocal SMS application, our objective is to reduce energy usage
while preserving the quality of the signal
. This leads to the formulation of the optimization problem as follows:
Employing Lagrange multipliers, we establish the Lagrangian as follows:
By varying
concerning both
and
, the resulting equations are
Solving these equations results in determining the best power distribution along with the associated signal quality .
A detailed mathematical model for a mobile phone vocal SMS application was formulated in this section. The approach involved employing techniques from differential equations, linear algebra, analytic geometry, and mathematical analysis to represent signal processing, battery usage, signal transmission, and system optimization. These models aim to boost the app’s efficiency and enrich the user experience.
In
Figure 4, the initial screen of the mobile app can be seen. It has a search box to search for a name in the mobile phone’s address book. It also has an ‘X’ button to clear an error in the search box. The application loads the names from the mobile phone address book. As the hint says, the user must long-press any contact in the address book or from the search box, and the recording will begin. After the recording is finished, the speech is transformed into text that can be sent as an SMS message.
In
Figure 5, it can be seen how the search box functions. The search box has a drop-down list with search suggestions and an autocomplete function to ease the searching. After the second character is written, the search drop-down list appears; this way, the user can select the most appropriate user to send the message to. The users can also be searched vocally; in this way, it is even easier for visually impaired people, car drivers, or children who do not know how to write to use the app.
In
Figure 6, recording of the user’s speech is shown. There is some indication of what to take into account to make a good recording. In the first line, the name to whom the message will be sent can be seen. The user does not need to press any microphone button, because the recording starts when the user speaks and stops automatically when the user stops speaking. The green button must be pressed when indicated by the software when the user makes an unclear recording. There is also an indication that the audio file will be sent to Google to provide a speech recognition service. The speech recognition service will transform the speech into text that can be sent as an SMS message. If the recording is not good, it can be repeated as many times as necessary. For the system to work correctly, the best practice is to keep the mobile phone close to the mouth when speaking and to remove the device after speaking ends.
In
Figure 7, the pop-up that shows after the recording ends can be seen. The person who receives the message and the recorded message, in our case “hello”, can be seen. After this, the user can decide whether or not to send the message. When tapping on the blue arrow, the message will be sent as an SMS message. If the user clicks on the “X” button to close, the pop-up closes and the message will not be sent. The user can then make a new recording if they choose to. As the hint says, all incoming and outgoing messages can be viewed in the default SMS app. The app uses the database from the default SMS application and stores all incoming and outgoing messages in that database. Of course, longer messages can also be recorded. The recording will work better if the user sets the default language of the phone to the language that they speak when making a recording with this app. The default language can be easily set in the Settings app on the Android device.
In
Figure 8, the pop-up that appears when an SMS message is received can be seen. It also shows a notification in the notification area of the mobile device, but also a pop-up with the message. When the notification is clicked, the system takes the user to the voice SMS app. In the pop-up, the name of the user who sent the message and, of course, the text of the message itself can be seen.
If the user clicks on the green arrow, the system will read the text of the message aloud using text-to-speech software. Reading the text message can be stopped by clicking the green arrow again. The green arrow has the functions “Play” and “Pause”. This function can be helpful for visually impaired people, drivers, and even children who have not yet learned to read. As the hint says, the user can respond to the received SMS message simply by pressing the name of the pop-up that shows the received SMS message. This received SMS message is also stored in the database of the default SMS app and can also be read from there if needed. The app can also be used without voice support, but with this, it loses all its fun.
3.2. Private File Manager App
The methodology of the private file manager app is to first study mathematical aspects such as the storage usage of different files and then implement all the findings in the mobile phone app.
The scientific impact of the private file manager app is that it advances studies in cybersecurity, encryption, AI-driven file categorization, and human–computer interaction, enhancing data privacy, secure access methods, and energy-efficient digital management while complying with global data protection regulations.
Algorithm 2 shows the most important steps of the private file manager app.
Algorithm 2 Hide file in private file manager. |
- 1:
procedure HideFile(filePath) - 2:
if FileExists(filePath) then - 3:
hiddenPath ← AppendHiddenAttribute(filePath) - 4:
MoveFile(filePath, hiddenPath) - 5:
Return “File Hidden Successfully” - 6:
else - 7:
Return “Error: File Not Found” - 8:
end if - 9:
end procedure
|
Figure 9 shows the flowchart of the private file manager app.
There is a need for an app for hiding personal files, mostly photos and videos; a solution would be this private file manager app. The creation method and the mathematical background will be presented next.
The initial task was to create a file manager for Android devices. Today, the task can be performed quite well due to the capabilities of the Android operating system. As Android is based on Linux, it can use the Linux shell commands to work with the file system (create, delete, rename, copy, move folders/files). If we think back on the olden days to a similar application, called DOS (Disk Operating System), Microsoft made a multibillion-dollar corporation. The funny thing is that the application did not even have a graphical user interface at that time.
For the file manager app, we used the following formulas.
The file existence check is presented in Equation (
33).
If the file f exists, this function returns 1, and if not, it returns 0.
File size calculation is presented in Equation (
34).
The size of the file is f.
File copying is presented in Equation (
35).
The contents of file f are copied to file g by this function.
File deletion is presented in Equation (
36).
The file f is deleted by this function.
File renaming is presented in Equation (
37).
File f is renamed to file g using this method.
File moving is presented in Equation (
38).
File f is moved to the designated directory using this function.
File listing is presented in Equation (
39).
A list of files in the given directory is the return value of the function.
File creation is presented in Equation (
40).
The new file f is created by this function.
Effective file indexing is essential for quick access and retrieval. A common method is to use an inverted index.
Given a collection of documents
and a vocabulary
, the inverted index
I associates each term
with a list of documents
that contain the term, as illustrated in Equation (
41).
Effective file searches can be achieved with algorithms such as binary search trees (BSTs) or B-trees.
A B-tree of order m is a type of tree structure where each node can have up to m children, making it ideal for file indexing and searching.
Consider a B-tree node x containing n keys; the properties listed below are satisfied:
Securing data involves encrypting files. One popular encryption technique is the Advanced Encryption Standard (AES). The AES encryption was implemented in the file manager app.
AES encryption comprises several transformation rounds. Each round r of AES-128 encryption includes the following:
SubBytes: A substitution step with non-linear properties.
ShiftRows: A permutation of rows.
MixColumns: A mixing operation performed on the columns.
AddRoundKey: An XOR operation using the round key.
In round
r, the state matrix
S is transformed by
, as demonstrated in Equation (
42).
File compression minimizes file size for optimal storage. Huffman coding is a widely used algorithm for lossless file compression.
Huffman encoding allocates codes of varying lengths to symbols according to their occurrence rates.
Consider a set of characters
with associated frequencies
. The expected length
of the encoded message is depicted in Equation (
43).
, where denotes the length of the code for .
Synchronizing files guarantees consistency between different devices. The rsync algorithm is a popular technique for this purpose.
The rsync algorithm employs a rolling checksum to identify differences between files. The rolling checksum, denoted as
R, for a block of size
b beginning at position
i, is illustrated in Equation (
44).
To detect changes, the hash of this block is compared later with the hashes of blocks in the target file.
Let the total storage capacity be denoted by
S, and let
represent the size of the
i-th file. The total storage utilized,
U, is defined as:
Where:
The proportion of storage in use, denoted as
P, is determined by:
The rate at which a file of size
s is transferred over a duration
t is represented by
R:
Where:
The effectiveness of arranging files can be measured by the mean number of files per directory
E, calculated as:
Where:
A mobile file manager equipped with a concealment feature allows users to handle their files while ensuring that certain ones remain hidden for privacy purposes. This app incorporates encryption, file storage structuring, energy consumption regulation, and enhanced access speed. This paper presents a mathematical model that uses techniques from differential equations, linear algebra, analytic geometry, and mathematical analysis.
Figure 12 shows the file organization efficiency.
The process of hiding data generally involves encrypting files. Consider
, which denotes the file content as a vector of dimension
n (e.g., a vector format of the file’s binary data). The encryption can be represented by a matrix transformation
, where
is an encryption matrix of size
. The resulting encrypted file
is:
To conceal the file, we utilize a function
applied to the encrypted data, where
serves to relocate or encode the encrypted file securely. The concealed file
is:
We retrieve the concealed file by executing the reverse operations of the encryption and hiding functions:
A file manager organizes files within a confined storage area, conceptualized as a three-dimensional geometric space. This storage area is depicted as a bounded region
, where files reside at specific coordinates
. The position of a hidden file is indicated by the coordinates
.
Retrieving the file requires an amount of time that is proportional to this distance; therefore, the access time
is represented by:
A proportionality constant, denoted by , is determined by the efficiency of the search algorithm employed by the file manager.
The impact of encryption and hiding activities on file manager battery usage is significant. Let denote the battery capacity of the mobile device at time t, with and indicating the power consumption for encryption and hiding tasks, respectively.
The rate of battery depletion is modeled by the following differential equation:
In this equation, the battery level can be determined at any time
t by integrating, where
V is the constant voltage of the phone battery.
Assuming each operation uses fixed power, specifically
and
, the level of the battery decreases linearly:
In order to enhance system performance, our objective is to reduce cumulative access time while ensuring minimal battery usage. Let
represent the total time required to access hidden files by time
t, and let
denote the battery level at that time. The optimization challenge is defined as follows:
In this context, denotes the lowest necessary battery level for the system’s functionality, while represents the complete duration needed to retrieve N files.
The solution to this optimization was achieved using the Lagrange multiplier method. Consider the Lagrangian:
By differentiating with respect to
,
,
, and
, we derive the following set of equations:
Solving these equations yields the ideal coordinates for each file, thereby reducing the total access time and maintaining battery efficiency.
Besides encrypting files, the file manager can also compress hidden files to optimize storage usage. Define
as an
n-dimensional vector representing the hidden file. The compression process can be described by a matrix transformation
, with
, transforming the file into its compressed form
:
The process of decompression is carried out utilizing the pseudoinverse of the compression matrix, denoted as
:
A detailed mathematical model for a mobile phone file manager with a file-hiding feature was introduced. This model uses linear algebra for encryption and hiding, employs analytic geometry for file access timing and storage layout, applies differential equations to gauge battery usage, and utilizes mathematical analysis for system optimization. These models shed light on how the file manager can effectively manage hidden files while reducing both power consumption and access time.
In
Figure 13, the initial screen of the application, the file manager, can be seen. As can be seen, the app was made as simple as possible, and the types of files and folders that the file manager can access are at the top: SD card, images, audio, videos, documents, downloads, and DCIM (photos). The sub-folders and files that are in the selected folders are shown below. All files whose names begin with a dot (“.”) are hidden. At the top, there is a back button for navigation, the actions that can be selected, the hidden/unhidden files of folders, and the info button, which shows information/help messages about the app. Initially, when the app is installed, the user must allow the app to access the directories and files of the smartphone or tablet. The user can check the directories and files of the smartphone or tablet after allowing the app to access the internal and/or external memory of the device. The app also needs to have some protection in order not to access some sensitive files, located mainly in the root folder. It is not good to hide a file that is used by the operating system in a critical operation for other purposes. It is not very easy to create an app that can show all hidden files, because the Android operating system is designed in such a way that certain sensitive files are not accessible or cannot be seen (hidden). With some tweaks, it can be changed so that the application shows all files, hidden or not, but does not access the root file system or the folders where the sensitive files of the Android operating system are stored. The app was made to hide sensitive files for the user, not for the operating system. The sensitive files for the user are images and videos, but the app can also hide other folders/files. The author found a limitation in the Android operating system file manager and implemented it in this app. The limitation was that the Android operating system does not really have a good hide/show function. This may have been implemented for safety reasons, to ensure that standard users do not wreck something in the operating system of their Android device. The operating system does not really have a function to hide/show files. The method of hiding/showing files can be carried out with external applications by creating a file “.nomedia” in a folder. This method will hide all folders/files from the folder in which it is placed, but not each individual folder/file selected by the user. If we see it in another way, users of the Android operating system need an app that can make their sensitive files (images, videos) more private. The way to do this is to hide sensitive user files.
In
Figure 14, the pop-up shown when clicking on the “Select Action” button can be seen. From the pop-up, the user can choose if they want to Hide” or “Show” a certain selected file. The files can be selected/deselected by long-pressing them. The actions there are only “hide” and “show” actions for safety purposes. The app is not made to destroy the user’s operating system; it is made just to compensate for a functionality that the Android operating system file manager does not have. This could also be implemented, but was not, for safety purposes; this way, the user will not accidentally take some unwanted action. All actions (create, delete, rename, copy, move folders/files) can be performed in the file manager of the Android operating system, so it is not necessary to implement them in this app as well. This app has implemented only hide/show actions, which are not present in the Android operating system file manager, so it can be used to hide/show images/videos or any other folders/files of the user.
In
Figure 15, it can be seen that the “SimpleScanner” directory was hidden after selecting the "Hide" operation of the app. After this, the “SimpleScanner” directory will not be visible in the Gallery app on the Android smartphone or tablet. The app automatically refreshes the folder contents, so all files are alphabetically sorted after each change. This is why the “.SimpleScanner” directory became the first, because its name starts with a dot (“.”), which is before the other letters in the ASCII system, and alphabetical sorting is based on the ASCII table. The other actions (create, delete, rename, copy, move folders/files) can be performed in the file manager of the Android operating system.
Actually, the hide/show action is a rename action, but not all users know that all files beginning with a dot (“.”) are hidden in Linux and, in this case, in Android. This app tries to make use of this functionality easy for the average user.
In
Figure 16, it can be seen that the pop-up with the information/help message is displayed when the user taps the information button. It is explained that the user has to long-press a folder/file to select it and long-press again to deselect it. All folders/files whose names begin with a dot (“.”) are hidden. The app actually hides or shows folders/files in the smartphones or tablet’s Gallery app; this way, in this app, all folders/files are visible, even if they are hidden. The app is suggested to be used for images or videos of the user in the Gallery app of the Android operating system. Sometimes, it is necessary to turn off the phone after turning it on, not rebooting, to see changes in the Gallery app of the Android operating system. Sometimes, the refreshing of the files requires turning the phone off and then on.
3.3. Novel Torch App Which Can Be Switched by Double-Tapping Anywhere on the Screen
The methodology of the novel torch app is to first study mathematical aspects such as the power consumption of the mobile phone, while the torch LED is turned on, and then implement all the findings in the mobile phone app.
The scientific impact of the novel torch app is that it improves research in fields such as energy-efficient mobile technology, adaptive brightness management, human–computer interaction, and technologies for emergency response. Moreover, it contributes to progress in optimizing low-power LEDs and improving accessibility features.
Figure 17 shows the flowchart of the novel torch app.
Algorithm 3 shows the most important steps of the novel torch app.
Algorithm 3 Toggle flashlight in novel torch app. |
- 1:
procedure ToggleFlashlight - 2:
if FlashlightStatus = OFF then - 3:
TurnOnFlashlight() - 4:
FlashlightStatus ← ON - 5:
Return “Flashlight Turned ON” - 6:
else - 7:
TurnOffFlashlight() - 8:
FlashlightStatus ← OFF - 9:
Return “Flashlight Turned OFF” - 10:
end if - 11:
end procedure
|
There is a need for a torch app that can be toggled really easily by tapping anywhere on the phone screen; a solution would be this novel torch app. The creation method and mathematical background will be presented next.
With this application, the user can turn the flashlight of the mobile device on/off by double-tapping anywhere on the screen. The problem of the app starting accidentally was solved by adding a double-tap to turn the flashlight on and a double-tap to turn the flashlight off. The application was designed to be extremely simple and easy to use. The application also has a notification that turns the flashlight on/off by tapping on the notification. To make the application usable, the user must allow camera access for the application, as the application uses the flashlight near the camera of the mobile device.
Next, the implementation of the application will be shown.
Equation (
63) shows a mathematical expression of the flashlight toggling app.
The flashlight function is represented by a flashlight. The current state of the flashlight is represented by the TRUE or FALSE state. If the state is TRUE, the function will return ON, showing that the flashlight is turned ON, and OFF if the state is FALSE, showing that the flashlight is turned OFF.
The illumination
E (measured in lux) at a distance
d from the flashlight is determined by Equation (
64).
In this context, I represents the luminous intensity in candelas (cd).
Battery life
t can be determined using Equation (
65).
Here:
C represents the battery capacity in milliampere-hours (mAh).
denotes the LED driver’s efficiency (dimensionless, usually ranging from 0 to 1).
P corresponds to the power usage in watts (W).
The thermal resistance, denoted as
and measured in °C/W, can be determined using Equation (
66).
Where:
is the junction temperature of the LED (°C).
is the ambient temperature (°C).
P is the power dissipation in watts (W).
As demonstrated in Equation (
67), the total luminous flux
(measured in lumens) can be determined using the luminous efficacy
(measured in lumens per watt) and the power consumption
P (measured in watts).
The flashlight app’s power usage is described by
Where:
The duration for which the flashlight can be powered by the battery is
Where:
Luminous efficacy (LE), which denotes the LED’s ability to transform electrical energy into light, is determined by
Where:
Figure 18 shows the battery life vs. current.
The intensity of brightness (B) can be regulated by altering the current:
Where:
The amount of heat produced by the LED can be determined using
Where:
The rise in temperature, denoted as
, can be expressed as
Where:
Figure 21 shows the temperature increase vs. current.
The flashlight application on a smartphone utilizes battery energy to emit light. This paper presents a model that captures the physical and mathematical considerations, which include power usage, light intensity, the geometry of the light cone, and signal processing for adjusting brightness.
Let
C denote the capacity of the phone battery in mAh, and let
represent the power consumed by the flashlight at any given time
t (in watts). With the assumption of a steady voltage
V, the current
(in amperes) is associated with the power through:
The overall energy used by the flashlight,
, can be determined by integrating the power with respect to time:
The battery life
T refers to the duration at which the battery is fully discharged, thus:
Assuming the flashlight operates with a steady power consumption of
, we have the following:
The flashlight projects light in the shape of a cone. The conical geometry is described using spherical coordinates , where r denotes the distance from the light source, represents the azimuthal angle, and is the polar angle.
At a point
, the light intensity
is determined by the inverse-square law:
Here,
represents the initial intensity of light when
. The complete luminous flux
produced by the flashlight is determined by integrating on the surface of the cone, within the angular boundaries
and
(where
denotes the opening angle of the cone):
The intensity of the flashlight is adjustable through Pulse Width Modulation (PWM), where the duty cycle dictates the proportion of time the flashlight remains active. Let
denote duty cycles over
n specific intervals and
indicate the brightness levels aimed for during these intervals. The relationship connecting the duty cycle to the brightness level is expressed by the linear system:
In this context,
represents a matrix depicting the response of the system, essentially illustrating the relationship between the duty cycle and the resulting brightness. To determine the optimal duty cycles, we solve for
:
To achieve the desired brightness while reducing power usage, we employ the Lagrange multiplier method. Define
as the power consumption associated with brightness
x, and let
denote the target brightness. The corresponding Lagrange function is:
Differentiating with respect to
x and
, we obtain the following system of equations:
Determining the solution for this system yields the most efficient power consumption for a specified level of brightness.
Key mathematical components of a mobile phone flashlight app were modeled, such as power usage, light output, and brightness optimization. These models can improve the performance of the app and extend battery life.
In
Figure 22, a screenshot with the flashlight ON can be seen. When the rear-view camera flashlight is turned ON, a message is shown in “Toast” that the flashlight is turned ON; this way, the user will know the status of the flashlight. The flashlight can be changed by double-tapping anywhere on the screen. This is possible because there is a large invisible button on the entire screen. The flashlight can also be toggled off the lock screen from a notification. This function was implemented because the flashlight needs to have the ability to be controlled even when the mobile device is locked.
In
Figure 23, the message that the flashlight is OFF can be seen. This message appears when the flashlight is turned OFF to inform the user. To turn the flashlight ON, it can be tapped anywhere on the screen. The flashlight can be toggled in two modes, one by double-tapping anywhere on an unlocked screen or by tapping on the lock screen on the flashlight notification.