Safety App - a Project I made as a Student
Tags: octograd2020, github, android, kotlin
Published: 2020-05-22 09:21:09

As you might know, I am currently a student. As a mathematics undergraduate in the final year, Covid 19 has been a major setback. Recently, I found out about the [yearbook initiative by Github Education](https://github.com/education/graduation/pulls) and wanted to share a project of mine as a student.

It's a little difficult for me to consistently work on a project. Apart from studying and teaching students I also work as a part time web developer in DataSutram. Anyway this one had a personal interest.

Last year one of my friends told me about a kidnapping in her area and it scared me to my core. I thought if I could do anything to help it would be nice. So I made the [Safety App](https://play.google.com/store/apps/details?id=dev.abhattacharyea.safety)

## What it does

It's a pretty simple application. It's main feature is that it lets you select your **trusty** contacts and makes it easier to contact them during emergency.

You can choose as many contacts as you want.

![contacts](https://raw.githubusercontent.com/Herald-Of-Solace/Safety-App/master/device-2020-01-16-143022.png)

The app shows two persistent notifications

![notification](https://dev-to-uploads.s3.amazonaws.com/i/k14ss6un6cof59fk6goz.jpg)

The first one has 3 buttons. The first button is for making calls. If you click on it you will be shown a dialog with a list of your trusty contacts.

![contacts](https://raw.githubusercontent.com/Herald-Of-Solace/Safety-App/master/device-2020-01-16-143038.png)




If you click any of them, it will call the contact. The same with 2nd button except it launches the SMS app where you can send them an SMS.

The third button is the most important one - SOS. When you press it, it will send an SOS to **every** trusted contact with your location.

![SOS](https://dev-to-uploads.s3.amazonaws.com/i/w5j0wnj81xrygqaacp3u.jpg )

Observe that in every screenshot the first contact is called "Super Trusty Contact". It's because it is a special contact. How?

These notifications are visible in the lockscreen too. When your screen is locked, there is no way to show you which contact to pick. There it picks the first contact. That's why it's super trusty. Although, the SOS os **always** sent to **every** contact.

As for the 2nd notification, it's like the SOS but it lets you capture an audio and uploads it to the cloud and sends a link to your contacts.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0zveud49ztmoqhoc8wxa.jpg)

There is also a map in the app which shows you locations of nearby police stations, hospitals etc.

![map](https://raw.githubusercontent.com/Herald-Of-Solace/Safety-App/master/device-2020-01-16-142558.png)

If you click one of them, you can get at a glance a few infos and also a basic route.

![map](https://dev-to-uploads.s3.amazonaws.com/i/9ceov2uji8p2a2kj2amv.jpg)

![route](https://raw.githubusercontent.com/Herald-Of-Solace/Safety-App/master/device-2020-01-16-142639.png)


## How I made it

The app is written in Kotlin and open sourced [here](https://github.com/Herald-Of-Solace/Safety-App). Code wise this is not the best thing I have made. There are repetition everywhere, redundant codes and buggy stuff, but I wrote it in a hurry.

## Things to do

Currently there are a few bugs. The notifications don't show up in the lockscreen for some phones. The notifications might disappear. Sometimes the app also crashes and sometimes the location cannot be fetched.

I'm working on those issues and it's really difficult managing time for everything. Hopefully I'll get around to fixing them soon.

## Final words

The app is free forever and ad-free. This is an app that is meant to help people and I do not want to profit off ot. But still, the cloud is costly and I'm just a student managing my studies. If you find the app useful, and want to support development, you can donate from the app. You can also Paypal me at aniketmail669@gmail.com

P. S. Our state just faced the fiercest super cyclone since 1737 and we're in debris. It's been 48 hours and we still have no electricity and we've run out of water. So please #PrayForBengal and let's hope we can turn around.