Sunday, January 22, 2023

Updates 2022 - 2023

I've neglected updates for the past year. Nothing out of the ordinary. I am still in the same place. So far, this is the most extended position for a company I've maintained. Things are ok. Technically, I've not done wonders, but that's ok. I'm stable, and that is something I've always wanted. What have I been doing lately? I kept playing with Golang, but I've been playing with Kotlin and Android for the past weeks. I'm making a simple application, but starting with a new thing makes it look much more complex than it is. The app itself is pretty straight forward. I need to deliver a message when I'm a certain distance from my home, so someone opens my door, and I don't have to get down from my motorcycle. There are two things I considered doing. The first one. Kotlin + Android I've got to be honest, I've never been interested in Android, but for my particular requirement, it had what I needed, a GPS and the capability to send messages. The most complex thing is learning how to code on Android since you have to follow the rules to code on Android, and considering that for the last 16 years, I've been doing backend work on the web, this feels tedious. The code still looks amateurish, but it has the required things. - PeriodicWork that will run every 15 minutes. This is like a CRON or a periodical worker on Celery, that you can signal when to finish. I use this object because I'll be checking my location every 15 minutes, and when I'm at a certain distance, it's considered completed and finished. - I still have a Layout, my idea is to have a service with no UI, since this literally does not need a UI at all. - I don't need to configure anything at all. The coordinates of my home are hardcoded since I won't move. - The number of my contact will stay the same. TODOS - Send SMS or Whatsapp message, this is the biggest pending part, Android API > 23 it isn't so easy to send a message automatically, and it's considered a policy violation. I've got to figure out how to send the message without pressing SEND on both solutions since all the examples that I found requires me to complete the intent, and that is not the idea since it kills the whole concept. If I had to park and click a button, I wouldn't use the application. The other thing I considered, and it is far cheaper than a cellphone Arduino. It has a complexity because I need to learn more about electronics, but it has the two required modules, a GPS module and a Simcard module that I can put together, press a button, and check my location every certain minutes. I'd need some help on the electronics part, but it's the same idea sans the strict android rules. And also, the Arduino or a raspy is cheaper than a cellphone.