Posts

Programming the Atmel ATmega8L Microcontroller

Image
Introduction   In this article, I'll dive into hardware programming by working with a microcontroller (MCU). Having no prior experience with MCUs, this post will walk you through my learning process and project development. Getting Started   Based on a colleague's recommendation, I decided to use a USB-AVR programmer compatible with Atmel AVR microcontrollers. I ordered the USB-AVR programmer, an ATmega8L microcontroller, some resistors, LEDs, and a breadboard. For development, I prefer using IDEs due to their features like syntax highlighting and integrated build tools, which save time and resources. I chose Eclipse for this project. Setting up Eclipse for AVR programming involves installing the following libraries: gcc-avr : Compiler for Atmel AVR microcontrollers. binutils-avr : Cross-compiling version of GNU binutils. gdb-avr : GDB for debugging AVR binaries. avr-libc : C library for GCC on Atmel AVR microcontrollers. avrdude : Tool for transferring hex files onto the micr...

Sms Grocery List

Image
Widget with Grocery List Created from Received Messages Why? I often found myself with messages containing shopping lists that I wanted to keep track of while heading home. My initial idea was to create an invisible app that would read incoming messages and automatically add their content to Google Keep, displaying it in a widget. However, I discovered that Google Keep does not offer an API for third-party integration. As a result, I decided to develop an app with this functionality. What Did I Do? The application includes a receiver that captures all new messages. Once a message is received, the app scans for predefined keywords. You can configure multiple keywords to search for in incoming messages. Additionally, the app allows you to set up reminders, which will trigger notifications at a specific time of day when at least one message has been received. These settings can be found in the app's side menu under "Settings." The second key feature of the application is its...

Exploring Development for the Sony SmartWatch: First Edition

Image
Introduction In this post, we'll delve into the development for the first model of Sony Smart Watches. While the third edition is currently available, I recently had the chance to experiment with the original model. I picked up two Smart Watches at a local flea market for just 3 EUR each. However, they came without an adapter or wrist strap. Sony’s proprietary cable presented a challenge, but I managed to made my own using old USB cables. For anyone facing a similar issue, you only need two of the four pins on the cable: VCC (power) and ground. Setup Unlike common Android devices, there isn't a universal SDK for smartwatches. Each manufacturer provides their own SDK. To use official apps, you first need to install the "Smart Connect" app, which allows you to pair your watch with your device. After installation, you can download apps from the Google Play Store. Note that these apps won’t appear in the app list on the watch because they don't contain a runnable Acti...

Detecting Changes in Android Contacts

Introduction In this post, we'll explore how to detect changes in Android contacts. Android OS provides a mechanism for contact storage known as the Contacts Provider. This provider offers a structured set of data and a standard interface that connects data across different processes. Structure of Android Contacts ContactsRaw Table _id : RAW_CONTACT_ID account_name : e.g., email address account_type : e.g., com.google.com deleted : Indicates if the contact is deleted The ContactsContract.RawContacts.CONTENT_URI table contains original contacts, mainly storing RAW_CONTACT_ID . Contact details are stored in the ContactsContract.Data table. Contacts Table _id : CONTACT_ID (refers to a group of RAW_CONTACT_ID s) lookup : Provides a link to all contact details in this table The Contacts.CONTENT_URI table groups RawContacts based on merging rules. If a raw contact can't be grouped with an existing contact, a new contact is created. The LOOKUP_KEY is a permanent link to a conta...

Comparing Facebook and Google+ Login Integration for Android Apps

Recently, I had the opportunity to implement Facebook and Google+ login functionalities into an Android application. I decided to write a brief comparison of the two integration processes using Facebook SDK v4.3 and Google Play Services v4.3.23. Google+ Server-Side Setup : Requires creating a new app on the Google Developers Console. Android Manifest : You need to add the generated API key into the Android manifest file. Implementation : Involves a few methods. Your activity needs to implement ConnectionCallbacks and OnConnectionFailedListener . Facebook Server-Side Setup : Also requires creating a new app on the Facebook Developers site. Android Manifest : You need to add the generated API key to the Android manifest and declare one activity. SDK Compatibility : The SDK is not compatible with Eclipse directly; however, there are workarounds available on Stack Overflow. XML Customization : Customizing the Facebook button in XML requires overwriting styles in the Facebook SDK, which is...

Thermal Printer Perl Library

Image
What Last month, I developed a web GUI for my Raspberry Pi thermal printer. Despite extensive testing, I struggled with some fundamental tasks, such as printing text with diacritics and creating custom characters. Existing libraries were available in Python and C, but Perl options were limited and often lacked the methods I needed. This prompted me to create my own Perl library for the Adafruit thermal printer. What I Did I created a Perl library for the Adafruit thermal printer by thoroughly reviewing the printer's documentation and implementing methods for nearly every command mentioned. The library includes standard functionalities for altering fonts, generating barcodes, and printing images. Additionally, I added some custom features: Printing Images with Gradient Effects : This feature allows you to print images with a gradient effect, enhancing visual appeal. Aligning Images : If an image is narrower than the printing paper, this method adjusts its alignment. Registering Cust...

Connecting a Thermal Printer to a Raspberry Pi B+ with a Server-Side GUI

Image
What is a Thermal Printer? Thermal printers are commonly used for printing receipts in stores. They operate using special thermal paper that reacts to heat, allowing the printer to create images or text without needing ink. These printers are widely available for purchase online. When connecting a thermal printer to a Raspberry Pi, it's crucial to use an adapter with the correct amperage; otherwise, you may encounter issues like faded prints or no output at all. What I Did I successfully connected a thermal printer to a Raspberry Pi and configured it to periodically request new content from a server. I utilized a Python library to print images, barcodes, and formatted text. To make the printer more versatile, I developed a web-based GUI that allows users to create content for the printer. The features include formatted text input, a basic canvas for drawing, and a Sudoku generator with adjustable difficulty levels.